[gnome-games] collection-icon-view: Rename CollectionIconView to GamesPage
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] collection-icon-view: Rename CollectionIconView to GamesPage
- Date: Fri, 29 May 2020 16:29:20 +0000 (UTC)
commit a039df4d9179068236a39c78d677728b1d8b61ae
Author: Neville <nevilleantony98 gmail com>
Date: Fri May 29 20:12:49 2020 +0530
collection-icon-view: Rename CollectionIconView to GamesPage
This helps in distinguishing CollectionIconView from CollectionView.
Class names will also be uniform when CollectionPage is introduced.
data/gtk-style.css | 4 +--
data/org.gnome.Games.gresource.xml | 2 +-
data/ui/collection-view.ui | 4 +--
data/ui/{collection-icon-view.ui => games-page.ui} | 2 +-
data/ui/platforms-view.ui | 2 +-
src/meson.build | 2 +-
src/ui/collection-view.vala | 18 ++++++------
.../{collection-icon-view.vala => games-page.vala} | 6 ++--
src/ui/platforms-view.vala | 32 +++++++++++-----------
9 files changed, 36 insertions(+), 36 deletions(-)
---
diff --git a/data/gtk-style.css b/data/gtk-style.css
index fd68438a..857cb618 100644
--- a/data/gtk-style.css
+++ b/data/gtk-style.css
@@ -37,11 +37,11 @@ gamesgamethumbnail.cover {
background-color: black;
}
-gamescollectioniconview flowboxchild {
+gamesgamespage flowboxchild {
min-width: 128px;
}
-gamescollectioniconview.large flowboxchild {
+gamesgamespage.large flowboxchild {
min-width: 256px;
}
diff --git a/data/org.gnome.Games.gresource.xml b/data/org.gnome.Games.gresource.xml
index eb1f2179..bb7d55db 100644
--- a/data/org.gnome.Games.gresource.xml
+++ b/data/org.gnome.Games.gresource.xml
@@ -12,7 +12,6 @@
<file preprocess="xml-stripblanks">gesture/stick-symbolic.svg</file>
<file preprocess="xml-stripblanks">ui/application-window.ui</file>
<file preprocess="xml-stripblanks">ui/checkmark-item.ui</file>
- <file preprocess="xml-stripblanks">ui/collection-icon-view.ui</file>
<file preprocess="xml-stripblanks">ui/collection-view.ui</file>
<file preprocess="xml-stripblanks">ui/display-view.ui</file>
<file preprocess="xml-stripblanks">ui/empty-collection.ui</file>
@@ -22,6 +21,7 @@
<file preprocess="xml-stripblanks">ui/fullscreen-box.ui</file>
<file preprocess="xml-stripblanks">ui/gamepad-mapper.ui</file>
<file preprocess="xml-stripblanks">ui/gamepad-tester.ui</file>
+ <file preprocess="xml-stripblanks">ui/games-page.ui</file>
<file preprocess="xml-stripblanks">ui/game-icon-view.ui</file>
<file preprocess="xml-stripblanks">ui/input-mode-switcher.ui</file>
<file preprocess="xml-stripblanks">ui/keyboard-mapper.ui</file>
diff --git a/data/ui/collection-view.ui b/data/ui/collection-view.ui
index e48e3685..6c866b3e 100644
--- a/data/ui/collection-view.ui
+++ b/data/ui/collection-view.ui
@@ -198,11 +198,11 @@
<child>
<object class="GtkStack" id="viewstack">
<property name="visible">True</property>
- <property name="visible-child">collection_view</property>
+ <property name="visible-child">games_page</property>
<property name="transition-type">crossfade</property>
<signal name="notify::visible-child" handler="on_visible_child_changed"/>
<child>
- <object class="GamesCollectionIconView" id="collection_view">
+ <object class="GamesGamesPage" id="games_page">
<property name="visible">True</property>
<signal name="game-activated" handler="on_game_activated"/>
</object>
diff --git a/data/ui/collection-icon-view.ui b/data/ui/games-page.ui
similarity index 96%
rename from data/ui/collection-icon-view.ui
rename to data/ui/games-page.ui
index 4bb4c1b4..b5fb1a3c 100644
--- a/data/ui/collection-icon-view.ui
+++ b/data/ui/games-page.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.24"/>
- <template class="GamesCollectionIconView" parent="GtkBin">
+ <template class="GamesGamesPage" parent="GtkBin">
<property name="visible">True</property>
<signal name="map" after="yes" handler="on_map"/>
<signal name="unmap" after="no" handler="on_unmap"/>
diff --git a/data/ui/platforms-view.ui b/data/ui/platforms-view.ui
index 318d67f9..3e6d5d43 100644
--- a/data/ui/platforms-view.ui
+++ b/data/ui/platforms-view.ui
@@ -51,7 +51,7 @@
</packing>
</child>
<child>
- <object class="GamesCollectionIconView" id="collection_view">
+ <object class="GamesGamesPage" id="games_page">
<property name="visible">True</property>
<property name="expand">True</property>
<signal name="game-activated" handler="on_game_activated"/>
diff --git a/src/meson.build b/src/meson.build
index 3593c691..c712c1db 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -99,7 +99,6 @@ vala_sources = [
'ui/application.vala',
'ui/application-window.vala',
'ui/checkmark-item.vala',
- 'ui/collection-icon-view.vala',
'ui/collection-view.vala',
'ui/display-bin.vala',
'ui/display-view.vala',
@@ -113,6 +112,7 @@ vala_sources = [
'ui/gamepad-mapper.vala',
'ui/gamepad-tester.vala',
'ui/gamepad-view.vala',
+ 'ui/games-page.vala',
'ui/game-icon-view.vala',
'ui/game-thumbnail.vala',
'ui/gamepad-view-configuration.vala',
diff --git a/src/ui/collection-view.vala b/src/ui/collection-view.vala
index 3d30cff4..71aa40d2 100644
--- a/src/ui/collection-view.vala
+++ b/src/ui/collection-view.vala
@@ -23,7 +23,7 @@ private class Games.CollectionView : Gtk.Box, UiView {
[GtkChild]
private EmptySearch empty_search;
[GtkChild]
- private CollectionIconView collection_view;
+ private GamesPage games_page;
[GtkChild]
private PlatformsView platform_view;
[GtkChild]
@@ -72,7 +72,7 @@ private class Games.CollectionView : Gtk.Box, UiView {
filtering_terms = value.split (" ");
platform_view.set_filter (filtering_terms);
- collection_view.set_filter (filtering_terms);
+ games_page.set_filter (filtering_terms);
}
}
@@ -84,7 +84,7 @@ private class Games.CollectionView : Gtk.Box, UiView {
set {
_game_model = value;
- collection_view.game_model = game_model;
+ games_page.game_model = game_model;
platform_view.game_model = game_model;
is_collection_empty = game_model.get_n_items () == 0;
@@ -105,7 +105,7 @@ private class Games.CollectionView : Gtk.Box, UiView {
construct {
var icon_name = Config.APPLICATION_ID + "-symbolic";
- viewstack.child_set (collection_view, "icon-name", icon_name);
+ viewstack.child_set (games_page, "icon-name", icon_name);
swipe_group.add_swipeable (platform_view.get_leaflet ());
@@ -198,7 +198,7 @@ private class Games.CollectionView : Gtk.Box, UiView {
if (viewstack.visible_child == platform_view)
return platform_view.gamepad_button_press_event (event);
else
- return collection_view.gamepad_button_press_event (event);
+ return games_page.gamepad_button_press_event (event);
}
}
@@ -212,7 +212,7 @@ private class Games.CollectionView : Gtk.Box, UiView {
if (viewstack.visible_child == platform_view)
return platform_view.gamepad_button_release_event (event);
else
- return collection_view.gamepad_button_release_event (event);
+ return games_page.gamepad_button_release_event (event);
}
public bool gamepad_absolute_axis_event (Manette.Event event) {
@@ -225,7 +225,7 @@ private class Games.CollectionView : Gtk.Box, UiView {
if (viewstack.visible_child == platform_view)
return platform_view.gamepad_absolute_axis_event (event);
else
- return collection_view.gamepad_absolute_axis_event (event);
+ return games_page.gamepad_absolute_axis_event (event);
}
private void on_konami_code_performed () {
@@ -257,8 +257,8 @@ private class Games.CollectionView : Gtk.Box, UiView {
[GtkCallback]
private void on_visible_child_changed () {
- if (viewstack.visible_child == collection_view)
- collection_view.reset_scroll_position ();
+ if (viewstack.visible_child == games_page)
+ games_page.reset_scroll_position ();
else
platform_view.reset ();
}
diff --git a/src/ui/collection-icon-view.vala b/src/ui/games-page.vala
similarity index 96%
rename from src/ui/collection-icon-view.vala
rename to src/ui/games-page.vala
index 3d2e6069..974b3201 100644
--- a/src/ui/collection-icon-view.vala
+++ b/src/ui/games-page.vala
@@ -1,7 +1,7 @@
// This file is part of GNOME Games. License: GPL-3.0+.
-[GtkTemplate (ui = "/org/gnome/Games/ui/collection-icon-view.ui")]
-private class Games.CollectionIconView : Gtk.Bin {
+[GtkTemplate (ui = "/org/gnome/Games/ui/games-page.ui")]
+private class Games.GamesPage : Gtk.Bin {
public signal void game_activated (Game game);
private string[] filtering_terms;
@@ -45,7 +45,7 @@ private class Games.CollectionIconView : Gtk.Bin {
private GamepadBrowse gamepad_browse;
static construct {
- set_css_name ("gamescollectioniconview");
+ set_css_name ("gamesgamespage");
}
construct {
diff --git a/src/ui/platforms-view.vala b/src/ui/platforms-view.vala
index 67ebd42d..1b7681a2 100644
--- a/src/ui/platforms-view.vala
+++ b/src/ui/platforms-view.vala
@@ -9,7 +9,7 @@ private class Games.PlatformsView : Gtk.Bin {
[GtkChild]
private Gtk.ListBox list_box;
[GtkChild]
- private CollectionIconView collection_view;
+ private GamesPage games_page;
[GtkChild]
private GamepadBrowse gamepad_browse;
@@ -23,7 +23,7 @@ private class Games.PlatformsView : Gtk.Bin {
get { return _game_model; }
set {
_game_model = value;
- collection_view.game_model = value;
+ games_page.game_model = value;
var platform_model = new PlatformModel (value);
list_box.bind_model (platform_model, add_platform);
@@ -50,7 +50,7 @@ private class Games.PlatformsView : Gtk.Bin {
public string subview_title { get; set; }
construct {
- collection_view.set_game_filter (filter_game);
+ games_page.set_game_filter (filter_game);
list_box.set_filter_func (filter_list);
}
@@ -105,7 +105,7 @@ private class Games.PlatformsView : Gtk.Bin {
public void set_filter (string[] filtering_terms) {
this.filtering_terms = filtering_terms;
- collection_view.set_filter (filtering_terms);
+ games_page.set_filter (filtering_terms);
list_box.invalidate_filter ();
select_first_visible_row ();
@@ -115,8 +115,8 @@ private class Games.PlatformsView : Gtk.Bin {
if (!get_mapped ())
return false;
- if (collection_view.has_game_selected ())
- if (collection_view.gamepad_button_press_event (event))
+ if (games_page.has_game_selected ())
+ if (games_page.gamepad_button_press_event (event))
return true;
return gamepad_browse.gamepad_button_press_event (event);
@@ -126,8 +126,8 @@ private class Games.PlatformsView : Gtk.Bin {
if (!get_mapped ())
return false;
- if (collection_view.has_game_selected ())
- if (collection_view.gamepad_button_release_event (event))
+ if (games_page.has_game_selected ())
+ if (games_page.gamepad_button_release_event (event))
return true;
return gamepad_browse.gamepad_button_release_event (event);
@@ -137,8 +137,8 @@ private class Games.PlatformsView : Gtk.Bin {
if (!get_mapped ())
return false;
- if (collection_view.has_game_selected ())
- if (collection_view.gamepad_absolute_axis_event (event))
+ if (games_page.has_game_selected ())
+ if (games_page.gamepad_absolute_axis_event (event))
return true;
return gamepad_browse.gamepad_absolute_axis_event (event);
@@ -173,7 +173,7 @@ private class Games.PlatformsView : Gtk.Bin {
return true;
case Gtk.DirectionType.RIGHT:
leaflet.navigate (Hdy.NavigationDirection.FORWARD);
- collection_view.select_default_game (Gtk.DirectionType.RIGHT);
+ games_page.select_default_game (Gtk.DirectionType.RIGHT);
return true;
default:
@@ -184,14 +184,14 @@ private class Games.PlatformsView : Gtk.Bin {
[GtkCallback]
private bool on_gamepad_accept () {
leaflet.navigate (Hdy.NavigationDirection.FORWARD);
- collection_view.select_default_game (Gtk.DirectionType.RIGHT);
+ games_page.select_default_game (Gtk.DirectionType.RIGHT);
return true;
}
[GtkCallback]
private bool on_gamepad_cancel () {
- collection_view.unselect_game ();
+ games_page.unselect_game ();
leaflet.navigate (Hdy.NavigationDirection.BACK);
return true;
@@ -209,8 +209,8 @@ private class Games.PlatformsView : Gtk.Bin {
selected_platform = row.platform;
subview_title = selected_platform.get_name ();
- collection_view.invalidate_filter ();
- collection_view.reset_scroll_position ();
+ games_page.invalidate_filter ();
+ games_page.reset_scroll_position ();
}
public void reset () {
@@ -275,7 +275,7 @@ private class Games.PlatformsView : Gtk.Bin {
[GtkCallback]
private void on_visible_child_changed () {
- is_subview_open = (leaflet.visible_child == collection_view);
+ is_subview_open = (leaflet.visible_child == games_page);
}
public Hdy.Leaflet get_leaflet () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]