[gnome-boxes] app-window: Drop 'duration' setting



commit 3906582d6fd31ba08da9e06bc40ae4154823c4a3
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sun Mar 2 21:21:42 2014 +0000

    app-window: Drop 'duration' setting
    
    We don't need to provide a setting for changing duration so lets
    hardcode it to the default value: 400.

 data/org.gnome.boxes.gschema.xml.in |    8 --------
 src/app-window.vala                 |   14 +++++++-------
 src/display-page.vala               |    6 +++---
 3 files changed, 10 insertions(+), 18 deletions(-)
---
diff --git a/data/org.gnome.boxes.gschema.xml.in b/data/org.gnome.boxes.gschema.xml.in
index 75ad083..ac5adc8 100644
--- a/data/org.gnome.boxes.gschema.xml.in
+++ b/data/org.gnome.boxes.gschema.xml.in
@@ -17,14 +17,6 @@
       <default>5</default>
     </key>
 
-    <key name="animation-duration" type="i">
-      <_summary>Animation duration</_summary>
-      <_description>
-        The time it takes for transitions and animation, in ms.
-      </_description>
-      <default>400</default>
-    </key>
-
     <key name="window-size" type="ai">
       <default>[768, 600]</default>
       <_summary>Window size</_summary>
diff --git a/src/app-window.vala b/src/app-window.vala
index 9b658f7..4aefe08 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -4,6 +4,8 @@ using Gdk;
 
 [GtkTemplate (ui = "/org/gnome/Boxes/ui/app-window.ui")]
 private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
+    public const uint TRANSITION_DURATION = 400; // milliseconds
+
     public UIState previous_ui_state { get; protected set; }
     public UIState ui_state { get; protected set; }
 
@@ -46,7 +48,6 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
     [GtkChild]
     public Selectionbar selectionbar;
 
-    public uint duration;
     public GLib.Settings settings;
 
     private uint configure_id;
@@ -67,7 +68,6 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
                                                   provider,
                                                   600);
 
-        duration = settings.get_int ("animation-duration");
         // restore window geometry/position
         var size = settings.get_value ("window-size");
         if (size.n_children () == 2) {
@@ -88,11 +88,11 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
             move (x, y);
         }
 
-        below_bin.transition_duration = duration;
-        content_bin.transition_duration = duration;
-        empty_boxes.transition_duration = duration;
-        sidebar.transition_duration = duration;
-        selectionbar.transition_duration = duration;
+        below_bin.transition_duration = TRANSITION_DURATION;
+        content_bin.transition_duration = TRANSITION_DURATION;
+        empty_boxes.transition_duration = TRANSITION_DURATION;
+        sidebar.transition_duration = TRANSITION_DURATION;
+        selectionbar.transition_duration = TRANSITION_DURATION;
     }
 
     public void setup_ui () {
diff --git a/src/display-page.vala b/src/display-page.vala
index 743be4e..e7aa2c1 100644
--- a/src/display-page.vala
+++ b/src/display-page.vala
@@ -34,7 +34,7 @@ private class Boxes.DisplayPage: Gtk.Box {
     private ulong display_grabbed_id;
 
     public void setup_ui () {
-        overlay_toolbar_invisible_timeout = App.window.duration;
+        overlay_toolbar_invisible_timeout = AppWindow.TRANSITION_DURATION;
         event_box.set_events (EventMask.POINTER_MOTION_MASK | EventMask.SCROLL_MASK);
 
         App.window.window_state_event.connect ((event) => {
@@ -178,7 +178,7 @@ private class Boxes.DisplayPage: Gtk.Box {
                       ModifierType.BUTTON1_MASK | ModifierType.BUTTON2_MASK |
                       ModifierType.BUTTON3_MASK | ModifierType.BUTTON4_MASK |
                       ModifierType.BUTTON5_MASK)) == 0) {
-                    toolbar_show_id = Timeout.add (App.window.duration, () => {
+                    toolbar_show_id = Timeout.add (AppWindow.TRANSITION_DURATION, () => {
                         set_overlay_toolbar_visible (true);
                         toolbar_show_id = 0;
                         return false;
@@ -189,7 +189,7 @@ private class Boxes.DisplayPage: Gtk.Box {
                 toolbar_hide_id = Timeout.add (overlay_toolbar_invisible_timeout, () => {
                     set_overlay_toolbar_visible (false);
                     toolbar_hide_id = 0;
-                    overlay_toolbar_invisible_timeout = App.window.duration;
+                    overlay_toolbar_invisible_timeout = AppWindow.TRANSITION_DURATION;
                     return false;
                 });
             }


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