[gnome-disk-utility/wip/christopherdavis/use-libhandy: 2/4] window: Add empty state
- From: Christopher Davis <christopherdavis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility/wip/christopherdavis/use-libhandy: 2/4] window: Add empty state
- Date: Sun, 20 Sep 2020 20:38:41 +0000 (UTC)
commit b5d4c78c3a5420b03b9b275c544c088e2b16e62f
Author: Christopher Davis <brainblasted disroot org>
Date: Wed Sep 16 20:19:31 2020 -0700
window: Add empty state
This adds an empty state to the
initial window for when no devices
are selected. It also adds a shortcut
to return to the empty state.
src/disks/gduapplication.c | 1 +
src/disks/ui/disks.ui | 38 +++++++++++++++++++++++++++++++++-----
src/disks/ui/shortcuts.ui | 7 +++++++
3 files changed, 41 insertions(+), 5 deletions(-)
---
diff --git a/src/disks/gduapplication.c b/src/disks/gduapplication.c
index 3992ed66..56518a1d 100644
--- a/src/disks/gduapplication.c
+++ b/src/disks/gduapplication.c
@@ -406,6 +406,7 @@ gdu_application_startup (GApplication *_app)
GduApplication *app = GDU_APPLICATION (_app);
const gchar **it;
const gchar *action_accels[] = {
+ "win.go-back", "Escape", NULL,
"win.open-drive-menu", "F10", NULL,
"win.open-volume-menu", "<Shift>F10", NULL,
diff --git a/src/disks/ui/disks.ui b/src/disks/ui/disks.ui
index 5920a64b..8c1598bc 100644
--- a/src/disks/ui/disks.ui
+++ b/src/disks/ui/disks.ui
@@ -172,16 +172,44 @@
<property name="margin_right">12</property>
<property name="margin_top">6</property>
<property name="margin_bottom">12</property>
- <property name="hexpand">True</property>
+ <property name="expand">True</property>
<child>
- <object class="GtkAlignment" id="alignment1">
+ <object class="GtkBox" id="disks-empty-state-box">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="valign">center</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkImage" id="select-device-image">
+ <property name="visible">True</property>
+ <property name="icon_name">drive-multidisk-symbolic</property>
+ <property name="pixel_size">128</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="select-device-title">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">No Device Selected</property>
+ <property name="yalign">0</property>
+ <style>
+ <class name="title-1"/>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ </child>
<child>
- <object class="GtkLabel" id="label4">
+ <object class="GtkLabel" id="select-device-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Select a device</property>
+ <property name="label" translatable="yes">Select a device to manage</property>
+ <property name="yalign">0</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
</object>
</child>
</object>
diff --git a/src/disks/ui/shortcuts.ui b/src/disks/ui/shortcuts.ui
index d4bbb5dd..a38a0f04 100644
--- a/src/disks/ui/shortcuts.ui
+++ b/src/disks/ui/shortcuts.ui
@@ -25,6 +25,13 @@
<property name="accelerator"><Primary>a</property>
</object>
</child>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes" context="shortcut window">Unselect current
disk</property>
+ <property name="accelerator">Escape</property>
+ </object>
+ </child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]