[gnome-builder] app: add development style on unstable versions



commit 10b311cf2e0b9de6551ad74f5b5f7b179c400040
Author: alex285 <alexis diavatis hotmail com>
Date:   Mon Oct 15 22:43:16 2018 +0300

    app: add development style on unstable versions
    
    Check if the minor version is odd and if yes add the default Adwaita
    development style.

 data/themes/Adwaita-shared.css           | 13 +++++++++++++
 meson.build                              |  3 +++
 src/libide/application/ide-application.c |  6 ++++++
 3 files changed, 22 insertions(+)
---
diff --git a/data/themes/Adwaita-shared.css b/data/themes/Adwaita-shared.css
index 1057b6412..f3f771f58 100644
--- a/data/themes/Adwaita-shared.css
+++ b/data/themes/Adwaita-shared.css
@@ -59,3 +59,16 @@ popover.messagepopover list {
 popover.messagepopover list row:not(:last-child) {
   border-bottom: 1px solid alpha(@borders, 0.3);
 }
+
+/* development styles */
+window.development-version  headerbar:last-child {
+  background: transparent -gtk-icontheme("system-run-symbolic") 80% 0/128px 128px no-repeat,
+              linear-gradient(to left,
+                              mix(@theme_fg_color, @theme_bg_color, 0.5) 0%,
+                              @theme_bg_color 25%);
+  color: alpha(@theme_fg_color, 0.2);
+}
+
+window.development-version headerbar label {
+  color: @theme_fg_color;
+}
diff --git a/meson.build b/meson.build
index 836c7b3b1..d0a685a80 100644
--- a/meson.build
+++ b/meson.build
@@ -93,6 +93,9 @@ config_h.set('LOCALEDIR', 'PACKAGE_LOCALE_DIR')
 
 config_h.set10('ENABLE_NLS', true) # Always enabled
 
+# Development build setup
+config_h.set('DEVELOPMENT_BUILD', version_split[1].to_int().is_odd())
+
 # We should probably avoid using these
 config_h.set_quoted('SRCDIR', meson.source_root())
 config_h.set_quoted('BUILDDIR', meson.build_root())
diff --git a/src/libide/application/ide-application.c b/src/libide/application/ide-application.c
index f5de0d5bd..965f2ca44 100644
--- a/src/libide/application/ide-application.c
+++ b/src/libide/application/ide-application.c
@@ -219,6 +219,12 @@ ide_application_activate_primary (IdeApplication *self)
   window = g_object_new (IDE_TYPE_WORKBENCH,
                          "application", self,
                          NULL);
+
+#ifdef DEVELOPMENT_BUILD
+  /* Set development styles */
+  dzl_gtk_widget_add_style_class (GTK_WIDGET (window), "development-version");
+#endif
+
   gtk_window_present (window);
 }
 


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