[nautilus] trash-monitor: Add a symbolic icon getter
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] trash-monitor: Add a symbolic icon getter
- Date: Mon, 27 Aug 2018 13:14:28 +0000 (UTC)
commit 229325008e01fe83f5e3a88f031a9d944735e8a8
Author: Yi-Soo An <yisooan gmail com>
Date: Thu Aug 23 15:35:45 2018 +0900
trash-monitor: Add a symbolic icon getter
The symbolic icon of the trash is used somewhere.
To provide an access to it, this getter is added.
src/nautilus-trash-monitor.c | 17 +++++++++++++++++
src/nautilus-trash-monitor.h | 2 +-
2 files changed, 18 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-trash-monitor.c b/src/nautilus-trash-monitor.c
index 1c34ec11f..356fa6041 100644
--- a/src/nautilus-trash-monitor.c
+++ b/src/nautilus-trash-monitor.c
@@ -243,3 +243,20 @@ nautilus_trash_monitor_is_empty (void)
monitor = nautilus_trash_monitor_get ();
return monitor->empty;
}
+
+GIcon *
+nautilus_trash_monitor_get_symbolic_icon (void)
+{
+ gboolean empty;
+
+ empty = nautilus_trash_monitor_is_empty ();
+
+ if (empty)
+ {
+ return g_themed_icon_new ("user-trash-symbolic");
+ }
+ else
+ {
+ return g_themed_icon_new ("user-trash-full-symbolic");
+ }
+}
diff --git a/src/nautilus-trash-monitor.h b/src/nautilus-trash-monitor.h
index fe4b68236..1b81a4b25 100644
--- a/src/nautilus-trash-monitor.h
+++ b/src/nautilus-trash-monitor.h
@@ -32,4 +32,4 @@ G_DECLARE_FINAL_TYPE (NautilusTrashMonitor, nautilus_trash_monitor,
NautilusTrashMonitor *nautilus_trash_monitor_get (void);
gboolean nautilus_trash_monitor_is_empty (void);
-GIcon *nautilus_trash_monitor_get_icon (void);
+GIcon *nautilus_trash_monitor_get_symbolic_icon (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]