[simple-scan/gnome-3-22: 1/3] Simplify how we check if we disable header bars



commit 1f9750e59450b334724083805140cb1a9fe9c5e7
Author: Robert Ancell <robert ancell canonical com>
Date:   Wed Jan 11 12:12:58 2017 +1300

    Simplify how we check if we disable header bars

 src/ui.vala |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/ui.vala b/src/ui.vala
index 2dd1d57..c6c2b0e 100644
--- a/src/ui.vala
+++ b/src/ui.vala
@@ -1819,7 +1819,7 @@ public class UserInterface : Gtk.ApplicationWindow
 
         var app = Application.get_default () as Gtk.Application;
 
-        if (is_desktop ("Unity") || is_desktop ("XFCE") || is_desktop ("MATE") || is_desktop ("LXDE"))
+        if (is_traditional_desktop ())
         {
             set_titlebar (null);
             menubar.visible = true;
@@ -2022,6 +2022,15 @@ public class UserInterface : Gtk.ApplicationWindow
         return false;
     }
 
+    private bool is_traditional_desktop ()
+    {
+        const string[] traditional_desktops = { "Unity", "XFCE", "MATE", "LXDE" };
+        foreach (var name in traditional_desktops)
+            if (is_desktop (name))
+                return true;
+        return false;
+    }   
+
     private string state_filename
     {
         owned get { return Path.build_filename (Environment.get_user_cache_dir (), "simple-scan", "state"); }


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