[gnome-games/wip/exalm/ds: 2/8] display-header-bar: Show extra widget



commit 17ea645df8f23641cc0e75613b7d7b5cdfa38231
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Fri Jan 4 14:09:03 2019 +0500

    display-header-bar: Show extra widget

 src/ui/display-header-bar.vala | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
---
diff --git a/src/ui/display-header-bar.vala b/src/ui/display-header-bar.vala
index 8e5bf941..79c3ffcb 100644
--- a/src/ui/display-header-bar.vala
+++ b/src/ui/display-header-bar.vala
@@ -31,6 +31,28 @@ private class Games.DisplayHeaderBar : Gtk.HeaderBar {
                set {
                        _runner = value;
                        input_mode_switcher.runner = value;
+
+                       if (runner != null)
+                               extra_widget = runner.get_extra_widget ();
+                       else
+                               extra_widget = null;
+               }
+       }
+
+       private Gtk.Widget _extra_widget;
+       private Gtk.Widget extra_widget {
+               get { return _extra_widget; }
+               set {
+                       if (extra_widget == value)
+                               return;
+
+                       if (extra_widget != null)
+                               remove (extra_widget);
+
+                       _extra_widget = value;
+
+                       if (extra_widget != null)
+                               pack_end (extra_widget);
                }
        }
 


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