[dconf-editor] Limit infobars content width.



commit e493db0b0adbc16a888f1c838f1b94d94c0f94b5
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Fri Dec 15 04:58:57 2017 +0100

    Limit infobars content width.

 editor/browser-view.ui       |   15 ++++++++++++---
 editor/key-list-box-row.vala |    9 +++++++++
 editor/registry-info.ui      |   40 +++++++++++++++++++++++++++++++++++++---
 editor/registry-view.ui      |   12 ++++++++++++
 4 files changed, 70 insertions(+), 6 deletions(-)
---
diff --git a/editor/browser-view.ui b/editor/browser-view.ui
index 77de1a8..c17539f 100644
--- a/editor/browser-view.ui
+++ b/editor/browser-view.ui
@@ -11,12 +11,22 @@
           <object class="GtkInfoBar">
             <property name="visible">True</property>
             <property name="message-type">info</property>
+            <child internal-child="action_area">
+              <object class="GtkBox">
+                <property name="visible">False</property>
+              </object>
+            </child>
             <child internal-child="content_area">
               <object class="GtkBox">
                 <child>
+                  <object class="RegistryWarning">
+                    <property name="visible">True</property>
+                    <property name="halign">center</property>
+                <child>
                   <object class="GtkLabel">
                     <property name="visible">True</property>
                     <property name="hexpand">True</property>
+                    <property name="xalign">0</property>
                     <property name="max-width-chars">40</property>
                     <property name="wrap">True</property>
                     <property name="label" translatable="yes">This content has changed. Do you want to 
reload the view?</property>
@@ -28,9 +38,8 @@
                     <property name="label" translatable="yes">Reload</property>
                     <signal name="clicked" handler="reload"/>
                   </object>
-                  <packing>
-                    <property name="pack-type">end</property>
-                  </packing>
+                </child>
+                  </object>
                 </child>
               </object>
             </child>
diff --git a/editor/key-list-box-row.vala b/editor/key-list-box-row.vala
index 3c9d66a..c2f7d1d 100644
--- a/editor/key-list-box-row.vala
+++ b/editor/key-list-box-row.vala
@@ -28,6 +28,15 @@ private class ListBoxRowWrapper : ListBoxRow
     }
 }
 
+private class RegistryWarning : Grid
+{
+    public override void get_preferred_width (out int minimum_width, out int natural_width)
+    {
+        base.get_preferred_width (out minimum_width, out natural_width);
+        natural_width = MAX_ROW_WIDTH;
+    }
+}
+
 private class ListBoxRowHeader : Grid
 {
     public override void get_preferred_width (out int minimum_width, out int natural_width)
diff --git a/editor/registry-info.ui b/editor/registry-info.ui
index af6ca63..e9ebf08 100644
--- a/editor/registry-info.ui
+++ b/editor/registry-info.ui
@@ -11,18 +11,30 @@
           <object class="GtkInfoBar">
             <property name="visible">True</property>
             <property name="message-type">warning</property>
+            <child internal-child="action_area">
+              <object class="GtkBox">
+                <property name="visible">False</property>
+              </object>
+            </child>
             <child internal-child="content_area">
               <object class="GtkBox">
                 <child>
+                  <object class="RegistryWarning">
+                    <property name="visible">True</property>
+                    <property name="halign">center</property>
+                <child>
                   <object class="GtkLabel">
                     <property name="visible">True</property>
                     <property name="hexpand">True</property>
+                    <property name="xalign">0.5</property>
                     <property name="max-width-chars">40</property>
                     <property name="wrap">True</property>
                     <property name="label" translatable="yes">Multiple schemas are installed at the parent 
path. This key might be defined and used by more than one schema. This could lead to problems. Edit value at 
your own risk.</property>
                   </object>
                 </child>
               </object>
+                </child>
+              </object>
             </child>
           </object>
         </child>
@@ -36,12 +48,22 @@
           <object class="GtkInfoBar">
             <property name="visible">True</property>
             <property name="message-type">info</property>
+            <child internal-child="action_area">
+              <object class="GtkBox">
+                <property name="visible">False</property>
+              </object>
+            </child>
             <child internal-child="content_area">
               <object class="GtkBox">
                 <child>
+                  <object class="RegistryWarning">
+                    <property name="visible">True</property>
+                    <property name="halign">center</property>
+                <child>
                   <object class="GtkLabel">
                     <property name="visible">True</property>
                     <property name="hexpand">True</property>
+                    <property name="xalign">0</property>
                     <property name="max-width-chars">40</property>
                     <property name="wrap">True</property>
                     <property name="label" translatable="yes">No schema available. A schema is what 
describes the use of a key, and Dconf Editor can’t find one associated with this key. If the application that 
was using this key has been uninstalled, or if this key is obsolete, you may want to erase it.</property>
@@ -52,9 +74,8 @@
                     <property name="visible">True</property>
                     <property name="label" translatable="yes">Erase key</property>
                   </object>
-                  <packing>
-                    <property name="pack-type">end</property>
-                  </packing>
+                </child>
+                  </object>
                 </child>
               </object>
             </child>
@@ -70,12 +91,22 @@
           <object class="GtkInfoBar">
             <property name="visible">True</property>
             <property name="message-type">info</property>
+            <child internal-child="action_area">
+              <object class="GtkBox">
+                <property name="visible">False</property>
+              </object>
+            </child>
             <child internal-child="content_area">
               <object class="GtkBox">
                 <child>
+                  <object class="RegistryWarning">
+                    <property name="visible">True</property>
+                    <property name="halign">center</property>
+                <child>
                   <object class="GtkLabel" id="one_choice_enum_warning">
                     <property name="visible">True</property>
                     <property name="hexpand">True</property>
+                    <property name="xalign">0.5</property>
                     <property name="max-width-chars">40</property>
                     <property name="wrap">True</property>
                     <property name="label" translatable="yes">This enumeration offers only one choice. 
That’s probably an error of the application that installed this schema. If possible, please open a bug about 
it.</property>
@@ -85,11 +116,14 @@
                   <object class="GtkLabel" id="one_choice_integer_warning">
                     <property name="visible">True</property>
                     <property name="hexpand">True</property>
+                    <property name="xalign">0.5</property>
                     <property name="max-width-chars">40</property>
                     <property name="wrap">True</property>
                     <property name="label" translatable="yes">This integer key can only take one value. 
That’s probably an error of the application that installed this schema. If possible, please open a bug about 
it.</property>
                   </object>
                 </child>
+                  </object>
+                </child>
               </object>
             </child>
           </object>
diff --git a/editor/registry-view.ui b/editor/registry-view.ui
index f806c64..f90ccfc 100644
--- a/editor/registry-view.ui
+++ b/editor/registry-view.ui
@@ -11,17 +11,29 @@
           <object class="GtkInfoBar">
             <property name="visible">True</property>
             <property name="message-type">warning</property>
+            <child internal-child="action_area">
+              <object class="GtkBox">
+                <property name="visible">False</property>
+              </object>
+            </child>
             <child internal-child="content_area">
               <object class="GtkBox">
                 <child>
+                  <object class="RegistryWarning">
+                    <property name="visible">True</property>
+                    <property name="halign">center</property>
+                <child>
                   <object class="GtkLabel">
                     <property name="visible">True</property>
                     <property name="hexpand">True</property>
+                    <property name="xalign">0.5</property>
                     <property name="max-width-chars">40</property>
                     <property name="wrap">True</property>
                     <property name="label" translatable="yes">Multiple schemas are installed at this path. 
This could lead to problems if it hasn’t been done carefully. Only one schema is displayed here. Edit values 
at your own risk.</property>
                   </object>
                 </child>
+                  </object>
+                </child>
               </object>
             </child>
           </object>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]