summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-28 18:11:24 +0200
committerraveit65 <[email protected]>2016-07-14 16:15:12 +0200
commit0c487078ad79809e60242a7cb4035756fce4b95e (patch)
treeccddef31b7e1bba8c407b427a420b60be2fc2579
parentb6a3e80fcc696a941958e574716cd740c6667f65 (diff)
downloadcaja-0c487078ad79809e60242a7cb4035756fce4b95e.tar.bz2
caja-0c487078ad79809e60242a7cb4035756fce4b95e.tar.xz
GTK+-3 pathbar: do not use deprecated gtk_arrow_new
use instead a symbolic icon taken from: https://git.gnome.org/browse/nautilus/commit/src?id=25c898b
-rw-r--r--src/caja-pathbar.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c
index 90c966b2..6211efc6 100644
--- a/src/caja-pathbar.c
+++ b/src/caja-pathbar.c
@@ -159,32 +159,46 @@ static gboolean caja_path_bar_update_path (CajaPathBar *path_bar,
GFile *file_path,
gboolean emit_signal);
+#if GTK_CHECK_VERSION(3,0,0)
static GtkWidget *
get_slider_button (CajaPathBar *path_bar,
- GtkArrowType arrow_type)
+ const gchar *arrow_type)
{
GtkWidget *button;
-#if !GTK_CHECK_VERSION(3,0,0)
- gtk_widget_push_composite_child ();
-#endif
-
button = gtk_button_new ();
#if GTK_CHECK_VERSION(3,20,0)
gtk_widget_set_focus_on_click (button, FALSE);
#else
gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
#endif
+ gtk_container_add (GTK_CONTAINER (button),
+ gtk_image_new_from_icon_name (arrow_type, GTK_ICON_SIZE_MENU));
+ gtk_container_add (GTK_CONTAINER (path_bar), button);
+ gtk_widget_show_all (button);
+
+ return button;
+}
+#else
+static GtkWidget *
+get_slider_button (CajaPathBar *path_bar,
+ GtkArrowType arrow_type)
+{
+ GtkWidget *button;
+
+ gtk_widget_push_composite_child ();
+
+ button = gtk_button_new ();
+ gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
gtk_container_add (GTK_CONTAINER (button), gtk_arrow_new (arrow_type, GTK_SHADOW_OUT));
gtk_container_add (GTK_CONTAINER (path_bar), button);
gtk_widget_show_all (button);
-#if !GTK_CHECK_VERSION(3,0,0)
gtk_widget_pop_composite_child ();
-#endif
return button;
}
+#endif
static void
update_button_types (CajaPathBar *path_bar)
@@ -338,8 +352,13 @@ caja_path_bar_init (CajaPathBar *path_bar)
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (path_bar), FALSE);
path_bar->spacing = 3;
+#if GTK_CHECK_VERSION(3, 0, 0)
+ path_bar->up_slider_button = get_slider_button (path_bar, "pan-start-symbolic");
+ path_bar->down_slider_button = get_slider_button (path_bar, "pan-end-symbolic");
+#else
path_bar->up_slider_button = get_slider_button (path_bar, GTK_ARROW_LEFT);
path_bar->down_slider_button = get_slider_button (path_bar, GTK_ARROW_RIGHT);
+#endif
path_bar->icon_size = CAJA_PATH_BAR_ICON_SIZE;
p = caja_get_desktop_directory ();