Skip to content

Commit 920654f

Browse files
committed
nemo-trash-monitor.c: Add a new path for the symbolic icon. Our file
views need a non-symbolic icon.
1 parent 2b630d2 commit 920654f

5 files changed

Lines changed: 27 additions & 12 deletions

File tree

libnemo-private/nemo-trash-monitor.c

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
struct NemoTrashMonitorDetails {
3838
gboolean empty;
3939
GIcon *icon;
40+
GIcon *symbolic_icon;
4041
GFileMonitor *file_monitor;
4142
};
4243

@@ -60,6 +61,9 @@ nemo_trash_monitor_finalize (GObject *object)
6061
if (trash_monitor->details->icon) {
6162
g_object_unref (trash_monitor->details->icon);
6263
}
64+
if (trash_monitor->details->symbolic_icon) {
65+
g_object_unref (trash_monitor->details->icon);
66+
}
6367
if (trash_monitor->details->file_monitor) {
6468
g_object_unref (trash_monitor->details->file_monitor);
6569
}
@@ -95,9 +99,11 @@ update_icon (NemoTrashMonitor *trash_monitor)
9599
g_clear_object (&trash_monitor->details->icon);
96100

97101
if (trash_monitor->details->empty) {
98-
trash_monitor->details->icon = g_themed_icon_new (NEMO_ICON_SYMBOLIC_TRASH);
102+
trash_monitor->details->icon = g_themed_icon_new (NEMO_ICON_TRASH);
103+
trash_monitor->details->symbolic_icon = g_themed_icon_new (NEMO_ICON_SYMBOLIC_TRASH);
99104
} else {
100-
trash_monitor->details->icon = g_themed_icon_new (NEMO_ICON_SYMBOLIC_TRASH_FULL);
105+
trash_monitor->details->icon = g_themed_icon_new (NEMO_ICON_TRASH_FULL);
106+
trash_monitor->details->symbolic_icon = g_themed_icon_new (NEMO_ICON_SYMBOLIC_TRASH_FULL);
101107
}
102108
}
103109

@@ -243,6 +249,18 @@ nemo_trash_monitor_get_icon (void)
243249
return NULL;
244250
}
245251

252+
GIcon *
253+
nemo_trash_monitor_get_symbolic_icon (void)
254+
{
255+
NemoTrashMonitor *monitor;
256+
257+
monitor = nemo_trash_monitor_get ();
258+
if (monitor->details->symbolic_icon) {
259+
return g_object_ref (monitor->details->symbolic_icon);
260+
}
261+
return NULL;
262+
}
263+
246264
void
247265
nemo_trash_monitor_add_new_trash_directories (void)
248266
{

libnemo-private/nemo-trash-monitor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ GType nemo_trash_monitor_get_type (void);
6262
NemoTrashMonitor *nemo_trash_monitor_get (void);
6363
gboolean nemo_trash_monitor_is_empty (void);
6464
GIcon *nemo_trash_monitor_get_icon (void);
65+
GIcon *nemo_trash_monitor_get_symbolic_icon (void);
6566

6667
void nemo_trash_monitor_add_new_trash_directories (void);
6768

src/nemo-pathbar.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,10 @@ trash_state_changed_cb (NemoTrashMonitor *monitor,
247247
button_data = BUTTON_DATA (list->data);
248248
if (g_file_equal (file, button_data->path)) {
249249
GIcon *icon;
250-
NemoIconInfo *icon_info;
251-
GdkPixbuf *pixbuf;
252-
253-
icon = nemo_trash_monitor_get_icon ();
254-
icon_info = nemo_icon_info_lookup (icon, NEMO_PATH_BAR_ICON_SIZE,
255-
gtk_widget_get_scale_factor (GTK_WIDGET (path_bar)));
256-
pixbuf = nemo_icon_info_get_pixbuf_at_size (icon_info, NEMO_PATH_BAR_ICON_SIZE);
257-
gtk_image_set_from_pixbuf (GTK_IMAGE (button_data->image), pixbuf);
250+
251+
icon = nemo_trash_monitor_get_symbolic_icon ();
252+
253+
gtk_image_set_from_gicon (GTK_IMAGE (button_data->image), icon, GTK_ICON_SIZE_MENU);
258254
}
259255
}
260256
g_object_unref (file);

src/nemo-places-sidebar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ update_places (NemoPlacesSidebar *sidebar)
826826
sidebar->bottom_bookend_uri = g_strdup (mount_uri);
827827

828828
mount_uri = (char *)"trash:///"; /* No need to strdup */
829-
icon = nemo_trash_monitor_get_icon ();
829+
icon = nemo_trash_monitor_get_symbolic_icon ();
830830
cat_iter = add_place (sidebar, PLACES_BUILT_IN,
831831
SECTION_COMPUTER,
832832
_("Trash"), icon, mount_uri,

src/nemo-window-menus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ trash_state_changed_cb (NemoTrashMonitor *monitor,
460460
action_group = nemo_window_get_main_action_group (window);
461461
action = gtk_action_group_get_action (action_group, "Go to Trash");
462462

463-
gicon = nemo_trash_monitor_get_icon ();
463+
gicon = nemo_trash_monitor_get_symbolic_icon ();
464464

465465
if (gicon) {
466466
g_object_set (action, "gicon", gicon, NULL);

0 commit comments

Comments
 (0)