[gnome-boxes] Allow label less properties
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] Allow label less properties
- Date: Wed, 21 Nov 2012 13:06:38 +0000 (UTC)
commit eaff26b8a1b4f92cda52686e28a27a0de9a044b8
Author: Alexander Larsson <alexl redhat com>
Date: Wed Nov 21 11:50:01 2012 +0100
Allow label less properties
I need this later for a property that is essentially just a button.
https://bugzilla.gnome.org/show_bug.cgi?id=685044
src/properties.vala | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/src/properties.vala b/src/properties.vala
index 49efe7c..2af479e 100644
--- a/src/properties.vala
+++ b/src/properties.vala
@@ -96,15 +96,22 @@ private class Boxes.Properties: Boxes.UI {
if (!empty) {
int current_row = 1;
foreach (var property in properties) {
- var label_name = new Gtk.Label (property.description);
- label_name.modify_fg (Gtk.StateType.NORMAL, get_color ("grey"));
- label_name.margin_left = 25;
- label_name.halign = Gtk.Align.START;
- label_name.hexpand = false;
- grid.attach (label_name, 0, current_row, 1, 1);
- var widget = property.widget;
- widget.hexpand = true;
- grid.attach (widget, 1, current_row, 1, 1);
+ if (property.description != null) {
+ var label_name = new Gtk.Label (property.description);
+ label_name.modify_fg (Gtk.StateType.NORMAL, get_color ("grey"));
+ label_name.margin_left = 25;
+ label_name.halign = Gtk.Align.START;
+ label_name.hexpand = false;
+ grid.attach (label_name, 0, current_row, 1, 1);
+ var widget = property.widget;
+ widget.hexpand = true;
+ grid.attach (widget, 1, current_row, 1, 1);
+ } else {
+ var widget = property.widget;
+ widget.hexpand = true;
+ widget.margin_left = 25;
+ grid.attach (widget, 0, current_row, 2, 1);
+ }
widget = property.extra_widget;
if (widget != null) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]