[dconf-editor] Fix initial size_allocate call.



commit 805cf1b89b1f0c89cacef113961279494042a6e3
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sun Jan 6 18:53:18 2019 +0100

    Fix initial size_allocate call.
    
    Looks like the GtkSearchEntry does something wrong, and the
    first size_allocate call reports, for a requested window of
    the minimal width (349px), a bad width allocation of 478px.

 editor/pathentry.vala | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/editor/pathentry.vala b/editor/pathentry.vala
index 6fe9d2e..f325e5e 100644
--- a/editor/pathentry.vala
+++ b/editor/pathentry.vala
@@ -30,6 +30,12 @@ private class PathEntry : Box, AdaptativeWidget
     [CCode (notify = false)] internal string text { get { return search_entry.text; }}
     [CCode (notify = false)] internal bool entry_has_focus { get { return search_entry.has_focus; }}
 
+    internal override void get_preferred_width (out int minimum_width, out int natural_width)
+    {
+        base.get_preferred_width (out minimum_width, out natural_width);
+        minimum_width = 72; // the search entry does something wrong that makes the first size_allocate ask 
for 478px width instead of 349
+    }
+
     private ulong can_reload_handler = 0;
     private bool thin_window = false;
     private void set_window_size (AdaptativeWidget.WindowSize new_size)


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