Do

Merge lp:~jassmith/do/DockyRightClickCleanup into lp:do

Proposed by Jason Smith
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jassmith/do/DockyRightClickCleanup
Merge into: lp:do
Diff against target: None lines
To merge this branch: bzr merge lp:~jassmith/do/DockyRightClickCleanup
Reviewer Review Type Date Requested Status
Alex Launi (community) Approve
Review via email: mp+4048@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alex Launi (alexlauni) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Do.Interface.Linux.Docky/Do.Interface.Linux.Docky.mdp'
2--- Do.Interface.Linux.Docky/Do.Interface.Linux.Docky.mdp 2009-02-12 15:42:08 +0000
3+++ Do.Interface.Linux.Docky/Do.Interface.Linux.Docky.mdp 2009-03-01 07:35:08 +0000
4@@ -89,6 +89,8 @@
5 <File name="src/Docky.Core/Docky.Core.Default/DockletService.cs" subtype="Code" buildaction="Compile" />
6 <File name="src/Docky.Interface/Docky.Interface.Menus/ToggleDockletMenuButtonArgs.cs" subtype="Code" buildaction="Compile" />
7 <File name="src/Docky.Interface/Docky.Interface.Painters/AbstractIntegratedPainter.cs" subtype="Code" buildaction="Compile" />
8+ <File name="src/Docky.Interface/Docky.Interface.Menus/AbstractMenuArgs.cs" subtype="Code" buildaction="Compile" />
9+ <File name="src/Docky.Interface/Docky.Interface.Menus/WidgetMenuArgs.cs" subtype="Code" buildaction="Compile" />
10 </Contents>
11 <References>
12 <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
13
14=== modified file 'Do.Interface.Linux.Docky/Makefile.am'
15--- Do.Interface.Linux.Docky/Makefile.am 2009-02-13 00:19:29 +0000
16+++ Do.Interface.Linux.Docky/Makefile.am 2009-03-01 07:35:08 +0000
17@@ -35,6 +35,7 @@
18 src/Docky.Interface/Docky.Interface.Items/SeparatorItem.cs \
19 src/Docky.Interface/Docky.Interface.Items/TrashDockItem.cs \
20 src/Docky.Interface/Docky.Interface.Items/WnckDockItem.cs \
21+ src/Docky.Interface/Docky.Interface.Menus/AbstractMenuArgs.cs \
22 src/Docky.Interface/Docky.Interface.Menus/AbstractMenuButtonArgs.cs \
23 src/Docky.Interface/Docky.Interface.Menus/DockItemMenu.cs \
24 src/Docky.Interface/Docky.Interface.Menus/DockPopupMenu.cs \
25@@ -43,6 +44,7 @@
26 src/Docky.Interface/Docky.Interface.Menus/SimpleMenuButtonArgs.cs \
27 src/Docky.Interface/Docky.Interface.Menus/SeparatorMenuButtonArgs.cs \
28 src/Docky.Interface/Docky.Interface.Menus/ToggleDockletMenuButtonArgs.cs \
29+ src/Docky.Interface/Docky.Interface.Menus/WidgetMenuArgs.cs \
30 src/Docky.Interface/Docky.Interface.Menus/WindowMenuButtonArgs.cs \
31 src/Docky.Interface/DockState.cs \
32 src/Docky.Interface/DockWindow.cs \
33
34=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs'
35--- Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs 2009-02-27 09:02:10 +0000
36+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs 2009-03-01 07:52:25 +0000
37@@ -252,6 +252,7 @@
38 {
39 DockServices.ItemsService.DockItemsChanged += OnDockItemsChanged;
40 DockServices.ItemsService.ItemNeedsUpdate += HandleItemNeedsUpdate;
41+ DockPreferences.IconSizeChanged += HandleIconSizeChanged;
42
43 PopupMenu.Hidden += OnDockItemMenuHidden;
44 PopupMenu.Shown += OnDockItemMenuShown;
45@@ -271,6 +272,7 @@
46 {
47 DockServices.ItemsService.DockItemsChanged -= OnDockItemsChanged;
48 DockServices.ItemsService.ItemNeedsUpdate -= HandleItemNeedsUpdate;
49+ DockPreferences.IconSizeChanged -= HandleIconSizeChanged;
50
51 PopupMenu.Hidden -= OnDockItemMenuHidden;
52 PopupMenu.Shown -= OnDockItemMenuShown;
53@@ -318,6 +320,11 @@
54 return false;
55 });
56 }
57+
58+ void HandleIconSizeChanged()
59+ {
60+ AnimatedDraw ();
61+ }
62
63 void HandlePaintNeeded (object sender, PaintNeededArgs args)
64 {
65
66=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs'
67--- Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs 2009-02-27 08:46:31 +0000
68+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs 2009-03-01 04:24:20 +0000
69@@ -147,7 +147,7 @@
70 double offset = 0;
71 // we never hide in these conditions
72 if (!DockPreferences.AutoHide || drag_resizing || PainterOpacity == 1) {
73- if ((DateTime.UtcNow - FirstRenderTime) > SummonTime)
74+ if ((RenderTime - FirstRenderTime) > SummonTime)
75 return 0;
76 offset = 1 - Math.Min (1, (DateTime.UtcNow - FirstRenderTime).TotalMilliseconds / SummonTime.TotalMilliseconds);
77 return (int) (offset * PositionProvider.DockHeight * 1.5);
78
79=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ApplicationDockItem.cs'
80--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ApplicationDockItem.cs 2009-02-27 06:40:03 +0000
81+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ApplicationDockItem.cs 2009-03-01 04:24:20 +0000
82@@ -299,7 +299,7 @@
83 return Applications.Any (app => (other as ApplicationDockItem).Applications.Contains (app));
84 }
85
86- public IEnumerable<AbstractMenuButtonArgs> GetMenuItems ()
87+ public IEnumerable<AbstractMenuArgs> GetMenuItems ()
88 {
89 foreach (Wnck.Window window in VisibleWindows)
90 yield return new WindowMenuButtonArgs (window, window.Name, WindowIcon);
91
92=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/DoDockItem.cs'
93--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/DoDockItem.cs 2009-02-17 21:13:43 +0000
94+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/DoDockItem.cs 2009-03-01 07:47:37 +0000
95@@ -93,7 +93,7 @@
96
97 public event EventHandler RemoveClicked;
98
99- public IEnumerable<AbstractMenuButtonArgs> GetMenuItems ()
100+ public IEnumerable<AbstractMenuArgs> GetMenuItems ()
101 {
102 yield return new SimpleMenuButtonArgs (() => DockPreferences.AutoHide = !DockPreferences.AutoHide,
103 Catalog.GetString ("Automatically Hide"), DockPreferences.AutoHide ? EnableIcon : DisableIcon);
104@@ -108,6 +108,9 @@
105 yield return new SimpleMenuButtonArgs (() => DockPreferences.ZoomEnabled = !DockPreferences.ZoomEnabled,
106 Catalog.GetString ("Zoom Icons"), DockPreferences.ZoomEnabled ? EnableIcon : DisableIcon);
107
108+ if (DockPreferences.ZoomEnabled)
109+ yield return new WidgetMenuArgs (BuildScaleWidget ());
110+
111 if (Gdk.Screen.Default.NMonitors > 1)
112 yield return new SimpleMenuButtonArgs (() => DockPreferences.Monitor++,
113 Catalog.GetString ("Switch Monitors"), "display");
114@@ -124,8 +127,32 @@
115 yield return new RunnableMenuButtonArgs (item);
116 }
117 }
118+
119+ void HandleValueChanged(object sender, EventArgs e)
120+ {
121+ if (!(sender is HScale)) return;
122+
123+ HScale scale = sender as HScale;
124+ DockPreferences.ZoomPercent = scale.Value;
125+ }
126
127 #endregion
128
129+ Gtk.HScale BuildScaleWidget ()
130+ {
131+ Gtk.HScale hscale = new Gtk.HScale (1.1, 4, .1);
132+ hscale.Value = DockPreferences.ZoomPercent;
133+ hscale.Name = "Zoom";
134+ hscale.CanFocus = false;
135+ hscale.FormatValue +=HandleFormatValue;
136+ hscale.ModifyFg (StateType.Normal, new Gdk.Color (byte.MaxValue, byte.MaxValue, byte.MaxValue));
137+ hscale.ValueChanged +=HandleValueChanged;
138+ return hscale;
139+ }
140+
141+ void HandleFormatValue(object o, FormatValueArgs args)
142+ {
143+ args.RetVal = string.Format ("{0}%", args.Value * 100);
144+ }
145 }
146 }
147
148=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ItemDockItem.cs'
149--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ItemDockItem.cs 2009-02-27 06:40:03 +0000
150+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ItemDockItem.cs 2009-03-01 04:24:20 +0000
151@@ -277,7 +277,7 @@
152
153 #region IRightClickable implementation
154
155- public IEnumerable<AbstractMenuButtonArgs> GetMenuItems ()
156+ public IEnumerable<AbstractMenuArgs> GetMenuItems ()
157 {
158 bool hasApps = HasVisibleApps;
159
160
161=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/TrashDockItem.cs'
162--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/TrashDockItem.cs 2009-02-27 09:54:58 +0000
163+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/TrashDockItem.cs 2009-03-01 04:24:20 +0000
164@@ -143,7 +143,7 @@
165
166 public event EventHandler RemoveClicked;
167
168- public IEnumerable<Menus.AbstractMenuButtonArgs> GetMenuItems ()
169+ public IEnumerable<Menus.AbstractMenuArgs> GetMenuItems ()
170 {
171 yield return new Docky.Interface.Menus.SimpleMenuButtonArgs (() => Services.Environment.OpenUrl ("trash://"),
172 Catalog.GetString ("Open Trash"), TrashFullIcon);
173
174=== added file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/AbstractMenuArgs.cs'
175--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/AbstractMenuArgs.cs 1970-01-01 00:00:00 +0000
176+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/AbstractMenuArgs.cs 2009-03-01 08:00:40 +0000
177@@ -0,0 +1,51 @@
178+//
179+// Copyright (C) 2009 GNOME Do
180+//
181+// This program is free software: you can redistribute it and/or modify
182+// it under the terms of the GNU General Public License as published by
183+// the Free Software Foundation, either version 3 of the License, or
184+// (at your option) any later version.
185+//
186+// This program is distributed in the hope that it will be useful,
187+// but WITHOUT ANY WARRANTY; without even the implied warranty of
188+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
189+// GNU General Public License for more details.
190+//
191+// You should have received a copy of the GNU General Public License
192+// along with this program. If not, see <http://www.gnu.org/licenses/>.
193+//
194+
195+using System;
196+using System.Collections.Generic;
197+using System.Linq;
198+
199+using Gtk;
200+
201+namespace Docky.Interface.Menus
202+{
203+
204+
205+ public abstract class AbstractMenuArgs : IDisposable
206+ {
207+ public event EventHandler Activated;
208+
209+ public abstract Gtk.Widget Widget { get; }
210+
211+ public AbstractMenuArgs()
212+ {
213+
214+ }
215+
216+ protected void OnActivated ()
217+ {
218+ if (Activated != null)
219+ Activated (this, EventArgs.Empty);
220+ }
221+
222+ #region IDisposable implementation
223+ public virtual void Dispose ()
224+ {
225+ }
226+ #endregion
227+}
228+}
229
230=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/AbstractMenuButtonArgs.cs'
231--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/AbstractMenuButtonArgs.cs 2009-02-11 08:14:54 +0000
232+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/AbstractMenuButtonArgs.cs 2009-03-01 07:35:08 +0000
233@@ -17,46 +17,86 @@
234 //
235
236 using System;
237+
238+using Gtk;
239 using Mono.Unix;
240
241+using Do.Interface;
242+using Do.Interface.CairoUtils;
243+using Do.Platform;
244+
245 namespace Docky.Interface.Menus
246 {
247- public abstract class AbstractMenuButtonArgs
248+ public abstract class AbstractMenuButtonArgs : AbstractMenuArgs
249 {
250- const int MaxDescriptionCharacters = 50;
251+ Gtk.Widget widget;
252
253- public EventHandler Handler {
254+ public override Gtk.Widget Widget {
255 get {
256- return (sender, e) => Action ();
257+ if (widget == null)
258+ widget = BuildWidget ();
259+ return widget;
260 }
261 }
262
263- public string Description {
264- get; protected set;
265- }
266-
267- public string Icon {
268- get; protected set;
269- }
270-
271- public bool Sensitive {
272- get; protected set;
273- }
274+ protected virtual string Description { get; set; }
275+
276+ protected virtual string Icon { get; set; }
277
278 public AbstractMenuButtonArgs ()
279 {
280- Description = "";
281- Icon = "";
282- Sensitive = true;
283+
284 }
285
286- public AbstractMenuButtonArgs (string description, string icon, bool sensitive)
287+ public AbstractMenuButtonArgs (string description, string icon)
288 {
289 Description = GLib.Markup.EscapeText (Catalog.GetString (description));
290 Icon = icon;
291- Sensitive = sensitive;
292+ }
293+
294+ Gtk.Button BuildWidget ()
295+ {
296+ HBox hbox = new HBox ();
297+ Label label = new Label ();
298+ label.Markup = "<span color=\"#ffffff\"><b>" + Description + "</b></span>";
299+ label.ModifyFg (StateType.Normal, new Gdk.Color (byte.MaxValue, byte.MaxValue, byte.MaxValue));
300+ label.ModifyText (StateType.Normal, new Gdk.Color (byte.MaxValue, byte.MaxValue, byte.MaxValue));
301+ label.Xalign = 0f;
302+ label.Ellipsize = Pango.EllipsizeMode.End;
303+ label.Ypad = 0;
304+
305+ Gtk.Image image;
306+ using (Gdk.Pixbuf pbuf = IconProvider.PixbufFromIconName (Icon, 16)) {
307+ image = new Gtk.Image (pbuf);
308+ }
309+
310+ hbox.PackStart (image, false, false, 0);
311+ hbox.PackStart (label, true, true, 2);
312+
313+ Gtk.Button button = new Gtk.Button (hbox);
314+
315+ button.Relief = ReliefStyle.None;
316+ button.CanFocus = false;
317+ button.BorderWidth = 0;
318+
319+ button.ModifyBg (StateType.Prelight, new Gdk.Color ((byte) (byte.MaxValue * 0.25),
320+ (byte) (byte.MaxValue * 0.25),
321+ (byte) (byte.MaxValue * 0.25)));
322+
323+ button.Clicked += (sender, e) => Action ();
324+ button.Clicked += (sender, e) => base.OnActivated ();
325+ button.ShowAll ();
326+
327+ return button;
328 }
329
330 public abstract void Action ();
331+
332+ public override void Dispose ()
333+ {
334+ Widget.Destroy ();
335+ base.Dispose ();
336+ }
337+
338 }
339 }
340
341=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/DockItemMenu.cs'
342--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/DockItemMenu.cs 2009-02-14 20:53:01 +0000
343+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/DockItemMenu.cs 2009-03-01 07:35:08 +0000
344@@ -36,79 +36,20 @@
345
346 public class DockItemMenu : DockPopupMenu
347 {
348- class CustomSeparator : HSeparator
349- {
350- public CustomSeparator () : base ()
351- {
352- HeightRequest = 3;
353- }
354-
355- protected override bool OnExposeEvent (Gdk.EventExpose evnt)
356- {
357- using (Context cr = CairoHelper.Create (GdkWindow)) {
358- cr.Rectangle (evnt.Area.X, evnt.Area.Y + 1, evnt.Area.Width, 1);
359- cr.Color = new Cairo.Color (.8, .8, .8, .7);
360- cr.Fill ();
361-
362- }
363- return true;
364- }
365-
366- }
367+ IEnumerable<AbstractMenuArgs> current_args;
368
369 public DockItemMenu() : base ()
370 {
371 }
372
373- public override void PopUp (IEnumerable<AbstractMenuButtonArgs> args, int x, int y)
374+ public override void PopUp (IEnumerable<AbstractMenuArgs> args, int x, int y)
375 {
376- foreach (Gtk.Widget child in Container.AllChildren) {
377- Container.Remove (child);
378- child.Dispose ();
379- }
380+ current_args = args;
381
382- foreach (AbstractMenuButtonArgs arg in args) {
383- if (arg is SeparatorMenuButtonArgs) {
384- Container.PackStart (new CustomSeparator ());
385- continue;
386- }
387-
388- HBox hbox = new HBox ();
389- Label label = new Label ();
390- if (arg.Sensitive)
391- label.Markup = "<span color=\"#ffffff\"><b>" + arg.Description + "</b></span>";
392- else
393- label.Markup = "<span color=\"#888888\"><b>" + arg.Description + "</b></span>";
394- label.ModifyFg (StateType.Normal, new Gdk.Color (byte.MaxValue, byte.MaxValue, byte.MaxValue));
395- label.ModifyText (StateType.Normal, new Gdk.Color (byte.MaxValue, byte.MaxValue, byte.MaxValue));
396- label.Xalign = 0f;
397- label.Ellipsize = Pango.EllipsizeMode.End;
398- label.Ypad = 0;
399-
400- Gtk.Image image;
401- using (Gdk.Pixbuf pbuf = IconProvider.PixbufFromIconName (arg.Icon, 16)) {
402- image = new Gtk.Image (pbuf);
403- }
404-
405- hbox.PackStart (image, false, false, 0);
406- hbox.PackStart (label, true, true, 2);
407-
408- Gtk.Button button = new Button (hbox);
409- if (arg is WindowMenuButtonArgs)
410- button.TooltipText = arg.Description;
411-
412- button.Clicked += arg.Handler;
413- button.Clicked += OnButtonClicked;
414-
415- button.Relief = ReliefStyle.None;
416- button.CanFocus = false;
417- button.Sensitive = arg.Sensitive;
418- button.BorderWidth = 0;
419-
420- button.ModifyBg (StateType.Prelight, new Gdk.Color ((byte) (byte.MaxValue * 0.25),
421- (byte) (byte.MaxValue * 0.25),
422- (byte) (byte.MaxValue * 0.25)));
423- Container.PackStart (button, false, false, 0);
424+ foreach (AbstractMenuArgs arg in args) {
425+ Container.PackStart (arg.Widget, false, false, 0);
426+ arg.Activated += OnButtonClicked;
427+ arg.Widget.ShowAll ();
428 }
429 ShowAll ();
430
431@@ -117,12 +58,21 @@
432
433 void OnButtonClicked (object o, EventArgs args)
434 {
435- foreach (Gtk.Widget widget in Container.AllChildren) {
436- if (!(widget is Gtk.Button))
437- continue;
438- (widget as Gtk.Button).Activated -= OnButtonClicked;
439- }
440 Hide ();
441 }
442+
443+ protected override void OnHidden ()
444+ {
445+ foreach (Gtk.Widget widget in Container.Children)
446+ Container.Remove (widget);
447+
448+ foreach (AbstractMenuArgs arg in current_args) {
449+ arg.Activated -= OnButtonClicked;
450+ arg.Dispose ();
451+ }
452+
453+ base.OnHidden ();
454+ }
455+
456 }
457 }
458
459=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/DockPopupMenu.cs'
460--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/DockPopupMenu.cs 2009-02-23 04:38:44 +0000
461+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/DockPopupMenu.cs 2009-03-01 04:24:20 +0000
462@@ -100,7 +100,7 @@
463 }
464
465
466- public virtual void PopUp (IEnumerable<AbstractMenuButtonArgs> args, int x, int y)
467+ public virtual void PopUp (IEnumerable<AbstractMenuArgs> args, int x, int y)
468 {
469 vertical_offset = horizontal_offset = 0;
470 ShowAll ();
471
472=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/LaunchMenuButtonArgs.cs'
473--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/LaunchMenuButtonArgs.cs 2009-01-20 00:34:52 +0000
474+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/LaunchMenuButtonArgs.cs 2009-03-01 04:24:20 +0000
475@@ -30,7 +30,7 @@
476 Act action;
477 Item item;
478
479- public LaunchMenuButtonArgs (Act action, Item item, string description, string icon) : base (description, icon, true)
480+ public LaunchMenuButtonArgs (Act action, Item item, string description, string icon) : base (description, icon)
481 {
482 this.action = action;
483 this.item = item;
484
485=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/RunnableMenuButtonArgs.cs'
486--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/RunnableMenuButtonArgs.cs 2009-01-20 00:34:52 +0000
487+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/RunnableMenuButtonArgs.cs 2009-03-01 04:24:20 +0000
488@@ -28,7 +28,7 @@
489 {
490 IRunnableItem runnable;
491
492- public RunnableMenuButtonArgs(IRunnableItem item) : base (item.Name, item.Icon, true)
493+ public RunnableMenuButtonArgs(IRunnableItem item) : base (item.Name, item.Icon)
494 {
495 runnable = item;
496 }
497
498=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/SeparatorMenuButtonArgs.cs'
499--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/SeparatorMenuButtonArgs.cs 2009-01-20 00:34:52 +0000
500+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/SeparatorMenuButtonArgs.cs 2009-03-01 07:35:08 +0000
501@@ -18,17 +18,37 @@
502
503 using System;
504
505+using Cairo;
506+using Gdk;
507+using Gtk;
508+
509 namespace Docky.Interface.Menus
510 {
511- public class SeparatorMenuButtonArgs : AbstractMenuButtonArgs
512+ public class SeparatorMenuButtonArgs : WidgetMenuArgs
513 {
514- public SeparatorMenuButtonArgs () : base ("Separator", null, true)
515- {
516- }
517-
518- public override void Action ()
519- {
520+ class CustomSeparator : HSeparator
521+ {
522+ public CustomSeparator () : base ()
523+ {
524+ HeightRequest = 3;
525+ }
526
527- }
528+ protected override bool OnExposeEvent (Gdk.EventExpose evnt)
529+ {
530+ using (Context cr = CairoHelper.Create (GdkWindow)) {
531+ cr.Rectangle (evnt.Area.X, evnt.Area.Y + 1, evnt.Area.Width, 1);
532+ cr.Color = new Cairo.Color (.8, .8, .8, .7);
533+ cr.Fill ();
534+
535+ }
536+ return true;
537+ }
538+
539+ }
540+
541+ public SeparatorMenuButtonArgs () : base (new CustomSeparator ())
542+ {
543+ }
544+
545 }
546 }
547
548=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/SimpleMenuButtonArgs.cs'
549--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/SimpleMenuButtonArgs.cs 2009-01-20 00:34:52 +0000
550+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/SimpleMenuButtonArgs.cs 2009-03-01 04:24:20 +0000
551@@ -26,7 +26,7 @@
552 {
553 Action action;
554
555- public SimpleMenuButtonArgs (Action action, string description, string icon) : base (description, icon, true)
556+ public SimpleMenuButtonArgs (Action action, string description, string icon) : base (description, icon)
557 {
558 this.action = action;
559 }
560
561=== added file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/WidgetMenuArgs.cs'
562--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/WidgetMenuArgs.cs 1970-01-01 00:00:00 +0000
563+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/WidgetMenuArgs.cs 2009-03-01 08:00:40 +0000
564@@ -0,0 +1,51 @@
565+//
566+// Copyright (C) 2009 GNOME Do
567+//
568+// This program is free software: you can redistribute it and/or modify
569+// it under the terms of the GNU General Public License as published by
570+// the Free Software Foundation, either version 3 of the License, or
571+// (at your option) any later version.
572+//
573+// This program is distributed in the hope that it will be useful,
574+// but WITHOUT ANY WARRANTY; without even the implied warranty of
575+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
576+// GNU General Public License for more details.
577+//
578+// You should have received a copy of the GNU General Public License
579+// along with this program. If not, see <http://www.gnu.org/licenses/>.
580+//
581+
582+using System;
583+
584+using Cairo;
585+using Gdk;
586+using Gtk;
587+
588+namespace Docky.Interface.Menus
589+{
590+
591+
592+ public class WidgetMenuArgs : AbstractMenuArgs
593+ {
594+ Gtk.Widget widget;
595+
596+ public override Widget Widget {
597+ get {
598+ return widget;
599+ }
600+ }
601+
602+
603+ public WidgetMenuArgs (Gtk.Widget widget) : base ()
604+ {
605+ this.widget = widget;
606+ }
607+
608+ public override void Dispose ()
609+ {
610+ widget.Destroy ();
611+ base.Dispose ();
612+ }
613+
614+ }
615+}
616
617=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/WindowMenuButtonArgs.cs'
618--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/WindowMenuButtonArgs.cs 2009-01-20 00:34:52 +0000
619+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Menus/WindowMenuButtonArgs.cs 2009-03-01 04:24:20 +0000
620@@ -30,7 +30,7 @@
621 {
622 Window window;
623
624- public WindowMenuButtonArgs (Window window, string description, string icon) : base (description, icon, true)
625+ public WindowMenuButtonArgs (Window window, string description, string icon) : base (description, icon)
626 {
627 this.window = window;
628 }
629
630=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/IRightClickable.cs'
631--- Do.Interface.Linux.Docky/src/Docky.Interface/IRightClickable.cs 2009-01-20 00:34:52 +0000
632+++ Do.Interface.Linux.Docky/src/Docky.Interface/IRightClickable.cs 2009-03-01 04:24:20 +0000
633@@ -31,7 +31,7 @@
634 /// <returns>
635 /// A <see cref="IEnumerable"/>
636 /// </returns>
637- IEnumerable<AbstractMenuButtonArgs> GetMenuItems ();
638+ IEnumerable<AbstractMenuArgs> GetMenuItems ();
639
640 /// <summary>
641 /// Lets the dock item provider know that the remove button was clicked
642
643=== modified file 'Do.Interface.Linux.Docky/src/Docky.Utilities/DockPreferences.cs'
644--- Do.Interface.Linux.Docky/src/Docky.Utilities/DockPreferences.cs 2009-02-26 07:55:16 +0000
645+++ Do.Interface.Linux.Docky/src/Docky.Utilities/DockPreferences.cs 2009-03-01 07:35:08 +0000
646@@ -48,7 +48,7 @@
647 get { return 350; }
648 }
649
650- static int zoom_size = prefs.Get ("ZoomSize", 300);
651+ static int zoom_size = prefs.Get ("ZoomSize", 330);
652 public static int ZoomSize {
653 get { return (int) (zoom_size * (IconSize / (double) DefaultIconSize)); }
654 set {