Ctrl+F11 -> fullscreen (nsgtk only)

svn path=/trunk/netsurf/; revision=3389
This commit is contained in:
John Mark Bell 2007-07-09 12:49:22 +00:00
parent 17ab65e69a
commit a3fcf23c3b
2 changed files with 65 additions and 17 deletions

View File

@ -64,6 +64,8 @@ struct gtk_scaffolding {
int throb_frame;
struct gui_window *top_level;
int being_destroyed;
bool fullscreen;
};
struct gtk_history_window {
@ -121,6 +123,7 @@ MENUPROTO(reload);
MENUPROTO(zoom_in);
MENUPROTO(normal_size);
MENUPROTO(zoom_out);
MENUPROTO(full_screen);
MENUPROTO(save_window_size);
MENUPROTO(toggle_debug_rendering);
@ -154,6 +157,7 @@ static struct menu_events menu_events[] = {
MENUEVENT(zoom_in),
MENUEVENT(normal_size),
MENUEVENT(zoom_out),
MENUEVENT(full_screen),
MENUEVENT(save_window_size),
MENUEVENT(toggle_debug_rendering),
@ -441,6 +445,21 @@ MENUHANDLER(zoom_out)
return TRUE;
}
MENUHANDLER(full_screen)
{
struct gtk_scaffolding *gw = (struct gtk_scaffolding *)g;
if (gw->fullscreen) {
gtk_window_unfullscreen(gw->window);
} else {
gtk_window_fullscreen(gw->window);
}
gw->fullscreen = !gw->fullscreen;
return TRUE;
}
MENUHANDLER(save_window_size)
{
struct gtk_scaffolding *gw = (struct gtk_scaffolding *)g;
@ -737,6 +756,8 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
g->being_destroyed = 0;
g->fullscreen = false;
/* finally, show the window. */
gtk_widget_show(GTK_WIDGET(g->window));

View File

@ -48,7 +48,7 @@
<accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image501">
<widget class="GtkImage" id="image520">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
@ -80,7 +80,7 @@
<accelerator key="F" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image502">
<widget class="GtkImage" id="image521">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
<property name="icon_size">1</property>
@ -102,7 +102,7 @@
<accelerator key="W" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image503">
<widget class="GtkImage" id="image522">
<property name="visible">True</property>
<property name="stock">gtk-close</property>
<property name="icon_size">1</property>
@ -131,7 +131,7 @@
<accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image504">
<widget class="GtkImage" id="image523">
<property name="visible">True</property>
<property name="stock">gtk-save-as</property>
<property name="icon_size">1</property>
@ -201,7 +201,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image505">
<widget class="GtkImage" id="image524">
<property name="visible">True</property>
<property name="stock">gtk-print-preview</property>
<property name="icon_size">1</property>
@ -224,7 +224,7 @@
<accelerator key="P" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image506">
<widget class="GtkImage" id="image525">
<property name="visible">True</property>
<property name="stock">gtk-print</property>
<property name="icon_size">1</property>
@ -348,7 +348,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image507">
<widget class="GtkImage" id="image526">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
<property name="icon_size">1</property>
@ -382,7 +382,7 @@
<accelerator key="Escape" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image508">
<widget class="GtkImage" id="image527">
<property name="visible">True</property>
<property name="stock">gtk-stop</property>
<property name="icon_size">1</property>
@ -403,7 +403,7 @@
<accelerator key="F5" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image509">
<widget class="GtkImage" id="image528">
<property name="visible">True</property>
<property name="stock">gtk-refresh</property>
<property name="icon_size">1</property>
@ -431,7 +431,7 @@
<accelerator key="F11" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image510">
<widget class="GtkImage" id="image529">
<property name="visible">True</property>
<property name="stock">gtk-zoom-in</property>
<property name="icon_size">1</property>
@ -453,7 +453,7 @@
<accelerator key="plus" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image511">
<widget class="GtkImage" id="image530">
<property name="visible">True</property>
<property name="stock">gtk-zoom-in</property>
<property name="icon_size">1</property>
@ -474,7 +474,7 @@
<accelerator key="0" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image512">
<widget class="GtkImage" id="image531">
<property name="visible">True</property>
<property name="stock">gtk-zoom-100</property>
<property name="icon_size">1</property>
@ -495,7 +495,7 @@
<accelerator key="minus" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image513">
<widget class="GtkImage" id="image532">
<property name="visible">True</property>
<property name="stock">gtk-zoom-out</property>
<property name="icon_size">1</property>
@ -512,6 +512,33 @@
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="full_screen">
<property name="visible">True</property>
<property name="label" translatable="yes">Fullscreen</property>
<property name="use_underline">True</property>
<accelerator key="F11" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image533">
<property name="visible">True</property>
<property name="stock">gtk-fullscreen</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separator12">
<property name="visible">True</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="images">
<property name="visible">True</property>
@ -656,7 +683,7 @@
<accelerator key="Left" modifiers="GDK_MOD1_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image514">
<widget class="GtkImage" id="image534">
<property name="visible">True</property>
<property name="stock">gtk-go-back</property>
<property name="icon_size">1</property>
@ -677,7 +704,7 @@
<accelerator key="Right" modifiers="GDK_MOD1_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image515">
<widget class="GtkImage" id="image535">
<property name="visible">True</property>
<property name="stock">gtk-go-forward</property>
<property name="icon_size">1</property>
@ -698,7 +725,7 @@
<accelerator key="Home" modifiers="GDK_MOD1_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image516">
<widget class="GtkImage" id="image536">
<property name="visible">True</property>
<property name="stock">gtk-home</property>
<property name="icon_size">1</property>
@ -787,7 +814,7 @@
<accelerator key="F1" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image517">
<widget class="GtkImage" id="image537">
<property name="visible">True</property>
<property name="stock">gtk-help</property>
<property name="icon_size">1</property>