[dconf-editor] Introduce LARGE_WINDOW_SIZE.



commit 991951d3f7a4e9d48e6091a2680f426705ac8d24
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sun Jan 13 05:26:57 2019 +0100

    Introduce LARGE_WINDOW_SIZE.
    
    Depend on a const inside the library part,
    instead of one inside the browser classes.

 editor/adaptative-window.vala | 4 +++-
 editor/key-list-box-row.vala  | 2 +-
 editor/pathwidget.vala        | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/editor/adaptative-window.vala b/editor/adaptative-window.vala
index 9a13b41..1a60274 100644
--- a/editor/adaptative-window.vala
+++ b/editor/adaptative-window.vala
@@ -158,6 +158,8 @@ private abstract class NightTimeAwareHeaderBar : HeaderBar
     }
 }
 
+private const int LARGE_WINDOW_SIZE = 1042;
+
 [GtkTemplate (ui = "/ca/desrt/dconf-editor/ui/adaptative-window.ui")]
 private abstract class AdaptativeWindow : ApplicationWindow
 {
@@ -288,7 +290,7 @@ private abstract class AdaptativeWindow : ApplicationWindow
             if (extra_flat)         change_window_size (AdaptativeWidget.WindowSize.EXTRA_FLAT);
             else                    change_window_size (AdaptativeWidget.WindowSize.USUAL_SIZE);
 
-            if (width > MAX_ROW_WIDTH + 42)
+            if (width > LARGE_WINDOW_SIZE)
                 set_style_classes (false, false, true);
             else
                 set_style_classes (false, false, false);
diff --git a/editor/key-list-box-row.vala b/editor/key-list-box-row.vala
index 9c71648..e56fb41 100644
--- a/editor/key-list-box-row.vala
+++ b/editor/key-list-box-row.vala
@@ -17,7 +17,7 @@
 
 using Gtk;
 
-const int MAX_ROW_WIDTH = 1000;
+private const int MAX_ROW_WIDTH = LARGE_WINDOW_SIZE - 42;
 
 private class ListBoxRowWrapper : ListBoxRow
 {
diff --git a/editor/pathwidget.vala b/editor/pathwidget.vala
index 4b02735..c28051c 100644
--- a/editor/pathwidget.vala
+++ b/editor/pathwidget.vala
@@ -199,6 +199,6 @@ private class PathWidget : Box, AdaptativeWidget
     internal 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 - 38;  // see key-list-box-row.vala
+        natural_width = MAX_ROW_WIDTH - 46;  // see key-list-box-row.vala
     }
 }


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