banshee r3718 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Gui src/Core/Banshee.ThickClient/Banshee.Gui.Widgets src/Libraries/Hyena.Gui src/Libraries/Hyena.Gui/Hyena.Widgets



Author: scottp
Date: Tue Apr  8 19:53:39 2008
New Revision: 3718
URL: http://svn.gnome.org/viewvc/banshee?rev=3718&view=rev

Log:
* src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackShuffleActions.cs:
Ctor now takes a PlaybackActions object so that it always has a
reference to the next action.

* src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs: Move
instantiation of the repeat and shuffle actions to after the other
actions so that the shuffle action can change the next action's
icon.

* src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/NextArrowButton.cs:
* src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/RepeatActionButton.cs:
Set visual style in ctor.

* src/Libraries/Hyena.Gui/Hyena.Widgets/ArrowButton.cs: Derives from
ActionGroupButton and uses an ActionButton for the "main" button
part. Also proxies things like style, relief, &c. to the main
ActionButton.

* src/Libraries/Hyena.Gui/Hyena.Widgets/ActionGroupButton.cs: Now
derives from ActionButton.

* src/Libraries/Hyena.Gui/Hyena.Widgets/ActionButton.cs: ActionButton
is now the base of custom action-bound buttons. It doesn't do the
cool Action.ConnectProxy shit that ToolButton does (because Gtk+
Suxorz Teh Big One!!1!11), but it's pretty close. It also
integrates with the style of a Toolbar you pass it.

Added:
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/ActionGroupButton.cs
Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/NextArrowButton.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/RepeatActionButton.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackShuffleActions.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.mdp
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/ActionButton.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/ArrowButton.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Makefile.am

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/NextArrowButton.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/NextArrowButton.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/NextArrowButton.cs	Tue Apr  8 19:53:39 2008
@@ -37,10 +37,13 @@
 {
     public class NextArrowButton : ArrowButton
     {
-        private InterfaceActionService service = ServiceManager.Get<InterfaceActionService> ();
+        private static InterfaceActionService service = ServiceManager.Get<InterfaceActionService> ();
         
-        public NextArrowButton() : base (ServiceManager.Get<InterfaceActionService> ().PlaybackActions["NextAction"])
+        public NextArrowButton() : base (service.PlaybackActions["NextAction"])
         {
+            ActionButtonStyle = ActionButtonStyle.Icon;
+            IconSize = Gtk.IconSize.LargeToolbar;
+            Relief = ReliefStyle.None;
         }
         
         protected override IEnumerable<Widget> MenuItems {

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/RepeatActionButton.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/RepeatActionButton.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/RepeatActionButton.cs	Tue Apr  8 19:53:39 2008
@@ -36,10 +36,17 @@
 
 namespace Banshee.Gui.Widgets
 {
-    public class RepeatActionButton : ActionButton
+    public class RepeatActionButton : ActionGroupButton
     {
         private InterfaceActionService service = ServiceManager.Get<InterfaceActionService> ();
         
+        public RepeatActionButton ()
+        {
+            ActionButtonStyle = ActionButtonStyle.BothHoriz;
+            IconSize = Gtk.IconSize.Menu;
+            Relief = ReliefStyle.None;
+        }
+        
         protected override IRadioActionGroup ActionGroup {
             get { return service.PlaybackActions.RepeatActions; }
         }

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackActions.cs	Tue Apr  8 19:53:39 2008
@@ -60,9 +60,6 @@
         
         public PlaybackActions (InterfaceActionService actionService) : base ("Playback")
         {
-            repeat_actions = new PlaybackRepeatActions (actionService);
-            shuffle_actions = new PlaybackShuffleActions (actionService);
-
             Add (new ActionEntry [] {
                 new ActionEntry ("PlayPauseAction", null,
                     Catalog.GetString ("_Play"), "space",
@@ -112,6 +109,9 @@
             action_service = actionService;
             ServiceManager.PlayerEngine.StateChanged += OnPlayerEngineStateChanged;
             ServiceManager.PlayerEngine.EventChanged += OnPlayerEngineEventChanged;
+            
+            repeat_actions = new PlaybackRepeatActions (actionService);
+            shuffle_actions = new PlaybackShuffleActions (actionService, this);
         }
         
         private void OnPlayerEngineStateChanged (object o, PlayerEngineStateArgs args)

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackShuffleActions.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackShuffleActions.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/PlaybackShuffleActions.cs	Tue Apr  8 19:53:39 2008
@@ -43,6 +43,7 @@
     public class PlaybackShuffleActions : BansheeActionGroup, IRadioActionGroup
     {
         private RadioAction active_action;
+        private PlaybackActions playback_actions;
 
         public RadioAction Active {
             get { return active_action; }
@@ -55,8 +56,10 @@
 
         public event ChangedHandler Changed;
         
-        public PlaybackShuffleActions (InterfaceActionService actionService) : base ("PlaybackShuffle")
+        public PlaybackShuffleActions (InterfaceActionService actionService, PlaybackActions playbackActions)
+            : base ("PlaybackShuffle")
         {
+            playback_actions = playbackActions;
             actionService.AddActionGroup (this);
 
             Add (new RadioActionEntry [] {
@@ -102,6 +105,8 @@
         {
             Active = args.Current;
             
+            playback_actions["NextAction"].IconName = Active.IconName;
+            
             ChangedHandler handler = Changed;
             if (handler != null) {
                 handler (o, args);

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.mdp
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.mdp	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Gui.mdp	Tue Apr  8 19:53:39 2008
@@ -68,6 +68,7 @@
     <File name="Hyena.Gui/IRadioActionGroup.cs" subtype="Code" buildaction="Compile" />
     <File name="Hyena.Widgets/ActionButton.cs" subtype="Code" buildaction="Compile" />
     <File name="Hyena.Widgets/ArrowButton.cs" subtype="Code" buildaction="Compile" />
+    <File name="Hyena.Widgets/ActionGroupButton.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/ActionButton.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/ActionButton.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/ActionButton.cs	Tue Apr  8 19:53:39 2008
@@ -27,7 +27,6 @@
 //
 
 using System;
-using System.Collections.Generic;
 using Gtk;
 
 using Hyena.Gui;
@@ -36,151 +35,156 @@
 {
     public enum ActionButtonStyle
     {
-        IconOnly,
-        TextOnly,
-        IconAndText
+        Icon,
+        Text,
+        Both,
+        BothHoriz,
+        None
     }
     
-    public abstract class ActionButton : Button
+    public class ActionButton : Button
     {
-        private Button target_button;
-        private HBox box = new HBox ();
+        private Gtk.Action action;
         private Label label = new Label ();
         private Image image = new Image ();
-        private ActionButtonStyle? style;
+        private HBox hbox = new HBox ();
+        private VBox vbox = new VBox ();
+        private Box box;
+        private Toolbar toolbar;
+        private ActionButtonStyle style;
         
-        protected ActionButton ()
+        public ActionButton () : this (null, null)
         {
-            ActionGroup.Changed += OnActionChanged;
-            
-            Relief = ReliefStyle.None;
-            box.Spacing = 4;
-            image.IconSize = (int)Gtk.IconSize.Menu;
-            label.UseUnderline = true;
-            
-            TargetButton = this;
-            ActionButtonStyle = ActionButtonStyle.IconAndText;
-            
-            SetActiveItem (ActionGroup.Active);
         }
         
-        protected abstract IRadioActionGroup ActionGroup { get; }
-        
-        private void OnActionChanged (object o, ChangedArgs args)
+        public ActionButton (Toolbar toolbar) : this (null, toolbar)
         {
-            SetActiveItem (args.Current);
-        }
-        
-        private void SetActiveItem (RadioAction action)
-        {
-            if (action == null) {
-                return;
-            }
-
-            image.IconName = action.IconName;
-            label.TextWithMnemonic = action.Label;
-            target_button.Sensitive = action.Sensitive && action.Visible;
         }
         
-        protected void ShowMenu ()
+        public ActionButton (Gtk.Action action) : this (action, null)
         {
-            BuildMenu ().Popup (null, null, PositionMenu, 1, Gtk.Global.CurrentEventTime);
         }
         
-        private Menu BuildMenu ()
+        public ActionButton (Gtk.Action action, Toolbar toolbar)
         {
-            Menu menu = new Menu ();
-            foreach (Widget widget in MenuItems) {
-                menu.Append (widget);
-            }
-
-            menu.ShowAll ();
-            return menu;
-        }
-        
-        protected virtual IEnumerable<Widget> MenuItems {
-            get {
-                foreach (RadioAction action in ActionGroup) {
-                    yield return action.CreateMenuItem ();
-                }
-            }
-        }
-
-        private void PositionMenu (Menu menu, out int x, out int y, out bool push_in) 
-        {
-            Gtk.Requisition menu_req = menu.SizeRequest ();
-            int monitor_num = Screen.GetMonitorAtWindow (target_button.GdkWindow);
-            Gdk.Rectangle monitor = Screen.GetMonitorGeometry (monitor_num < 0 ? 0 : monitor_num);
-
-            target_button.GdkWindow.GetOrigin (out x, out y);
+            FocusOnClick = false;
+            ActionButtonStyle = ActionButtonStyle.Icon;
             
-            y += target_button.Allocation.Y;
-            x += target_button.Allocation.X + (Direction == TextDirection.Ltr
-                ? Math.Max (target_button.Allocation.Width - menu_req.Width, 0)
-                : - (menu_req.Width - target_button.Allocation.Width));
+            Action = action;
+            Toolbar = toolbar;
             
-            if (y + target_button.Allocation.Height + menu_req.Height <= monitor.Y + monitor.Height) {
-                y += target_button.Allocation.Height;
-            } else if (y - menu_req.Height >= monitor.Y) {
-                y -= menu_req.Height;
-            } else if (monitor.Y + monitor.Height - (y + target_button.Allocation.Height) > y) {
-                y += target_button.Allocation.Height;
-            } else {
-                y -= menu_req.Height;
-            }
-
-            push_in = false;
-        }
-        
-        protected override void OnActivated ()
-        {
-            ShowMenu ();
-        }
-
-        protected override bool OnButtonPressEvent (Gdk.EventButton evnt)
-        {
-            ShowMenu ();
-            return true;
-        }
-        
-        public Button TargetButton {
-            get { return target_button; }
-            protected set {
-                if (target_button != null) {
-                    target_button.Remove (box);
-                }
-                target_button = value;
-                target_button.Add (box);
-            }
-        }
-        
-        protected int IconSize {
-            get { return image.IconSize; }
-            set { image.IconSize = value; }
+            label.UseUnderline = true;
+            hbox.Spacing = 4;
+            vbox.Spacing = 4;
         }
         
-        protected ActionButtonStyle ActionButtonStyle {
-            get { return style ?? ActionButtonStyle.IconAndText; }
+        public virtual ActionButtonStyle ActionButtonStyle {
+            get { return style; }
             set {
-                if (style != null) {
-                    if (style.Value != ActionButtonStyle.TextOnly) {
+                if (box != null) {
+                    if (style != ActionButtonStyle.Text) {
                         box.Remove (image);
                     }
-                    if (style.Value != ActionButtonStyle.IconOnly) {
+                    if (style != ActionButtonStyle.Icon) {
                         box.Remove (label);
                     }
+                    Remove (box);
                 }
                 
                 style = value;
                 
-                if (style.Value != ActionButtonStyle.TextOnly) {
+                if (style == ActionButtonStyle.None) {
+                    box = null;
+                    return;
+                }
+                
+                box = style == ActionButtonStyle.BothHoriz ? (Box)hbox : vbox;
+                
+                if (style != ActionButtonStyle.Text) {
                     box.PackStart (image, false, false, 0);
                 }
-                if (style.Value != ActionButtonStyle.IconOnly) {
+                if (style != ActionButtonStyle.Icon) {
                     box.PackStart (label, true, true, 0);
                 }
+                
+                Add (box);
                 box.ShowAll ();
             }
         }
+        
+        public virtual new Gtk.Action Action {
+            get { return action; }
+            set {
+                action = value;
+                if (action == null) {
+                    if (image.IconName != null) {
+                        image.IconName = null;
+                    }
+                    if (image.Stock != null) {
+                        image.Stock = null;
+                    }
+                    label.TextWithMnemonic = String.Empty;
+                    Sensitive = false;
+                } else {
+                    if (!String.IsNullOrEmpty (action.IconName)) {
+                        image.IconName = action.IconName;
+                    } else if (!String.IsNullOrEmpty (action.StockId)) {
+                        image.Stock = action.StockId;
+                    }
+                    label.TextWithMnemonic = action.Label;
+                    Sensitive = action.Sensitive && action.Visible;
+                }
+            }
+        }
+        
+        public virtual Toolbar Toolbar {
+            get { return toolbar; }
+            set {
+                if (toolbar != null) {
+                    toolbar.StyleChanged -= OnToolbarStyleChanged;
+                }
+                
+                toolbar = value;
+                
+                if (toolbar != null) {
+                    toolbar.StyleChanged += OnToolbarStyleChanged;
+                    Relief = toolbar.ReliefStyle;
+                    OnToolbarStyleChanged (null, null);
+                }
+            }
+        }
+        
+        public virtual IconSize IconSize {
+            get { return (IconSize)image.IconSize; }
+            set { image.IconSize = (int)value; }
+        }
+        
+        protected override void OnActivated ()
+        {
+            action.Activate ();
+        }
+        
+        protected override void OnClicked ()
+        {
+            action.Activate ();
+        }
+        
+        private void OnToolbarStyleChanged (object o, StyleChangedArgs args)
+        {
+            switch (toolbar.ToolbarStyle) {
+            case ToolbarStyle.Icons:
+                ActionButtonStyle = ActionButtonStyle.Icon;
+                break;
+            case ToolbarStyle.Text:
+                ActionButtonStyle = ActionButtonStyle.Text;
+                break;
+            case ToolbarStyle.Both:
+                ActionButtonStyle = ActionButtonStyle.Both;
+                break;
+            case ToolbarStyle.BothHoriz:
+                ActionButtonStyle = ActionButtonStyle.BothHoriz;
+                break;
+            }
+        }
     }
 }

Added: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/ActionGroupButton.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/ActionGroupButton.cs	Tue Apr  8 19:53:39 2008
@@ -0,0 +1,112 @@
+//
+// ActionGroupButton.cs
+//
+// Authors:
+//   Aaron Bockover <abockover novell com>
+//   Scott Peterson <lunchtimemama gmail com>
+//
+// Copyright (C) 2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using Gtk;
+
+using Hyena.Gui;
+
+namespace Hyena.Widgets
+{
+    public abstract class ActionGroupButton : ActionButton
+    {
+        protected abstract IRadioActionGroup ActionGroup { get; }
+        
+        protected ActionGroupButton () : this (null)
+        {
+        }
+        
+        protected ActionGroupButton (Toolbar toolbar) : base (toolbar)
+        {
+            ActionGroup.Changed += delegate { Action = ActionGroup.Active; };
+            Action = ActionGroup.Active;
+        }
+        
+        protected void ShowMenu ()
+        {
+            BuildMenu ().Popup (null, null, PositionMenu, 1, Gtk.Global.CurrentEventTime);
+        }
+        
+        protected override void OnActivated ()
+        {
+            ShowMenu ();
+        }
+        
+        protected override bool OnButtonPressEvent (Gdk.EventButton evnt)
+        {
+            ShowMenu ();
+            return true;
+        }
+        
+        private Menu BuildMenu ()
+        {
+            Menu menu = new Menu ();
+            foreach (Widget widget in MenuItems) {
+                menu.Append (widget);
+            }
+
+            menu.ShowAll ();
+            return menu;
+        }
+        
+        protected virtual IEnumerable<Widget> MenuItems {
+            get {
+                foreach (RadioAction action in ActionGroup) {
+                    yield return action.CreateMenuItem ();
+                }
+            }
+        }
+
+        private void PositionMenu (Menu menu, out int x, out int y, out bool push_in) 
+        {
+            Gtk.Requisition menu_req = menu.SizeRequest ();
+            int monitor_num = Screen.GetMonitorAtWindow (GdkWindow);
+            Gdk.Rectangle monitor = Screen.GetMonitorGeometry (monitor_num < 0 ? 0 : monitor_num);
+
+            GdkWindow.GetOrigin (out x, out y);
+            
+            y += Allocation.Y;
+            x += Allocation.X + (Direction == TextDirection.Ltr
+                ? Math.Max (Allocation.Width - menu_req.Width, 0)
+                : - (menu_req.Width - Allocation.Width));
+            
+            if (y + Allocation.Height + menu_req.Height <= monitor.Y + monitor.Height) {
+                y += Allocation.Height;
+            } else if (y - menu_req.Height >= monitor.Y) {
+                y -= menu_req.Height;
+            } else if (monitor.Y + monitor.Height - (y + Allocation.Height) > y) {
+                y += Allocation.Height;
+            } else {
+                y -= menu_req.Height;
+            }
+
+            push_in = false;
+        }
+    }
+}

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/ArrowButton.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/ArrowButton.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/ArrowButton.cs	Tue Apr  8 19:53:39 2008
@@ -34,36 +34,73 @@
 
 namespace Hyena.Widgets
 {
-    public abstract class ArrowButton : ActionButton
+    public abstract class ArrowButton : ActionGroupButton
     {
         private Gtk.Action action;
-        private Button button;
+        private ActionButton button;
         private ReliefStyle relief;
         private Rectangle arrow_alloc;
         
-        protected ArrowButton () : this (null)
+        protected ArrowButton () : this (null, null)
         {
         }
         
-        protected ArrowButton (Gtk.Action action)
+        protected ArrowButton (Gtk.Action action) : this (action, null)
         {
+        }
+        
+        protected ArrowButton (Toolbar toolbar) : this (null, toolbar)
+        {
+        }
+        
+        protected ArrowButton (Gtk.Action action, Toolbar toolbar)
+        {
+            base.ActionButtonStyle = ActionButtonStyle.None;
+            
             this.action = action;
-            button = new Button ();
-            button.FocusOnClick = false;
-            button.Entered += delegate { base.Relief = ReliefStyle.Normal; };
-            button.Left += delegate { base.Relief = relief; };
-            button.StateChanged += delegate { State = button.State; };
-            button.Clicked += delegate { OnActivate (); };
+            
             arrow_alloc.Width = 5;
             arrow_alloc.Height = 3;
-            TargetButton = button;
-            ActionButtonStyle = ActionButtonStyle.IconOnly;
-            IconSize = (int)Gtk.IconSize.LargeToolbar;
-            Relief = base.Relief;
+            
+            button = new ActionButton (action);
+            button.Entered += delegate { base.Relief = ReliefStyle.Normal; };
+            button.Left += delegate { base.Relief = relief;};
+            button.StateChanged += delegate { State = button.State; };
+            
+            ActionGroup.Changed += delegate { button.Action = this.action ?? ActionGroup.Active; };
+            Toolbar = toolbar;
+        }
+        
+        public new Gtk.Action Action {
+            get { return button.Action; }
+            set {
+                action = value;
+                button.Action = action;
+            }
         }
         
-        protected new virtual Gtk.Action Action {
-            get { return action ?? ActionGroup.Active; }
+        public override ActionButtonStyle ActionButtonStyle {
+            get { return button == null ? base.ActionButtonStyle : button.ActionButtonStyle; }
+            set {
+                if (button == null) {
+                    base.ActionButtonStyle = value;
+                } else {
+                    button.ActionButtonStyle = value;
+                }
+            }
+        }
+        
+        public override Toolbar Toolbar {
+            get { return button.Toolbar; }
+            set {
+                if (button == null) {
+                    return;
+                }
+                button.Toolbar = value;
+                if (value != null) {
+                    Relief = value.ReliefStyle;
+                }
+            }
         }
         
         public new ReliefStyle Relief {
@@ -75,10 +112,15 @@
             }
         }
         
+        public override IconSize IconSize {
+            get { return button.IconSize; }
+            set { button.IconSize = value; }
+        }
+        
         protected override void OnRealized ()
         {
             base.OnRealized ();
-            button.Parent = this.Parent;
+            button.Parent = Parent;
             button.Realize ();
         }
         
@@ -119,35 +161,21 @@
         {
             base.OnExposeEvent (evnt);
             button.SendExpose (evnt);
-            
             Gtk.Style.PaintArrow (Style, GdkWindow, State, ShadowType.None, arrow_alloc, this, null,
                 ArrowType.Down, true, arrow_alloc.X, arrow_alloc.Y, arrow_alloc.Width, arrow_alloc.Height);
-            
             return true;
         }
         
-        protected override bool OnEnterNotifyEvent (EventCrossing evnt)
+        protected override void OnEntered ()
         {
             button.Relief = ReliefStyle.None;
-            return base.OnEnterNotifyEvent (evnt);
+            base.OnEntered ();
         }
         
-        protected override bool OnLeaveNotifyEvent (EventCrossing evnt)
+        protected override void OnLeft ()
         {
             button.Relief = relief;
-            return base.OnLeaveNotifyEvent (evnt);
-        }
-        
-        protected override bool OnButtonPressEvent (EventButton evnt)
-        {
-            ShowMenu ();
-            return true;
+            base.OnLeft ();
         }
-        
-        protected override void OnActivate ()
-        {
-            Action.Activate ();
-        }
-
     }
 }

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Makefile.am
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Makefile.am	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Makefile.am	Tue Apr  8 19:53:39 2008
@@ -52,6 +52,7 @@
 	Hyena.Query.Gui/StringQueryValueEntry.cs \
 	Hyena.Query.Gui/TimeSpanQueryValueEntry.cs \
 	Hyena.Widgets/ActionButton.cs \
+	Hyena.Widgets/ActionGroupButton.cs \
 	Hyena.Widgets/AnimatedBox.cs \
 	Hyena.Widgets/AnimatedHBox.cs \
 	Hyena.Widgets/AnimatedImage.cs \



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