[gnome-games/wip/exalm/tnum: 3/24] selection-action-bar: Disable action bar if no games selected




commit 8e7545b2aafe78f2d40cae4979e4527e7f42da08
Author: Neville <nevilleantony98 gmail com>
Date:   Thu Aug 6 20:41:30 2020 +0530

    selection-action-bar: Disable action bar if no games selected

 data/ui/selection-action-bar.ui  | 1 +
 src/ui/selection-action-bar.vala | 2 ++
 2 files changed, 3 insertions(+)
---
diff --git a/data/ui/selection-action-bar.ui b/data/ui/selection-action-bar.ui
index 1c7b8ad36..8700c34e8 100644
--- a/data/ui/selection-action-bar.ui
+++ b/data/ui/selection-action-bar.ui
@@ -3,6 +3,7 @@
   <requires lib="gtk+" version="3.24"/>
   <template class="GamesSelectionActionBar" parent="GtkActionBar">
     <property name="visible">True</property>
+    <property name="sensitive">False</property>
     <child>
       <object class="GtkButton" id="favorite_button">
         <property name="visible">True</property>
diff --git a/src/ui/selection-action-bar.vala b/src/ui/selection-action-bar.vala
index 7825aafa5..0d0127fca 100644
--- a/src/ui/selection-action-bar.vala
+++ b/src/ui/selection-action-bar.vala
@@ -55,6 +55,8 @@ private class Games.SelectionActionBar : Gtk.ActionBar {
        }
 
        public void update (Game[] games) {
+               sensitive = games.length != 0;
+
                if (is_all_favorite (games)) {
                        favorite_state = ALL_FAVORITE;
                        return;


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