[gnome-games/wip/exalm/lists: 1/4] ui: Add .folded style class to folded leaflets



commit 6825f6f1da0a3a30f0ca5e4d66ee418464423c33
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Jan 14 23:35:48 2020 +0500

    ui: Add .folded style class to folded leaflets

 src/ui/platforms-view.vala     | 4 ++++
 src/ui/preferences-window.vala | 9 +++++++++
 2 files changed, 13 insertions(+)
---
diff --git a/src/ui/platforms-view.vala b/src/ui/platforms-view.vala
index 29e5ece2..6c89f4ec 100644
--- a/src/ui/platforms-view.vala
+++ b/src/ui/platforms-view.vala
@@ -324,6 +324,10 @@ private class Games.PlatformsView : Gtk.Bin {
        [GtkCallback]
        private void on_leaflet_folded_changed () {
                adaptive_state.is_folded = leaflet.folded;
+               if (leaflet.folded)
+                       leaflet.get_style_context ().add_class ("folded");
+               else
+                       leaflet.get_style_context ().remove_class ("folded");
        }
 
        [GtkCallback]
diff --git a/src/ui/preferences-window.vala b/src/ui/preferences-window.vala
index c51a3bd2..c88d5bf5 100644
--- a/src/ui/preferences-window.vala
+++ b/src/ui/preferences-window.vala
@@ -127,6 +127,15 @@ private class Games.PreferencesWindow : Gtk.Window {
                window_back_button.visible = folded;
                sidebar.show_selection = !folded;
 
+               if (folded) {
+                       content_box.get_style_context ().add_class ("folded");
+                       titlebar_box.get_style_context ().add_class ("folded");
+               }
+               else {
+                       content_box.get_style_context ().remove_class ("folded");
+                       titlebar_box.get_style_context ().remove_class ("folded");
+               }
+
                if (folded)
                        stack.transition_type = Gtk.StackTransitionType.NONE;
                else


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