Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed "Bug 686594 - Monodevelop is broken with new GTK3 and GNOME3".

  • Loading branch information...
commit 5f28fa727d2e8de745f64c1362fb50f7649ebd77 1 parent 8b0b10f
@mkrueger mkrueger authored
View
33 main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
@@ -1540,22 +1540,39 @@ public void Run (object target, Command cmd, object data)
internal class ToolbarTracker
{
Gtk.IconSize lastSize;
-
+
public void Track (Gtk.Toolbar toolbar)
{
lastSize = toolbar.IconSize;
- toolbar.AddNotification (OnToolbarPropChanged);
+ toolbar.AddNotification ("icon-size", IconSizeChanged);
+ toolbar.OrientationChanged += HandleToolbarOrientationChanged;
+ toolbar.StyleChanged += HandleToolbarStyleChanged;
+
toolbar.Destroyed += delegate {
- toolbar.RemoveNotification (OnToolbarPropChanged);
+ toolbar.StyleChanged -= HandleToolbarStyleChanged;
+ toolbar.OrientationChanged -= HandleToolbarOrientationChanged;
+ toolbar.RemoveNotification ("icon-size", IconSizeChanged);
};
}
-
- void OnToolbarPropChanged (object ob, GLib.NotifyArgs args)
+
+ void HandleToolbarStyleChanged (object o, Gtk.StyleChangedArgs args)
{
- Gtk.Toolbar t = (Gtk.Toolbar) ob;
- if (lastSize != t.IconSize || args.Property == "orientation" || args.Property == "toolbar-style")
+ Gtk.Toolbar t = (Gtk.Toolbar) o;
+ if (lastSize != t.IconSize)
UpdateCustomItems (t);
- lastSize = t.IconSize;
+ }
+
+ void HandleToolbarOrientationChanged (object o, Gtk.OrientationChangedArgs args)
+ {
+ Gtk.Toolbar t = (Gtk.Toolbar) o;
+ if (lastSize != t.IconSize)
+ UpdateCustomItems (t);
+ }
+
+ void IconSizeChanged (object o, GLib.NotifyArgs args)
+ {
+ this.lastSize = ((Gtk.Toolbar) o).IconSize;
+ UpdateCustomItems ((Gtk.Toolbar) o);
}
void UpdateCustomItems (Gtk.Toolbar t)
Please sign in to comment.
Something went wrong with that request. Please try again.