summaryrefslogtreecommitdiffstats
path: root/gtk/src/preview.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-04-05 01:48:55 +0000
committerjstebbins <[email protected]>2009-04-05 01:48:55 +0000
commit4caaa83206bd65e7282a1f233c725530b7ead93e (patch)
tree91a102381d483bbce2e34cde732145691da91749 /gtk/src/preview.c
parentf8069bce73a349346eb5183449c723a426274e94 (diff)
LinGui: add fullscreen option to preview
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2299 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/preview.c')
-rw-r--r--gtk/src/preview.c42
1 files changed, 42 insertions, 0 deletions
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)
{