[gnome-games/wip/exalm/gtk4: 221/238] ui: Use 'icon-name' property of GtkButton
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/gtk4: 221/238] ui: Use 'icon-name' property of GtkButton
- Date: Mon, 19 Aug 2019 20:35:01 +0000 (UTC)
commit b53473846ba795353275efaaf97117b496283ad4
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Sun Jul 29 14:59:48 2018 +0500
ui: Use 'icon-name' property of GtkButton
This sets 'image-button' style class implicitly and also allows to remove
GtkImage children.
data/ui/collection-box.ui | 7 +--
data/ui/collection-header-bar.ui | 55 ++--------------------
data/ui/display-header-bar.ui | 53 ++-------------------
data/ui/input-mode-switcher.ui | 14 +-----
data/ui/preferences-page.ui | 7 +--
data/ui/preferences-subpage-gamepad.ui | 11 +----
data/ui/preferences-subpage-keyboard.ui | 11 +----
data/ui/preferences-window.ui | 22 +--------
.../data/ui/nintendo-ds-layout-switcher.ui | 7 +--
.../src/nintendo-ds-layout-switcher.vala | 4 +-
10 files changed, 21 insertions(+), 170 deletions(-)
---
diff --git a/data/ui/collection-box.ui b/data/ui/collection-box.ui
index 110bd5c5..65754c7e 100644
--- a/data/ui/collection-box.ui
+++ b/data/ui/collection-box.ui
@@ -84,8 +84,7 @@
<object class="GtkButton">
<property name="visible">True</property>
<property name="can-focus">True</property>
- <property name="image">close_icon</property>
- <property name="always-show-image">True</property>
+ <property name="icon-name">window-close-symbolic</property>
<signal name="clicked" handler="on_loading_notification_closed"/>
<style>
<class name="flat"/>
@@ -102,8 +101,4 @@
</object>
</child>
</template>
- <object class="GtkImage" id="close_icon">
- <property name="visible">True</property>
- <property name="icon-name">window-close-symbolic</property>
- </object>
</interface>
diff --git a/data/ui/collection-header-bar.ui b/data/ui/collection-header-bar.ui
index 3f01512f..f234c982 100644
--- a/data/ui/collection-header-bar.ui
+++ b/data/ui/collection-header-bar.ui
@@ -16,21 +16,12 @@
<property name="visible">True</property>
<property name="valign">center</property>
<property name="action-name">app.add-game-files</property>
- <style>
- <class name="image-button"/>
- </style>
+ <property name="icon-name">list-add-symbolic</property>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-back">
<property name="accessible-name" translatable="yes">Add game files…</property>
</object>
</child>
- <child>
- <object class="GtkImage" id="add_game_image">
- <property name="visible">True</property>
- <property name="icon-name">list-add-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
</object>
<packing>
<property name="pack-type">start</property>
@@ -43,16 +34,7 @@
<property name="tooltip-text" translatable="yes">Menu</property>
<property name="valign">center</property>
<property name="visible">True</property>
- <style>
- <class name="image-button"/>
- </style>
- <child>
- <object class="GtkImage" id="menu_image">
- <property name="visible">True</property>
- <property name="icon-name">open-menu-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
+ <property name="icon-name">open-menu-symbolic</property>
</object>
<packing>
<property name="pack-type">end</property>
@@ -83,21 +65,12 @@
<object class="GtkToggleButton" id="search">
<property name="visible">True</property>
<property name="valign">center</property>
- <style>
- <class name="image-button"/>
- </style>
+ <property name="icon-name">edit-find-symbolic</property>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-search">
<property name="accessible-name" translatable="yes">Search</property>
</object>
</child>
- <child>
- <object class="GtkImage" id="search_image">
- <property name="visible">True</property>
- <property name="icon-name">edit-find-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
</object>
<packing>
<property name="pack-type">end</property>
@@ -113,43 +86,25 @@
<object class="GtkButton">
<property name="visible">True</property>
<property name="valign">center</property>
+ <property name="icon-name">go-previous-symbolic</property>
<signal name="clicked" handler="on_subview_back_clicked"/>
- <style>
- <class name="image-button"/>
- </style>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Back</property>
</object>
</child>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">go-previous-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
</object>
</child>
<child>
<object class="GtkToggleButton" id="search_subview">
<property name="visible">True</property>
<property name="valign">center</property>
- <style>
- <class name="image-button"/>
- </style>
+ <property name="icon-name">edit-find-symbolic</property>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Search</property>
</object>
</child>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">edit-find-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
</object>
<packing>
<property name="pack-type">end</property>
diff --git a/data/ui/display-header-bar.ui b/data/ui/display-header-bar.ui
index 21f2adce..9454e01d 100644
--- a/data/ui/display-header-bar.ui
+++ b/data/ui/display-header-bar.ui
@@ -20,22 +20,13 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
+ <property name="icon-name">go-previous-symbolic</property>
<signal name="clicked" handler="on_back_clicked"/>
- <style>
- <class name="image-button"/>
- </style>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-back">
<property name="accessible-name" translatable="yes">Back</property>
</object>
</child>
- <child>
- <object class="GtkImage" id="back_image">
- <property name="visible">True</property>
- <property name="icon-name">go-previous-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
</object>
</child>
<child>
@@ -44,9 +35,9 @@
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="margin-start">7</property>
+ <property name="icon-name">view-restore-symbolic</property>
<signal name="clicked" handler="on_restore_clicked"/>
<style>
- <class name="image-button"/>
<class name="titlebutton"/>
</style>
<child internal-child="accessible">
@@ -54,13 +45,6 @@
<property name="accessible-name" translatable="yes">Restore</property>
</object>
</child>
- <child>
- <object class="GtkImage" id="restore_image">
- <property name="visible">True</property>
- <property name="icon-name">view-restore-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
</object>
<packing>
<property name="pack-type">end</property>
@@ -72,16 +56,7 @@
<property name="visible">True</property>
<property name="valign">center</property>
<property name="can-focus">False</property>
- <style>
- <class name="image-button"/>
- </style>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">view-more-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
+ <property name="icon-name">view-more-symbolic</property>
</object>
<packing>
<property name="pack-type">end</property>
@@ -92,22 +67,13 @@
<property name="visible">False</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
+ <property name="icon-name">view-fullscreen-symbolic</property>
<signal name="clicked" handler="on_fullscreen_clicked"/>
- <style>
- <class name="image-button"/>
- </style>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-fullscreen">
<property name="accessible-name" translatable="yes">Fullscreen</property>
</object>
</child>
- <child>
- <object class="GtkImage" id="fullscreen_image">
- <property name="visible">True</property>
- <property name="icon-name">view-fullscreen-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
</object>
<packing>
<property name="pack-type">end</property>
@@ -153,22 +119,13 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
+ <property name="icon-name">go-previous-symbolic</property>
<signal name="clicked" handler="on_back_clicked"/>
- <style>
- <class name="image-button"/>
- </style>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-savestates-back">
<property name="accessible-name" translatable="yes">Back</property>
</object>
</child>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">go-previous-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
</object>
<packing>
<property name="pack-type">start</property>
diff --git a/data/ui/input-mode-switcher.ui b/data/ui/input-mode-switcher.ui
index 00b5e145..8ea7543b 100644
--- a/data/ui/input-mode-switcher.ui
+++ b/data/ui/input-mode-switcher.ui
@@ -10,18 +10,13 @@
<property name="visible">True</property>
<property name="draw-indicator">False</property>
<property name="can-focus">False</property>
+ <property name="icon-name">input-gaming-symbolic</property>
<signal name="toggled" handler="on_gamepad_button_toggled"/>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-gamepad-input">
<property name="accessible-name" translatable="yes">Gamepad Input</property>
</object>
</child>
- <child>
- <object class="GtkImage" id="gamepad_image">
- <property name="visible">True</property>
- <property name="icon-name">input-gaming-symbolic</property>
- </object>
- </child>
</object>
</child>
<child>
@@ -30,18 +25,13 @@
<property name="draw-indicator">False</property>
<property name="can-focus">False</property>
<property name="group">gamepad_mode</property>
+ <property name="icon-name">input-keyboard-symbolic</property>
<signal name="toggled" handler="on_keyboard_button_toggled"/>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-keyboard-input">
<property name="accessible-name" translatable="yes">Keyboard Input</property>
</object>
</child>
- <child>
- <object class="GtkImage" id="keyboard_image">
- <property name="visible">True</property>
- <property name="icon-name">input-keyboard-symbolic</property>
- </object>
- </child>
</object>
</child>
</template>
diff --git a/data/ui/preferences-page.ui b/data/ui/preferences-page.ui
index 66256e76..cc9425c9 100644
--- a/data/ui/preferences-page.ui
+++ b/data/ui/preferences-page.ui
@@ -56,16 +56,11 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="valign">center</property>
+ <property name="icon-name">window-close-symbolic</property>
<signal name="clicked" handler="on_error_notification_closed"/>
<style>
<class name="flat"/>
</style>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">window-close-symbolic</property>
- </object>
- </child>
</object>
</child>
</object>
diff --git a/data/ui/preferences-subpage-gamepad.ui b/data/ui/preferences-subpage-gamepad.ui
index f72a19d3..c0a83b61 100644
--- a/data/ui/preferences-subpage-gamepad.ui
+++ b/data/ui/preferences-subpage-gamepad.ui
@@ -74,22 +74,13 @@
<child>
<object class="GtkButton" id="back_button">
<property name="visible">True</property>
+ <property name="icon-name">go-previous-symbolic</property>
<signal name="clicked" handler="on_back_clicked"/>
- <style>
- <class name="image-button"/>
- </style>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-back">
<property name="accessible-name" translatable="yes">Back</property>
</object>
</child>
- <child>
- <object class="GtkImage" id="back_image">
- <property name="visible">True</property>
- <property name="icon-name">go-previous-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
</object>
<packing>
<property name="pack-type">start</property>
diff --git a/data/ui/preferences-subpage-keyboard.ui b/data/ui/preferences-subpage-keyboard.ui
index 238044c8..61d80f65 100644
--- a/data/ui/preferences-subpage-keyboard.ui
+++ b/data/ui/preferences-subpage-keyboard.ui
@@ -75,22 +75,13 @@
<child>
<object class="GtkButton" id="back_button">
<property name="visible">True</property>
+ <property name="icon-name">go-previous-symbolic</property>
<signal name="clicked" handler="on_back_clicked"/>
- <style>
- <class name="image-button"/>
- </style>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-back">
<property name="accessible-name" translatable="yes">Back</property>
</object>
</child>
- <child>
- <object class="GtkImage" id="back_image">
- <property name="visible">True</property>
- <property name="icon-name">go-previous-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
</object>
<packing>
<property name="pack-type">start</property>
diff --git a/data/ui/preferences-window.ui b/data/ui/preferences-window.ui
index 75a95f07..5cd04d38 100644
--- a/data/ui/preferences-window.ui
+++ b/data/ui/preferences-window.ui
@@ -26,22 +26,13 @@
<child>
<object class="GtkButton" id="window_back_button">
<property name="visible">False</property>
+ <property name="icon-name">go-previous-symbolic</property>
<signal name="clicked" handler="on_back_clicked"/>
- <style>
- <class name="image-button"/>
- </style>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Back</property>
</object>
</child>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">go-previous-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
</object>
<packing>
<property name="pack-type">start</property>
@@ -67,22 +58,13 @@
<child>
<object class="GtkButton" id="page_back_button">
<property name="visible">False</property>
+ <property name="icon-name">go-previous-symbolic</property>
<signal name="clicked" handler="on_back_clicked"/>
- <style>
- <class name="image-button"/>
- </style>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Back</property>
</object>
</child>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">go-previous-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
</object>
<packing>
<property name="pack-type">start</property>
diff --git a/plugins/nintendo-ds/data/ui/nintendo-ds-layout-switcher.ui
b/plugins/nintendo-ds/data/ui/nintendo-ds-layout-switcher.ui
index 95f9dfab..4f62bf26 100644
--- a/plugins/nintendo-ds/data/ui/nintendo-ds-layout-switcher.ui
+++ b/plugins/nintendo-ds/data/ui/nintendo-ds-layout-switcher.ui
@@ -9,7 +9,7 @@
<property name="visible">True</property>
<property name="transition-type">slide-left</property>
<child>
- <object class="GtkButton">
+ <object class="GtkButton" id="change_screen_button">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-end">6</property>
@@ -19,11 +19,6 @@
<property name="accessible-name" translatable="yes">Change Screen</property>
</object>
</child>
- <child>
- <object class="GtkImage" id="change_screen_image">
- <property name="visible">True</property>
- </object>
- </child>
</object>
</child>
</object>
diff --git a/plugins/nintendo-ds/src/nintendo-ds-layout-switcher.vala
b/plugins/nintendo-ds/src/nintendo-ds-layout-switcher.vala
index e2ad0237..a90a001e 100644
--- a/plugins/nintendo-ds/src/nintendo-ds-layout-switcher.vala
+++ b/plugins/nintendo-ds/src/nintendo-ds-layout-switcher.vala
@@ -5,7 +5,7 @@ private class Games.NintendoDsLayoutSwitcher : Gtk.Box {
[GtkChild]
private Gtk.Revealer change_screen_revealer;
[GtkChild]
- private Gtk.Image change_screen_image;
+ private Gtk.Button change_screen_button;
[GtkChild]
private Gtk.Image layout_image;
[GtkChild]
@@ -55,7 +55,7 @@ private class Games.NintendoDsLayoutSwitcher : Gtk.Box {
list_box.select_row (item);
change_screen_revealer.reveal_child = (layout == NintendoDsLayout.QUICK_SWITCH);
- change_screen_image.icon_name = view_bottom ?
+ change_screen_button.icon_name = view_bottom ?
"view-top-screen-symbolic" :
"view-bottom-screen-symbolic";
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]