Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 5f28fa727d2e8de745f64c1362fb50f7649ebd77 1 parent 8b0b10f
Mike Krüger authored April 12, 2011
33  main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
@@ -1540,22 +1540,39 @@ public void Run (object target, Command cmd, object data)
1540 1540
 	internal class ToolbarTracker
1541 1541
 	{
1542 1542
 		Gtk.IconSize lastSize;
1543  
-		
  1543
+		 
1544 1544
 		public void Track (Gtk.Toolbar toolbar)
1545 1545
 		{
1546 1546
 			lastSize = toolbar.IconSize;
1547  
-			toolbar.AddNotification (OnToolbarPropChanged);
  1547
+			toolbar.AddNotification ("icon-size", IconSizeChanged);
  1548
+			toolbar.OrientationChanged += HandleToolbarOrientationChanged;
  1549
+			toolbar.StyleChanged += HandleToolbarStyleChanged;
  1550
+			
1548 1551
 			toolbar.Destroyed += delegate {
1549  
-				toolbar.RemoveNotification (OnToolbarPropChanged);
  1552
+				toolbar.StyleChanged -= HandleToolbarStyleChanged;
  1553
+				toolbar.OrientationChanged -= HandleToolbarOrientationChanged;
  1554
+				toolbar.RemoveNotification ("icon-size", IconSizeChanged);
1550 1555
 			};
1551 1556
 		}
1552  
-		
1553  
-		void OnToolbarPropChanged (object ob, GLib.NotifyArgs args)
  1557
+
  1558
+		void HandleToolbarStyleChanged (object o, Gtk.StyleChangedArgs args)
1554 1559
 		{
1555  
-			Gtk.Toolbar t = (Gtk.Toolbar) ob;
1556  
-			if (lastSize != t.IconSize || args.Property == "orientation" || args.Property == "toolbar-style")
  1560
+			Gtk.Toolbar t = (Gtk.Toolbar) o;
  1561
+			if (lastSize != t.IconSize)
1557 1562
 				UpdateCustomItems (t);
1558  
-			lastSize = t.IconSize;
  1563
+		}
  1564
+
  1565
+		void HandleToolbarOrientationChanged (object o, Gtk.OrientationChangedArgs args)
  1566
+		{
  1567
+			Gtk.Toolbar t = (Gtk.Toolbar) o;
  1568
+			if (lastSize != t.IconSize)
  1569
+				UpdateCustomItems (t);
  1570
+		}
  1571
+
  1572
+		void IconSizeChanged (object o, GLib.NotifyArgs args)
  1573
+		{
  1574
+			this.lastSize = ((Gtk.Toolbar) o).IconSize;
  1575
+			UpdateCustomItems ((Gtk.Toolbar) o);
1559 1576
 		}
1560 1577
 		
1561 1578
 		void UpdateCustomItems (Gtk.Toolbar t)

0 notes on commit 5f28fa7

Please sign in to comment.
Something went wrong with that request. Please try again.