From e71c723f62971343e9ca83d3371a0ded28747e48 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Tue, 26 May 2015 09:39:08 +0200 Subject: Remove extra resize-grip code - gtk+ handle this for itself since a long time - with <=3.14 resize-grip is removed - with gtk2 is not affected --- plugins/statusbar-date/eom-statusbar-date-plugin.c | 3 --- src/eom-statusbar.c | 17 ----------------- src/eom-statusbar.h | 5 ----- src/eom-window.c | 3 --- 4 files changed, 28 deletions(-) diff --git a/plugins/statusbar-date/eom-statusbar-date-plugin.c b/plugins/statusbar-date/eom-statusbar-date-plugin.c index 427c218..9e405b4 100644 --- a/plugins/statusbar-date/eom-statusbar-date-plugin.c +++ b/plugins/statusbar-date/eom-statusbar-date-plugin.c @@ -124,9 +124,6 @@ static void impl_activate(EomPlugin* plugin, EomWindow* window) data = g_new(WindowData, 1); data->statusbar_date = gtk_statusbar_new(); -#if !GTK_CHECK_VERSION (3, 0, 0) - gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(data->statusbar_date), FALSE); -#endif gtk_widget_set_size_request(data->statusbar_date, 200, 10); gtk_box_pack_end(GTK_BOX(statusbar), data->statusbar_date, FALSE, FALSE, 0); diff --git a/src/eom-statusbar.c b/src/eom-statusbar.c index b4d6f08..634818e 100644 --- a/src/eom-statusbar.c +++ b/src/eom-statusbar.c @@ -58,14 +58,7 @@ eom_statusbar_init (EomStatusbar *statusbar) statusbar->priv = EOM_STATUSBAR_GET_PRIVATE (statusbar); priv = statusbar->priv; - #if !GTK_CHECK_VERSION(3, 0, 0) - gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar), TRUE); - #endif - priv->img_num_statusbar = gtk_statusbar_new (); - #if !GTK_CHECK_VERSION(3, 0, 0) - gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (priv->img_num_statusbar), FALSE); - #endif gtk_widget_set_size_request (priv->img_num_statusbar, 100, 10); gtk_widget_show (priv->img_num_statusbar); @@ -155,13 +148,3 @@ eom_statusbar_set_progress (EomStatusbar *statusbar, } } -#if !GTK_CHECK_VERSION(3, 0, 0) -void -eom_statusbar_set_has_resize_grip (EomStatusbar *statusbar, gboolean has_resize_grip) -{ - g_return_if_fail (EOM_IS_STATUSBAR (statusbar)); - - gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar), - has_resize_grip); -} -#endif diff --git a/src/eom-statusbar.h b/src/eom-statusbar.h index cf263d4..4ecedec 100644 --- a/src/eom-statusbar.h +++ b/src/eom-statusbar.h @@ -63,11 +63,6 @@ void eom_statusbar_set_image_number (EomStatusbar *statusbar, void eom_statusbar_set_progress (EomStatusbar *statusbar, gdouble progress); -#if !GTK_CHECK_VERSION(3, 0, 0) -void eom_statusbar_set_has_resize_grip (EomStatusbar *statusbar, - gboolean has_resize_grip); -#endif - G_END_DECLS #endif /* __EOM_STATUSBAR_H__ */ diff --git a/src/eom-window.c b/src/eom-window.c index ef8dd9d..7484db3 100644 --- a/src/eom-window.c +++ b/src/eom-window.c @@ -4949,9 +4949,6 @@ eom_window_window_state_event (GtkWidget *widget, show = !(event->new_window_state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)); - - eom_statusbar_set_has_resize_grip (EOM_STATUSBAR (window->priv->statusbar), - show); } return FALSE; -- cgit v1.2.1 From f71fa9d585bb6426658fac9b6236a566bb8b8fbd Mon Sep 17 00:00:00 2001 From: raveit65 Date: Tue, 26 May 2015 10:10:40 +0200 Subject: Use a simple GtkLabel for the image counter in the statusbar This was an extra GtkStatusbar before. This is not needed anymore as the resize handle now works independently from the GtkStatusbar. Also the GtkLabel seems to require less horizontal space in the statusbar. --- src/eom-statusbar.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/eom-statusbar.c b/src/eom-statusbar.c index 634818e..215b9db 100644 --- a/src/eom-statusbar.c +++ b/src/eom-statusbar.c @@ -38,7 +38,7 @@ G_DEFINE_TYPE (EomStatusbar, eom_statusbar, GTK_TYPE_STATUSBAR) struct _EomStatusbarPrivate { GtkWidget *progressbar; - GtkWidget *img_num_statusbar; + GtkWidget *img_num_label; }; static void @@ -58,12 +58,12 @@ eom_statusbar_init (EomStatusbar *statusbar) statusbar->priv = EOM_STATUSBAR_GET_PRIVATE (statusbar); priv = statusbar->priv; - priv->img_num_statusbar = gtk_statusbar_new (); - gtk_widget_set_size_request (priv->img_num_statusbar, 100, 10); - gtk_widget_show (priv->img_num_statusbar); + priv->img_num_label = gtk_label_new (NULL); + gtk_widget_set_size_request (priv->img_num_label, 100, 10); + gtk_widget_show (priv->img_num_label); gtk_box_pack_end (GTK_BOX (statusbar), - priv->img_num_statusbar, + priv->img_num_label, FALSE, TRUE, 0); @@ -107,8 +107,6 @@ eom_statusbar_set_image_number (EomStatusbar *statusbar, g_return_if_fail (EOM_IS_STATUSBAR (statusbar)); - gtk_statusbar_pop (GTK_STATUSBAR (statusbar->priv->img_num_statusbar), 0); - /* Hide number display if values don't make sense */ if (G_UNLIKELY (num <= 0 || tot <= 0)) return; @@ -125,7 +123,7 @@ eom_statusbar_set_image_number (EomStatusbar *statusbar, * too.*/ msg = g_strdup_printf (_("%d / %d"), num, tot); - gtk_statusbar_push (GTK_STATUSBAR (statusbar->priv->img_num_statusbar), 0, msg); + gtk_label_set_text (GTK_LABEL (statusbar->priv->img_num_label), msg); g_free (msg); } @@ -141,10 +139,10 @@ eom_statusbar_set_progress (EomStatusbar *statusbar, if (progress > 0 && progress < 1) { gtk_widget_show (statusbar->priv->progressbar); - gtk_widget_hide (statusbar->priv->img_num_statusbar); + gtk_widget_hide (statusbar->priv->img_num_label); } else { gtk_widget_hide (statusbar->priv->progressbar); - gtk_widget_show (statusbar->priv->img_num_statusbar); + gtk_widget_show (statusbar->priv->img_num_label); } } -- cgit v1.2.1 From 7a62bafbf0dc023c46d885913fb467c2ec372b47 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Tue, 26 May 2015 11:05:23 +0200 Subject: set margin of statusbar to zero --- src/eom-statusbar.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/eom-statusbar.c b/src/eom-statusbar.c index 215b9db..e825e97 100644 --- a/src/eom-statusbar.c +++ b/src/eom-statusbar.c @@ -58,6 +58,11 @@ eom_statusbar_init (EomStatusbar *statusbar) statusbar->priv = EOM_STATUSBAR_GET_PRIVATE (statusbar); priv = statusbar->priv; +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_margin_top (GTK_WIDGET (statusbar), 0); + gtk_widget_set_margin_bottom (GTK_WIDGET (statusbar), 0); +#endif + priv->img_num_label = gtk_label_new (NULL); gtk_widget_set_size_request (priv->img_num_label, 100, 10); gtk_widget_show (priv->img_num_label); -- cgit v1.2.1 From 319803b5ac8b34ef7204ab2bd1b5b0123440ded9 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Wed, 27 May 2015 13:24:17 +0200 Subject: remove eom_window_window_state_event - no need of it after exra resize-grip code is removed taken from https://git.gnome.org/browse/eog/commit/?id=10f1713 --- src/eom-window.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/eom-window.c b/src/eom-window.c index 7484db3..fef0b52 100644 --- a/src/eom-window.c +++ b/src/eom-window.c @@ -4932,29 +4932,6 @@ eom_window_button_press (GtkWidget *widget, GdkEventButton *event) return result; } -#if !GTK_CHECK_VERSION (3, 0, 0) -static gboolean -eom_window_window_state_event (GtkWidget *widget, - GdkEventWindowState *event) -{ - EomWindow *window; - - g_return_val_if_fail (EOM_IS_WINDOW (widget), TRUE); - - window = EOM_WINDOW (widget); - - if (event->changed_mask & - (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)) { - gboolean show; - - show = !(event->new_window_state & - (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)); - } - - return FALSE; -} -#endif - static gboolean eom_window_focus_out_event (GtkWidget *widget, GdkEventFocus *event) { @@ -5069,9 +5046,6 @@ eom_window_class_init (EomWindowClass *class) widget_class->key_press_event = eom_window_key_press; widget_class->button_press_event = eom_window_button_press; widget_class->drag_data_received = eom_window_drag_data_received; -#if !GTK_CHECK_VERSION (3, 0, 0) - widget_class->window_state_event = eom_window_window_state_event; -#endif widget_class->focus_out_event = eom_window_focus_out_event; /** -- cgit v1.2.1