[gnome-games] ui: Clean up preferences pages
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] ui: Clean up preferences pages
- Date: Fri, 3 Aug 2018 21:40:08 +0000 (UTC)
commit 27405c63741606cda6c8e407fc198eab16eefb96
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Sun Jul 29 17:10:20 2018 +0500
ui: Clean up preferences pages
Stop using 'border-width' and 'label-yalign' properties.
data/ui/preferences-page-controllers.ui | 48 +++++++++++++++-----------------
data/ui/preferences-page-plugins.ui | 33 ++++++++--------------
data/ui/preferences-page-video.ui | 36 ++++++++++++++----------
src/ui/preferences-page-controllers.vala | 3 ++
4 files changed, 58 insertions(+), 62 deletions(-)
---
diff --git a/data/ui/preferences-page-controllers.ui b/data/ui/preferences-page-controllers.ui
index 832e384e..57631d8d 100644
--- a/data/ui/preferences-page-controllers.ui
+++ b/data/ui/preferences-page-controllers.ui
@@ -27,15 +27,25 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
+ <property name="margin">12</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="gamepads_label">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Gamepads</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
<child>
<object class="GtkFrame" id="gamepads_frame">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="border_width">12</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
<property name="shadow_type">in</property>
- <property name="label_yalign">1</property>
<child>
<object class="GtkListBox" id="gamepads_list_box">
<property name="visible">True</property>
@@ -44,28 +54,25 @@
<signal name="row-activated" handler="gamepads_list_box_row_activated"/>
</object>
</child>
- <child type="label">
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_bottom">12</property>
- <property name="label" translatable="yes">Gamepads</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Keyboard</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
</object>
</child>
<child>
<object class="GtkFrame">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="border_width">12</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
<property name="shadow_type">in</property>
- <property name="label_yalign">1</property>
<child>
<object class="GtkListBox" id="keyboard_list_box">
<property name="visible">True</property>
@@ -74,17 +81,6 @@
<signal name="row-activated" handler="keyboard_list_box_row_activated"/>
</object>
</child>
- <child type="label">
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_bottom">12</property>
- <property name="label" translatable="yes">Keyboard</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
</object>
</child>
</object>
diff --git a/data/ui/preferences-page-plugins.ui b/data/ui/preferences-page-plugins.ui
index d9c4fd89..2ae43ef8 100644
--- a/data/ui/preferences-page-plugins.ui
+++ b/data/ui/preferences-page-plugins.ui
@@ -4,31 +4,26 @@
<template class="GamesPreferencesPagePlugins" parent="GtkBin">
<property name="visible">True</property>
<child>
- <object class="GtkStack" id="stack">
+ <object class="GtkScrolledWindow" id="plugins">
<property name="visible">true</property>
- <property name="visible-child">plugins</property>
- <property name="transition-type">GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT</property>
<child>
- <object class="GtkScrolledWindow" id="plugins">
+ <object class="GtkViewport">
<property name="visible">true</property>
<child>
- <object class="GtkViewport">
- <property name="visible">true</property>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="margin">12</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkBox">
- <property name="orientation">vertical</property>
+ <object class="GtkFrame">
<property name="visible">true</property>
+ <property name="shadow-type">in</property>
<child>
- <object class="GtkFrame">
+ <object class="GtkListBox" id="list_box">
+ <property name="selection-mode">none</property>
<property name="visible">true</property>
- <property name="border-width">12</property>
- <property name="shadow-type">in</property>
- <child>
- <object class="GtkListBox" id="list_box">
- <property name="selection-mode">none</property>
- <property name="visible">true</property>
- </object>
- </child>
</object>
</child>
</object>
@@ -36,10 +31,6 @@
</object>
</child>
</object>
- <packing>
- <property name="name">plugins</property>
- <property name="title" translatable="yes">Plugins</property>
- </packing>
</child>
</object>
</child>
diff --git a/data/ui/preferences-page-video.ui b/data/ui/preferences-page-video.ui
index 52935a69..a916863f 100644
--- a/data/ui/preferences-page-video.ui
+++ b/data/ui/preferences-page-video.ui
@@ -12,32 +12,38 @@
<property name="can_focus">False</property>
<property name="visible">True</property>
<child>
- <object class="GtkFrame">
+ <object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="border_width">12</property>
- <property name="valign">start</property>
- <property name="shadow_type">in</property>
- <property name="label_yalign">1</property>
+ <property name="orientation">vertical</property>
+ <property name="margin">12</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkListBox" id="filter_list_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="selection_mode">none</property>
- <signal name="row-activated" handler="filter_list_box_row_activated"/>
- </object>
- </child>
- <child type="label">
<object class="GtkLabel">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_bottom">12</property>
+ <property name="halign">start</property>
<property name="label" translatable="yes">Filter</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
+ <child>
+ <object class="GtkFrame">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">start</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkListBox" id="filter_list_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="selection_mode">none</property>
+ <signal name="row-activated" handler="filter_list_box_row_activated"/>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
</object>
diff --git a/src/ui/preferences-page-controllers.vala b/src/ui/preferences-page-controllers.vala
index e62acc49..a0f376d2 100644
--- a/src/ui/preferences-page-controllers.vala
+++ b/src/ui/preferences-page-controllers.vala
@@ -5,6 +5,8 @@ private class Games.PreferencesPageControllers: Gtk.Stack, PreferencesPage {
public Gtk.HeaderBar header_bar { protected set; get; }
public bool immersive_mode { protected set; get; }
+ [GtkChild]
+ private Gtk.Label gamepads_label;
[GtkChild]
private Gtk.Frame gamepads_frame;
[GtkChild]
@@ -54,6 +56,7 @@ private class Games.PreferencesPageControllers: Gtk.Stack, PreferencesPage {
box.show_all ();
gamepads_list_box.add (box);
};
+ gamepads_label.visible = i > 0;
gamepads_frame.visible = i > 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]