diff options
author | jstebbins <[email protected]> | 2009-04-05 01:48:55 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-04-05 01:48:55 +0000 |
commit | 4caaa83206bd65e7282a1f233c725530b7ead93e (patch) | |
tree | 91a102381d483bbce2e34cde732145691da91749 | |
parent | f8069bce73a349346eb5183449c723a426274e94 (diff) |
LinGui: add fullscreen option to preview
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2299 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | gtk/src/ghb.ui | 66 | ||||
-rw-r--r-- | gtk/src/internal_defaults.xml | 2 | ||||
-rw-r--r-- | gtk/src/main.c | 7 | ||||
-rw-r--r-- | gtk/src/preview.c | 42 | ||||
-rw-r--r-- | gtk/src/settings.c | 12 |
5 files changed, 88 insertions, 41 deletions
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index 7496d641d..983fb9c9e 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -4855,57 +4855,28 @@ location as the movie.</property> <property name="window_position">GTK_WIN_POS_CENTER</property> <property name="skip_taskbar_hint">True</property> <property name="skip_pager_hint">True</property> - <property name="allow-grow">False</property> + <property name="resizable">False</property> <property name="events">GDK_STRUCTURE_MASK</property> <signal handler="preview_configure_cb" name="configure-event"/> <signal handler="preview_window_delete_cb" name="delete_event"/> <child> - <object class="GtkHBox" id="hbox2"> + <object class="GtkAlignment" id="alignment111"> <property name="visible">True</property> - <property name="spacing">4</property> + <property name="xalign">.5</property> + <property name="yalign">.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> <child> - <object class="GtkVBox" id="vbox40"> + <object class="GtkDrawingArea" id="preview_image"> <property name="visible">True</property> - <property name="spacing">5</property> - <child> - <object class="GtkAlignment" id="alignment52"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - <property name="top_padding">2</property> - <property name="bottom_padding">2</property> - <property name="left_padding">2</property> - <property name="right_padding">2</property> - <child> - <object class="GtkDrawingArea" id="preview_image"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK</property> - <property name="app_paintable">True</property> - <signal name="motion-notify-event" handler="preview_motion_cb"/> - <signal name="leave-notify-event" handler="preview_leave_cb"/> - </object> - </child> - </object> - <packing> - <property name="position">0</property> - </packing> - </child> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK</property> + <property name="app_paintable">True</property> + <signal name="motion-notify-event" handler="preview_motion_cb"/> + <signal name="leave-notify-event" handler="preview_leave_cb"/> </object> <packing> - <property name="position">0</property> </packing> </child> - <child> - <object class="GtkVSeparator" id="vseparator2"> - <property name="visible">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="position">1</property> - </packing> - </child> - </object> </child> </object> @@ -5060,6 +5031,19 @@ location as the movie.</property> </packing> </child> <child> + <object class="GtkToggleButton" id="preview_fullscreen"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip-text" translatable="yes">View Fullscreen Preview</property> + <property name="label" translatable="yes">Fullscreen</property> + <signal handler="fullscreen_clicked_cb" name="clicked"/> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> <object class="GtkButton" id="settings_button"> <property name="visible">True</property> <property name="can_focus">True</property> @@ -5069,7 +5053,7 @@ location as the movie.</property> </object> <packing> <property name="expand">False</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> </object> diff --git a/gtk/src/internal_defaults.xml b/gtk/src/internal_defaults.xml index 65201e89c..260f80090 100644 --- a/gtk/src/internal_defaults.xml +++ b/gtk/src/internal_defaults.xml @@ -120,6 +120,8 @@ <false /> <key>preview_count</key> <integer>10</integer> + <key>preview_fullscreen</key> + <false /> <key>preview_x</key> <integer>-1</integer> <key>preview_y</key> diff --git a/gtk/src/main.c b/gtk/src/main.c index 2822070ab..4c7952fa3 100644 --- a/gtk/src/main.c +++ b/gtk/src/main.c @@ -646,6 +646,13 @@ main (int argc, char *argv[]) win = widget->window; gdk_window_reparent(win, parent, 0, 0); +/* + if (ghb_settings_get_boolean(ud->settings, "preview_fullscreen")) + { + gtk_window_set_resizable(window, TRUE); + gtk_window_fullscreen(window); + } +*/ gtk_main (); ghb_backend_close(); if (ud->queue) diff --git a/gtk/src/preview.c b/gtk/src/preview.c index e188a0413..c18d28015 100644 --- a/gtk/src/preview.c +++ b/gtk/src/preview.c @@ -800,6 +800,9 @@ picture_settings_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) if (x >= 0 && y >= 0) gtk_window_move(GTK_WINDOW(widget), x, y); set_visible(widget, active); + // The window may be hidden behind the main window, raise it + if (active) + gtk_window_present(GTK_WINDOW(widget)); } } @@ -815,6 +818,45 @@ picture_settings_alt_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(toggle), !active); } +static void +go_full(signal_user_data_t *ud) +{ + GtkWindow *window; + window = GTK_WINDOW(GHB_WIDGET (ud->builder, "preview_window")); + gtk_window_fullscreen(window); +} + +G_MODULE_EXPORT void +fullscreen_clicked_cb(GtkWidget *toggle, signal_user_data_t *ud) +{ + gboolean active; + GtkWindow *window; + + g_debug("fullscreen_clicked_cb()"); + ghb_widget_to_setting (ud->settings, toggle); + ghb_check_dependency(ud, toggle); + const gchar *name = gtk_widget_get_name(toggle); + ghb_pref_save(ud->settings, name); + + window = GTK_WINDOW(GHB_WIDGET (ud->builder, "preview_window")); + active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle)); + if (active) + { + gtk_window_set_resizable(window, TRUE); + gtk_button_set_label(GTK_BUTTON(toggle), "Windowed"); + // Changing resizable property doesn't take effect immediately + // need to delay fullscreen till after this callback returns + // to mainloop + g_idle_add((GSourceFunc)go_full, ud); + } + else + { + gtk_window_unfullscreen(window); + gtk_window_set_resizable(window, FALSE); + gtk_button_set_label(GTK_BUTTON(toggle), "Fullscreen"); + } +} + G_MODULE_EXPORT void picture_settings_alt2_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) { diff --git a/gtk/src/settings.c b/gtk/src/settings.c index 5912fba52..c6657707f 100644 --- a/gtk/src/settings.c +++ b/gtk/src/settings.c @@ -232,6 +232,13 @@ ghb_widget_value(GtkWidget *widget) bval = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); value = ghb_boolean_value_new(bval); } + else if (type == GTK_TYPE_TOGGLE_BUTTON) + { + g_debug("\ttoggle_button"); + gboolean bval; + bval = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); + value = ghb_boolean_value_new(bval); + } else if (type == GTK_TYPE_TOGGLE_ACTION) { g_debug("\ttoggle action"); @@ -456,6 +463,11 @@ update_widget(GtkWidget *widget, const GValue *value) g_debug("check button"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), ival); } + else if (type == GTK_TYPE_TOGGLE_BUTTON) + { + g_debug("toggle button"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), ival); + } else if (type == GTK_TYPE_TOGGLE_ACTION) { g_debug("toggle action"); |