[gnome-games] collection-view: Disable selection button in empty state
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] collection-view: Disable selection button in empty state
- Date: Mon, 8 Jun 2020 21:00:33 +0000 (UTC)
commit 87196410d6099be146ff4bee18d72dfc4ff34155
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Jun 9 01:59:51 2020 +0500
collection-view: Disable selection button in empty state
Instead of hiding it. This prevents a flicker when starting the app.
data/ui/collection-view.ui | 2 ++
src/ui/collection-view.vala | 3 +--
2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/data/ui/collection-view.ui b/data/ui/collection-view.ui
index da3af516..220f18f6 100644
--- a/data/ui/collection-view.ui
+++ b/data/ui/collection-view.ui
@@ -85,6 +85,7 @@
<property name="visible" bind-source="GamesCollectionView"
bind-property="is_selection_available" bind-flags="bidirectional"/>
<property name="valign">center</property>
<property name="action-name">view.toggle-select</property>
+ <property name="sensitive" bind-source="GamesCollectionView"
bind-property="is-collection-empty" bind-flags="bidirectional|invert-boolean"/>
<child>
<object class="GtkImage" id="select_image">
<property name="visible">True</property>
@@ -160,6 +161,7 @@
<object class="GtkButton" id="subview_selection_button">
<property name="visible">True</property>
<property name="valign">center</property>
+ <property name="sensitive" bind-source="GamesCollectionView"
bind-property="is-collection-empty" bind-flags="bidirectional|invert-boolean"/>
<property name="action-name">view.toggle-select</property>"
<child>
<object class="GtkImage" id="subview_select_image">
diff --git a/src/ui/collection-view.vala b/src/ui/collection-view.vala
index 47f38a92..e38a85d4 100644
--- a/src/ui/collection-view.vala
+++ b/src/ui/collection-view.vala
@@ -310,8 +310,7 @@ private class Games.CollectionView : Gtk.Box, UiView {
[GtkCallback]
private void update_selection_availability () {
- is_selection_available = (viewstack.visible_child != platforms_page || !is_folded)
- && !is_collection_empty;
+ is_selection_available = viewstack.visible_child != platforms_page || !is_folded;
}
[GtkCallback]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]