diff options
author | jstebbins <[email protected]> | 2009-04-05 17:19:54 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-04-05 17:19:54 +0000 |
commit | ec0cc708915af88c2e0ba97303ac188b92227969 (patch) | |
tree | 3cd1ec703ffb1b9465bdde09f1d1df156ff875ba | |
parent | c0b34352cbbb90baa3d015c9438f731ff05e50fb (diff) |
LinGui: oops, forgot to actually rescale the image when making the
preview window fullscreen
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2303 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | gtk/src/ghb.ui | 1 | ||||
-rw-r--r-- | gtk/src/preview.c | 61 |
2 files changed, 47 insertions, 15 deletions
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index 983fb9c9e..94e6c53f6 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -4873,6 +4873,7 @@ location as the movie.</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"/> + <signal handler="preview_image_configure_cb" name="configure-event"/> </object> <packing> </packing> diff --git a/gtk/src/preview.c b/gtk/src/preview.c index c18d28015..61647a400 100644 --- a/gtk/src/preview.c +++ b/gtk/src/preview.c @@ -819,11 +819,36 @@ picture_settings_alt_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) } static void +hud_set_position(signal_user_data_t *ud) +{ + GtkWidget *widget; + GdkWindow *parent, *win; + gint pw, ph, w, h, x, y; + + widget = GHB_WIDGET(ud->builder, "preview_image"); + //parent = gtk_widget_get_window(widget); + parent = widget->window; + widget = GHB_WIDGET(ud->builder, "preview_hud"); + //win = gtk_widget_get_window(widget); + win = widget->window; + gdk_drawable_get_size(GDK_DRAWABLE(parent), &pw, &ph); + gdk_drawable_get_size(GDK_DRAWABLE(win), &w, &h); + x = pw/2 - w/2; + if (ph/4 > h/2) + y = ph - ph/4 - h/2; + else + y = ph - h; + gdk_window_move(win, x, y); +} + +static gboolean go_full(signal_user_data_t *ud) { GtkWindow *window; window = GTK_WINDOW(GHB_WIDGET (ud->builder, "preview_window")); gtk_window_fullscreen(window); + ghb_set_preview_image(ud); + return FALSE; } G_MODULE_EXPORT void @@ -854,6 +879,7 @@ fullscreen_clicked_cb(GtkWidget *toggle, signal_user_data_t *ud) gtk_window_unfullscreen(window); gtk_window_set_resizable(window, FALSE); gtk_button_set_label(GTK_BUTTON(toggle), "Fullscreen"); + ghb_set_preview_image(ud); } } @@ -1049,30 +1075,35 @@ preview_motion_cb( else { GtkWidget *widget; - GdkWindow *parent, *win; - gint pw, ph, w, h, x, y; - widget = GHB_WIDGET(ud->builder, "preview_image"); - //parent = gtk_widget_get_window(widget); - parent = widget->window; widget = GHB_WIDGET(ud->builder, "preview_hud"); - //win = gtk_widget_get_window(widget); - win = widget->window; gtk_widget_show(widget); - gdk_drawable_get_size(GDK_DRAWABLE(parent), &pw, &ph); - gdk_drawable_get_size(GDK_DRAWABLE(win), &w, &h); - x = pw/2 - w/2; - if (ph/4 > h/2) - y = ph - ph/4 - h/2; - else - y = ph - h; - gdk_window_move(win, x, y); + hud_set_position(ud); } hud_timeout_id = g_timeout_add_seconds(10, (GSourceFunc)hud_timeout, ud); return FALSE; } G_MODULE_EXPORT gboolean +preview_image_configure_cb( + GtkWidget *widget, + GdkEventConfigure *event, + signal_user_data_t *ud) +{ + static gint w = 0, h = 0; + + g_debug("preview_image_configure_cb()"); + if ((w != event->width) || (h != event->height)) + { + w = event->width; + h = event->height; + hud_set_position(ud); + } + return FALSE; +} + + +G_MODULE_EXPORT gboolean preview_configure_cb( GtkWidget *widget, GdkEventConfigure *event, |