[dconf-editor] Use ListBoxRowWrapper in properties view rows
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Use ListBoxRowWrapper in properties view rows
- Date: Wed, 22 Nov 2017 04:49:13 +0000 (UTC)
commit b22af69d12da0e8ed322e4f5a8d2f7aa31870b5f
Author: Davi da Silva Böger <dsboger gmail com>
Date: Sat Nov 18 10:34:45 2017 -0200
Use ListBoxRowWrapper in properties view rows
Instead of the max_width_chars property, so the rows adapt better to
window size.
editor/dconf-editor.css | 5 +++--
editor/property-row.ui | 5 ++---
editor/registry-info.vala | 13 ++++---------
3 files changed, 9 insertions(+), 14 deletions(-)
---
diff --git a/editor/dconf-editor.css b/editor/dconf-editor.css
index 62dc9a7..7761674 100644
--- a/editor/dconf-editor.css
+++ b/editor/dconf-editor.css
@@ -218,8 +218,9 @@
background-color:initial;
padding:0.3em 0;
}
- list.properties-list > row { /* TODO what? */
- padding:0 6px; /* align on headerbar's buttons */
+
+ list.properties-list > row {
+ padding:0;
}
/* rows usual height */
diff --git a/editor/property-row.ui b/editor/property-row.ui
index 8cf3bd1..80450f8 100644
--- a/editor/property-row.ui
+++ b/editor/property-row.ui
@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
- <template class="PropertyRow" parent="GtkListBoxRow">
+ <template class="PropertyRow" parent="ListBoxRowWrapper">
<property name="visible">True</property>
+ <property name="halign">center</property>
<child>
<object class="GtkGrid" id="grid">
<property name="visible">True</property>
- <property name="halign">center</property>
- <property name="width-request">700</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkLabel" id="name_label">
diff --git a/editor/registry-info.vala b/editor/registry-info.vala
index a9b92c0..ea0a694 100644
--- a/editor/registry-info.vala
+++ b/editor/registry-info.vala
@@ -105,8 +105,6 @@ class RegistryInfo : Grid
label.xalign = 0;
label.yalign = 0;
label.wrap = true;
- label.max_width_chars = 42;
- label.width_chars = 42;
label.hexpand = true;
label.show ();
add_row_from_widget (_("Current value"), label, null);
@@ -303,13 +301,13 @@ class RegistryInfo : Grid
private void add_separator ()
{
Separator separator = new Separator (Orientation.HORIZONTAL);
- separator.halign = Align.CENTER;
- separator.width_request = 620;
+ separator.halign = Align.FILL;
separator.margin_bottom = 5;
separator.margin_top = 5;
separator.show ();
- ListBoxRow row = new ListBoxRow ();
+ ListBoxRowWrapper row = new ListBoxRowWrapper ();
+ row.halign = Align.CENTER;
row.add (separator);
row.set_sensitive (false);
/* TODO could be selected by down arrow row.focus.connect ((direction) => { row.move_focus
(direction); return false; }); */
@@ -335,7 +333,6 @@ class RegistryInfo : Grid
private static Widget warning_label (string text)
{
Label label = new Label (text);
- label.max_width_chars = 59;
label.wrap = true;
StyleContext context = label.get_style_context ();
context.add_class ("italic-label");
@@ -345,7 +342,7 @@ class RegistryInfo : Grid
}
[GtkTemplate (ui = "/ca/desrt/dconf-editor/ui/property-row.ui")]
-private class PropertyRow : ListBoxRow
+private class PropertyRow : ListBoxRowWrapper
{
[GtkChild] private Grid grid;
[GtkChild] private Label name_label;
@@ -362,8 +359,6 @@ private class PropertyRow : ListBoxRow
value_label.xalign = 0;
value_label.yalign = 0;
value_label.wrap = true;
- value_label.max_width_chars = 42;
- value_label.width_chars = 42;
value_label.show ();
grid.attach (value_label, 1, 0, 1, 1);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]