[shotwell] Use camera's icon on the message pane



commit 1d4d6b52d55de897aaabe0c4af80543b53778baf
Author: Jens Georg <mail jensge org>
Date:   Wed Feb 20 21:38:17 2019 +0100

    Use camera's icon on the message pane

 src/Page.vala              | 8 +++++++-
 src/camera/ImportPage.vala | 4 ++++
 2 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/Page.vala b/src/Page.vala
index bf7df005..93cedd56 100644
--- a/src/Page.vala
+++ b/src/Page.vala
@@ -1442,7 +1442,13 @@ public abstract class CheckerboardPage : Page {
     
     public void set_page_message(string message) {
         message_pane.label.label = message;
-        message_pane.icon_image.icon_name  = get_view_empty_icon();
+        try {
+            message_pane.icon_image.icon_name = null;
+            message_pane.icon_image.gicon = Icon.new_for_string (get_view_empty_icon());
+        } catch (Error error) {
+            message_pane.icon_image.gicon = null;
+            message_pane.icon_image.icon_name = "image-x-generic-symbolic";
+        }
         stack.set_visible_child_name ("message");
     }
     
diff --git a/src/camera/ImportPage.vala b/src/camera/ImportPage.vala
index b99bb79e..a435f305 100644
--- a/src/camera/ImportPage.vala
+++ b/src/camera/ImportPage.vala
@@ -846,6 +846,10 @@ public class ImportPage : CheckerboardPage {
         return tracker;
     }
 
+    protected override string get_view_empty_icon() {
+        return this.icon;
+    }
+
     protected override string get_view_empty_message() {
         return _("The camera seems to be empty. No photos/videos found to import");
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]