[gnome-boxes/improve-storage-management-ux: 4/7] preferences, memory-row: Add label for when spin_button can't be changed
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/improve-storage-management-ux: 4/7] preferences, memory-row: Add label for when spin_button can't be changed
- Date: Mon, 13 Dec 2021 15:06:42 +0000 (UTC)
commit 43a89939b6ef97919da56a4b53eeb0159b025c6d
Author: Felipe Borges <felipeborges gnome org>
Date: Mon Dec 13 15:59:43 2021 +0100
preferences, memory-row: Add label for when spin_button can't be changed
There are scenarios when the spin_button of a memory row cannot be
used. For example, during the "import" of a disk or when running
a disk that wasn't created by Boxes.
data/ui/preferences/memory-row.ui | 22 +++++++++++++++++-----
src/preferences/memory-row.vala | 4 ++++
2 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/data/ui/preferences/memory-row.ui b/data/ui/preferences/memory-row.ui
index c6f3265c..29ff20b3 100644
--- a/data/ui/preferences/memory-row.ui
+++ b/data/ui/preferences/memory-row.ui
@@ -5,12 +5,24 @@
<property name="activatable">False</property>
<child>
- <object class="GtkSpinButton" id="spin_button">
+ <object class="GtkStack" id="stack">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="valign">center</property>
- <signal name="input" handler="on_spin_button_input"/>
- <signal name="output" handler="on_spin_button_output"/>
+
+ <child>
+ <object class="GtkSpinButton" id="spin_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="valign">center</property>
+ <signal name="input" handler="on_spin_button_input"/>
+ <signal name="output" handler="on_spin_button_output"/>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkLabel" id="used_label">
+ <property name="visible">True</property>
+ </object>
+ </child>
</object>
</child>
</template>
diff --git a/src/preferences/memory-row.vala b/src/preferences/memory-row.vala
index 7ccbef6b..de3872e5 100644
--- a/src/preferences/memory-row.vala
+++ b/src/preferences/memory-row.vala
@@ -2,6 +2,10 @@
[GtkTemplate (ui = "/org/gnome/Boxes/ui/preferences/memory-row.ui")]
private class Boxes.MemoryRow : Hdy.ActionRow {
+ [GtkChild]
+ protected unowned Gtk.Stack stack;
+ [GtkChild]
+ protected unowned Gtk.Label used_label;
[GtkChild]
public unowned Gtk.SpinButton spin_button;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]