SHA256
1
0
forked from pool/nemo
nemo/nemo-statusbar-size.patch

111 lines
4.9 KiB
Diff

--- a/libnemo-extension/nemo-simple-button.c
+++ b/libnemo-extension/nemo-simple-button.c
@@ -41,26 +41,30 @@ NemoSimpleButton *
nemo_simple_button_new_from_icon_name (const gchar *icon_name, int icon_size)
{
GtkWidget *w, *image;
+ GtkIconInfo *icon_info;
+ GdkRGBA colour;
+
+ gdk_rgba_parse (&colour, "rgba(0.0,0.0,0.0,1.0)");
w = g_object_new (NEMO_TYPE_SIMPLE_BUTTON, NULL);
- image = gtk_image_new_from_icon_name (icon_name, icon_size);
+ icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (),
+ icon_name, icon_size,
+ GTK_ICON_LOOKUP_FORCE_SIZE);
+ image = gtk_image_new_from_pixbuf (gtk_icon_info_load_symbolic (
+ icon_info, &colour,
+ NULL, NULL, NULL, NULL, NULL));
+
gtk_button_set_image (GTK_BUTTON (w), image);
return NEMO_SIMPLE_BUTTON (w);
}
+/* Deprecated since Gtk 3.10. */
NemoSimpleButton *
nemo_simple_button_new_from_stock (const gchar *stock_id, int icon_size)
{
- GtkWidget *w, *image;
-
- w = g_object_new (NEMO_TYPE_SIMPLE_BUTTON, NULL);
-
- image = gtk_image_new_from_stock (stock_id, icon_size);
- gtk_button_set_image (GTK_BUTTON (w), image);
-
- return NEMO_SIMPLE_BUTTON (w);
+ return nemo_simple_button_new_from_icon_name(stock_id, icon_size);
}
NemoSimpleButton *
--- a/src/nemo-statusbar.c
+++ b/src/nemo-statusbar.c
@@ -186,16 +186,24 @@ nemo_status_bar_constructed (GObject *ob
bar->real_statusbar = statusbar;
- GtkIconSize size = gtk_icon_size_from_name (NEMO_STATUSBAR_ICON_SIZE_NAME);
+ gint size = 16; /* Unscaled size. */
context = gtk_widget_get_style_context (GTK_WIDGET (bar));
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOOLBAR);
gtk_container_set_border_width (GTK_CONTAINER (bar), 2);
GtkWidget *button, *icon;
+ GtkIconInfo *icon_info;
+ GdkRGBA colour;
+
+ gdk_rgba_parse (&colour, "rgba(0.0,0.0,0.0,1.0)");
button = gtk_toggle_button_new ();
- icon = gtk_image_new_from_icon_name ("sidebar-places-symbolic", size);
+ icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (),
+ "sidebar-places-symbolic", size,
+ GTK_ICON_LOOKUP_FORCE_SIZE);
+ icon = gtk_image_new_from_pixbuf (gtk_icon_info_load_symbolic (icon_info,
+ &colour, NULL, NULL, NULL, NULL, NULL));
gtk_button_set_image (GTK_BUTTON (button), icon);
gtk_widget_set_tooltip_text (GTK_WIDGET (button), _("Show Places"));
bar->places_button = button;
@@ -204,7 +212,11 @@ nemo_status_bar_constructed (GObject *ob
G_CALLBACK (action_places_toggle_callback), bar);
button = gtk_toggle_button_new ();
- icon = gtk_image_new_from_icon_name ("sidebar-tree-symbolic", size);
+ icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (),
+ "sidebar-tree-symbolic", size,
+ GTK_ICON_LOOKUP_FORCE_SIZE);
+ icon = gtk_image_new_from_pixbuf (gtk_icon_info_load_symbolic (icon_info,
+ &colour, NULL, NULL, NULL, NULL, NULL));
gtk_button_set_image (GTK_BUTTON (button), icon);
gtk_widget_set_tooltip_text (GTK_WIDGET (button), _("Show Treeview"));
bar->tree_button = button;
@@ -218,7 +230,11 @@ nemo_status_bar_constructed (GObject *ob
bar->separator = sep;
button = gtk_button_new ();
- icon = gtk_image_new_from_icon_name ("sidebar-hide-symbolic", size);
+ icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (),
+ "sidebar-hide-symbolic", size,
+ GTK_ICON_LOOKUP_FORCE_SIZE);
+ icon = gtk_image_new_from_pixbuf (gtk_icon_info_load_symbolic (icon_info,
+ &colour, NULL, NULL, NULL, NULL, NULL));
gtk_button_set_image (GTK_BUTTON (button), icon);
gtk_widget_set_tooltip_text (GTK_WIDGET (button), _("Hide the Sidebar (F9)"));
bar->hide_button = button;
@@ -227,7 +243,11 @@ nemo_status_bar_constructed (GObject *ob
G_CALLBACK (action_hide_sidebar_callback), bar);
button = gtk_button_new ();
- icon = gtk_image_new_from_icon_name ("sidebar-show-symbolic", size);
+ icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (),
+ "sidebar-show-symbolic", size,
+ GTK_ICON_LOOKUP_FORCE_SIZE);
+ icon = gtk_image_new_from_pixbuf (gtk_icon_info_load_symbolic (icon_info,
+ &colour, NULL, NULL, NULL, NULL, NULL));
gtk_button_set_image (GTK_BUTTON (button), icon);
gtk_widget_set_tooltip_text (GTK_WIDGET (button), _("Show the Sidebar (F9)"));
bar->show_button = button;