[gnome-games] collection-view: Rename is_collection_empty to is_empty_collection
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] collection-view: Rename is_collection_empty to is_empty_collection
- Date: Thu, 16 Jul 2020 14:51:44 +0000 (UTC)
commit 9a927f5b35e1d1552eed0eca3252b259d24099b9
Author: Neville <nevilleantony98 gmail com>
Date: Wed Jul 15 17:28:05 2020 +0530
collection-view: Rename is_collection_empty to is_empty_collection
This naming helps differentiate between:
- is_empty_collection: No games discovered by the app.
- is_collection_empty: No games in a specific collection.
data/ui/collection-view.ui | 18 +++++++++---------
src/ui/collection-view.vala | 32 ++++++++++++++++----------------
src/ui/collections-page.vala | 18 +++++++++---------
3 files changed, 34 insertions(+), 34 deletions(-)
---
diff --git a/data/ui/collection-view.ui b/data/ui/collection-view.ui
index 8c194d81..2e821687 100644
--- a/data/ui/collection-view.ui
+++ b/data/ui/collection-view.ui
@@ -10,7 +10,7 @@
<signal name="notify::is-showing-bottom-bar" handler="update_bottom_bar"/>
<signal name="notify::is-subview-open" handler="update_bottom_bar"/>
<signal name="notify::is-selection-mode" handler="on_selection_mode_changed"/>
- <signal name="notify::is-collection-empty" handler="on_collection_empty_changed"/>
+ <signal name="notify::is-empty-collection" handler="on_empty_collection_changed"/>
<child>
<object class="GtkStack" id="header_bar_stack">
<property name="visible">True</property>
@@ -79,7 +79,7 @@
<property name="visible">True</property>
<property name="title" translatable="yes">Games</property>
<property name="stack">viewstack</property>
- <property name="view-switcher-enabled" bind-source="GamesCollectionView"
bind-property="is-collection-empty" bind-flags="bidirectional|sync-create|invert-boolean"/>
+ <property name="view-switcher-enabled" bind-source="GamesCollectionView"
bind-property="is-empty-collection" bind-flags="bidirectional|sync-create|invert-boolean"/>
<signal name="notify::title-visible" handler="update_adaptive_state"/>
</object>
</child>
@@ -88,7 +88,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"/>
+ <property name="sensitive" bind-source="GamesCollectionView"
bind-property="is-empty-collection" bind-flags="bidirectional|invert-boolean"/>
<child>
<object class="GtkImage" id="select_image">
<property name="visible">True</property>
@@ -110,7 +110,7 @@
<property name="visible" bind-source="GamesCollectionView"
bind-property="is-search-available"/>
<property name="valign">center</property>
<property name="active" bind-source="GamesCollectionView"
bind-property="search-mode" bind-flags="bidirectional"/>
- <property name="sensitive" bind-source="GamesCollectionView"
bind-property="is-collection-empty" bind-flags="bidirectional|invert-boolean"/>
+ <property name="sensitive" bind-source="GamesCollectionView"
bind-property="is-empty-collection" bind-flags="bidirectional|invert-boolean"/>
<style>
<class name="image-button"/>
</style>
@@ -164,7 +164,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="sensitive" bind-source="GamesCollectionView"
bind-property="is-empty-collection" bind-flags="bidirectional|invert-boolean"/>
<property name="action-name">view.toggle-select</property>"
<child>
<object class="GtkImage" id="subview_select_image">
@@ -187,7 +187,7 @@
<property name="visible">True</property>
<property name="valign">center</property>
<property name="active" bind-source="GamesCollectionView"
bind-property="search-mode" bind-flags="bidirectional"/>
- <property name="sensitive" bind-source="GamesCollectionView"
bind-property="is-collection-empty" bind-flags="bidirectional|invert-boolean"/>
+ <property name="sensitive" bind-source="GamesCollectionView"
bind-property="is-empty-collection" bind-flags="bidirectional|invert-boolean"/>
<style>
<class name="image-button"/>
</style>
@@ -252,7 +252,7 @@
<property name="visible">True</property>
<property name="valign">center</property>
<property name="action-name">view.toggle-select</property>
- <property name="sensitive" bind-source="collections_page"
bind-property="is-empty-collection" bind-flags="invert-boolean"/>
+ <property name="sensitive" bind-source="collections_page"
bind-property="is-collection-empty" bind-flags="invert-boolean"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@@ -274,7 +274,7 @@
<property name="visible">True</property>
<property name="valign">center</property>
<property name="active" bind-source="GamesCollectionView" bind-property="search-mode"
bind-flags="bidirectional"/>
- <property name="sensitive" bind-source="collections_page"
bind-property="is-empty-collection" bind-flags="invert-boolean"/>
+ <property name="sensitive" bind-source="collections_page"
bind-property="is-collection-empty" bind-flags="invert-boolean"/>
<style>
<class name="image-button"/>
</style>
@@ -324,7 +324,7 @@
<property name="visible">True</property>
<property name="valign">center</property>
<property name="active" bind-source="GamesCollectionView" bind-property="search-mode"
bind-flags="bidirectional"/>
- <property name="sensitive" bind-source="GamesCollectionView"
bind-property="is-collection-empty" bind-flags="bidirectional|invert-boolean"/>
+ <property name="sensitive" bind-source="GamesCollectionView"
bind-property="is-empty-collection" bind-flags="bidirectional|invert-boolean"/>
<style>
<class name="image-button"/>
</style>
diff --git a/src/ui/collection-view.vala b/src/ui/collection-view.vala
index a135eeba..8759e3e3 100644
--- a/src/ui/collection-view.vala
+++ b/src/ui/collection-view.vala
@@ -65,12 +65,12 @@ private class Games.CollectionView : Gtk.Box, UiView {
}
}
- private bool _is_collection_empty;
- public bool is_collection_empty {
- get { return _is_collection_empty; }
+ private bool _is_empty_collection;
+ public bool is_empty_collection {
+ get { return _is_empty_collection; }
set {
- _is_collection_empty = value;
- if (_is_collection_empty)
+ _is_empty_collection = value;
+ if (_is_empty_collection)
empty_stack.visible_child = empty_collection;
else
empty_stack.visible_child = viewstack;
@@ -102,9 +102,9 @@ private class Games.CollectionView : Gtk.Box, UiView {
games_page.game_model = game_model;
platforms_page.game_model = game_model;
- is_collection_empty = game_model.get_n_items () == 0;
+ is_empty_collection = game_model.get_n_items () == 0;
game_model.items_changed.connect (() => {
- is_collection_empty = game_model.get_n_items () == 0;
+ is_empty_collection = game_model.get_n_items () == 0;
});
}
}
@@ -184,8 +184,8 @@ private class Games.CollectionView : Gtk.Box, UiView {
(event.state & default_modifiers) == Gdk.ModifierType.CONTROL_MASK &&
(viewstack.visible_child != collections_page ||
collections_page.is_subpage_open) &&
- !collections_page.is_empty_collection &&
- !is_collection_empty) {
+ !collections_page.is_collection_empty &&
+ !is_empty_collection) {
if (!search_mode)
search_mode = true;
@@ -201,7 +201,7 @@ private class Games.CollectionView : Gtk.Box, UiView {
return true;
}
- if (is_collection_empty)
+ if (is_empty_collection)
return false;
if (is_selection_mode && keyval == Gdk.Key.Escape) {
@@ -211,8 +211,8 @@ private class Games.CollectionView : Gtk.Box, UiView {
if ((viewstack.visible_child == collections_page
&& !collections_page.is_subpage_open) ||
- is_collection_empty ||
- collections_page.is_empty_collection)
+ is_empty_collection ||
+ collections_page.is_collection_empty)
return false;
return search_bar.handle_event (event);
@@ -229,7 +229,7 @@ private class Games.CollectionView : Gtk.Box, UiView {
if (!event.get_button (out button))
return false;
- if (is_collection_empty)
+ if (is_empty_collection)
return false;
switch (button) {
@@ -347,7 +347,7 @@ private class Games.CollectionView : Gtk.Box, UiView {
else {
collection_manager.toggle_favorite (collections_page.get_selected_games ());
- collections_page.update_is_empty_collection ();
+ collections_page.update_is_collection_empty ();
select_none ();
toggle_select ();
@@ -393,7 +393,7 @@ private class Games.CollectionView : Gtk.Box, UiView {
}
[GtkCallback]
- private void on_collection_empty_changed () {
+ private void on_empty_collection_changed () {
update_adaptive_state ();
update_selection_availability ();
}
@@ -478,7 +478,7 @@ private class Games.CollectionView : Gtk.Box, UiView {
[GtkCallback]
private void update_adaptive_state () {
bool showing_title = view_switcher_title.title_visible;
- is_showing_bottom_bar = showing_title && !is_collection_empty;
+ is_showing_bottom_bar = showing_title && !is_empty_collection;
}
[GtkCallback]
diff --git a/src/ui/collections-page.vala b/src/ui/collections-page.vala
index d3e1a53f..822a9f12 100644
--- a/src/ui/collections-page.vala
+++ b/src/ui/collections-page.vala
@@ -16,13 +16,13 @@ private class Games.CollectionsPage : Gtk.Bin {
[GtkChild]
private CollectionEmpty collection_empty_subpage;
- private bool _is_empty_collection;
- public bool is_empty_collection {
- get { return _is_empty_collection; }
+ private bool _is_collection_empty;
+ public bool is_collection_empty {
+ get { return _is_collection_empty; }
set {
- _is_empty_collection = value;
+ _is_collection_empty = value;
- if (is_empty_collection)
+ if (is_collection_empty)
collections_subpage_stack.visible_child = collection_empty_subpage;
else
collections_subpage_stack.visible_child = collections_subpage;
@@ -88,8 +88,8 @@ private class Games.CollectionsPage : Gtk.Bin {
collections_main_page.reset_scroll_position ();
}
- public void update_is_empty_collection () {
- is_empty_collection = collections_subpage.game_model.get_n_items () == 0;
+ public void update_is_collection_empty () {
+ is_collection_empty = collections_subpage.game_model.get_n_items () == 0;
}
public void set_filter (string[] filtering_terms) {
@@ -120,8 +120,8 @@ private class Games.CollectionsPage : Gtk.Bin {
collection_title = collection.get_title ();
collections_deck.visible_child = collections_subpage_stack;
- is_empty_collection = collection.get_game_model ().get_n_items () == 0;
- if (is_empty_collection)
+ is_collection_empty = collection.get_game_model ().get_n_items () == 0;
+ if (is_collection_empty)
return;
collections_subpage.hide_stars = collection.get_hide_stars ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]