[gnome-boxes] searchbar: Don't implement UIState



commit 077717114972e71e92c8303e3d012027c8d9399d
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sat Feb 1 16:33:49 2014 +0100

    searchbar: Don't implement UIState
    
    searchbar doesn't exactly reacts to ui state changes so it doesn't need
    to implement this interface and it helps us get rid of the now redundant
    Clutter actor.

 src/app.vala       |    2 +-
 src/searchbar.vala |   16 ++--------------
 2 files changed, 3 insertions(+), 15 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index b79f0fc..9da8541 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -684,7 +684,7 @@ private class Boxes.App: GLib.Object, Boxes.UI {
     private void ui_state_changed () {
         // The order is important for some widgets here (e.g properties must change its state before wizard 
so it can
         // flush any deferred changes for wizard to pick-up when going back from properties to wizard 
(review).
-        foreach (var ui in new Boxes.UI[] { sidebar, searchbar, topbar, view, properties, wizard, 
empty_boxes }) {
+        foreach (var ui in new Boxes.UI[] { sidebar, topbar, view, properties, wizard, empty_boxes }) {
             ui.set_state (ui_state);
         }
 
diff --git a/src/searchbar.vala b/src/searchbar.vala
index bf0ae5d..7aa7dbc 100644
--- a/src/searchbar.vala
+++ b/src/searchbar.vala
@@ -1,18 +1,6 @@
 // This file is part of GNOME Boxes. License: LGPLv2+
 
-private class Boxes.Searchbar: Gtk.SearchBar, Boxes.UI {
-    // See FIXME note on Boxes.Topbar.actor
-    public Clutter.Actor actor {
-        get {
-            if (gtk_actor == null)
-                gtk_actor = new Clutter.Actor ();
-            return gtk_actor;
-        }
-    }
-    private Clutter.Actor gtk_actor;
-
-    public UIState previous_ui_state { get; protected set; }
-    public UIState ui_state { get; protected set; }
+private class Boxes.Searchbar: Gtk.SearchBar {
     public bool enable_key_handler {
         set {
             if (value)
@@ -51,7 +39,7 @@ private class Boxes.Searchbar: Gtk.SearchBar, Boxes.UI {
     }
 
     private bool on_app_key_pressed (Gtk.Widget widget, Gdk.EventKey event) {
-        if (ui_state != UIState.COLLECTION)
+        if (App.app.ui_state != UIState.COLLECTION)
             return false;
 
         return handle_event ((Gdk.Event *) (&event));


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