[gnome-games] ui: Don't show gamepad list if it's empty
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] ui: Don't show gamepad list if it's empty
- Date: Sun, 22 Jul 2018 14:11:06 +0000 (UTC)
commit a518e5135311035d3489b55f9b19fbe498653f9f
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Sun Jul 22 02:11:25 2018 +0500
ui: Don't show gamepad list if it's empty
data/ui/preferences-page-controllers.ui | 2 +-
src/ui/preferences-page-controllers.vala | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/data/ui/preferences-page-controllers.ui b/data/ui/preferences-page-controllers.ui
index 2e992ea8..01295b57 100644
--- a/data/ui/preferences-page-controllers.ui
+++ b/data/ui/preferences-page-controllers.ui
@@ -28,7 +28,7 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
- <object class="GtkFrame">
+ <object class="GtkFrame" id="gamepads_frame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
diff --git a/src/ui/preferences-page-controllers.vala b/src/ui/preferences-page-controllers.vala
index a943571b..e62acc49 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.Frame gamepads_frame;
[GtkChild]
private Gtk.ListBox gamepads_list_box;
[GtkChild]
@@ -52,6 +54,7 @@ private class Games.PreferencesPageControllers: Gtk.Stack, PreferencesPage {
box.show_all ();
gamepads_list_box.add (box);
};
+ gamepads_frame.visible = i > 0;
}
private void clear_gamepad_list () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]