~ubuntu-branches/ubuntu/natty/gnome-do/natty

« back to all changes in this revision

Viewing changes to Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/DoDockItem.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane, Daniel T Chen, Iain Lane, Mirco Bauer
  • Date: 2009-03-22 22:44:39 UTC
  • mfrom: (0.2.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20090322224439-0dndhbvyqz1u2iu2
[ Daniel T Chen ]
* New upstream release (LP: #344578).
  + Gnome Do causes keyboard keys to be remapped (LP: #308143)
  + Docky window too small when summoned (LP: #317381)
  + Minimize/Maximize does not work on all windows (LP: #317908)
  + Docky blocks drag and drop over large areas of the screen
    (LP: #318471)
  + Docky fails to autohide properly when changing themes
    (LP: #318672)
  + Paste via ctrl+v does not work in 1st pane (LP: #318922)
  + Autostart is in wrong assembly (LP: #319114)
  + Docky has no results list (LP: #319797)
  + Docky trash applet does not reflect current state
    (LP: #320621)
  + Docky panels splits into two when over filled (LP: #324648)
  + Docky ui division is inconsistent and confusing
    (LP: #324718)
  + poor performance with two screens (LP: #323294)
  + Docky trash applet doesn't check if trash exists
    (LP: #323453)
  + docky panel splits into two when overfilled (LP: #324648)
  + Docky's UI division is inconsistent and confusing
    (LP: #324718)
  + Do crashes when using a pastebin launcher with docky
    (LP: #325178)
  + Make docky aware of icon theme switch (LP: #328721)
  + Docky doesn't update icon status for some apps that minimize
    to system tray. (LP: #329120)
  + Docky does not work properly with pull-down window
    (LP: #334663)
  + sensitivity of zooming the icons in the dock isn't
    configurable (LP: #336214)
  + Regression: In 0.8.1, "Request attention" is no longer
    indicated (LP: #337594)
  + Clock's Calendar mode auto-hides when leaving the bounds of
    the original dock (LP: #337783)
  + gnome-do does not notice change of icon theme (LP: #204368)
  + Thumbnails are never displayed when files have spaces in
    their names (LP: #311551)
  + Open improperly escapes URLs. (LP: #317416)
  + Docky: Right-click dialog appears on wrong monitor
    (LP: #319062)
  + Dragging items off Docky possible in summon mode
    (LP: #319452)
  + Docky shows icon according to the filename (LP: #320892)
  + Mouse click inactive when Do(cky) is summoned (LP: #324937)
  + Docky trash don't have a right-click menu (LP: #317947)
  + Polish docky's window name labels (LP: #318487)
  + Docky: Scroll on window icon should switch between windows
    of that app (LP: #319805)
  + Docky does not preserve window stack (z?) order when
    switching apps by clicking on app icon (LP: #326661)
  + Docky window switching should be easier. (LP: #327079)
  + Color of indicators on Docky cannot be changed
    (LP: #332936)
  + Do's ResultWindow is using wrong text color (LP: #288771)
  + Docky won't unhide after rev 1053 (LP: #337113)
  + Do's icon label in Docky should be "GNOME Do" instead of
    "Summon GNOME Do" (LP: #338496)
* debian/control:
  + Add librsvg2-2.18-cil build-dep
* debian/patches/03_show_in_all_DEs
  + Drop; fixed in new upstream
* debian/gnome-do.1
  + Update for new version. 

[ Iain Lane ]
* Merge changes with Ubuntu Jaunty
* Autostart behaviour has been fixed upstream (Closes: #513741, #516194).
* debian/patches/10_application_search_path.dpatch: Add. Fix search path so
  that applications are properly indexed. Patch backported from upstream.
* debian/control: Add myself to Uploaders. 
* Really bump versioned dep on libgtk2.0-cil
* debian/control, debian/rules, debian/watch,
  debian/patches/00_remove_bundledlibs.dpatch, debian/README.source:
  Upstream source needs repackaging due to shipped copy of gmcs.exe

[ Mirco Bauer ]
* debian/rules:
  + Made get-orig-source target policy conform.
  + Use dh override targets instead of sequence injection.
* debian/control:
  + Bumped debhelper build-dep to >= 7.0.50
  + Bumped Standards-Version to 3.8.1 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// DoDockItem.cs
 
2
// 
 
3
// Copyright (C) 2008 GNOME Do
 
4
//
 
5
// This program is free software: you can redistribute it and/or modify
 
6
// it under the terms of the GNU General Public License as published by
 
7
// the Free Software Foundation, either version 3 of the License, or
 
8
// (at your option) any later version.
 
9
//
 
10
// This program is distributed in the hope that it will be useful,
 
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
// GNU General Public License for more details.
 
14
//
 
15
// You should have received a copy of the GNU General Public License
 
16
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
//
 
18
 
 
19
using System;
 
20
using System.Collections.Generic;
 
21
using System.Linq;
 
22
 
 
23
using Cairo;
 
24
using Gdk;
 
25
using Gtk;
 
26
 
 
27
using Mono.Unix;
 
28
 
 
29
using Do.Interface;
 
30
using Do.Platform;
 
31
using Do.Universe;
 
32
 
 
33
using Docky.Core;
 
34
using Docky.Interface.Menus;
 
35
using Docky.Interface.Painters;
 
36
using Docky.Utilities;
 
37
 
 
38
namespace Docky.Interface
 
39
{
 
40
        
 
41
        public class DoDockItem : AbstractDockItem, IRightClickable
 
42
        {
 
43
                const string DoIcon = "gnome-do";
 
44
                public const string EnableIcon = "gtk-apply";
 
45
                public const string DisableIcon = "gtk-remove";
 
46
                const string Text = "GNOME Do";
 
47
 
 
48
                HotSeatPainter hot_seat_painter;
 
49
                
 
50
                #region IDockItem implementation 
 
51
                
 
52
                public override ScalingType ScalingType {
 
53
                        get {
 
54
                                return ScalingType.HighLow;
 
55
                        }
 
56
                }
 
57
 
 
58
                
 
59
                protected override Pixbuf GetSurfacePixbuf (int size)
 
60
                {
 
61
                        return IconProvider.PixbufFromIconName (DoIcon, size);
 
62
                }
 
63
 
 
64
                
 
65
                public override void Clicked (uint button, ModifierType state, Gdk.Point position)
 
66
                {
 
67
                        if (button == 1)
 
68
                                Services.Windowing.SummonMainWindow ();
 
69
                        if (button == 2)
 
70
                                hot_seat_painter.Show ();
 
71
                }
 
72
                
 
73
                #endregion 
 
74
                
 
75
                public DoDockItem () : base ()
 
76
                {
 
77
                        hot_seat_painter = new HotSeatPainter ();
 
78
                        DockServices.PainterService.RegisterPainter (hot_seat_painter);
 
79
                        
 
80
                        SetText (Catalog.GetString (Text));
 
81
                }
 
82
 
 
83
                #region IDisposable implementation 
 
84
                
 
85
                #endregion 
 
86
                
 
87
                public override bool Equals (AbstractDockItem other)
 
88
                {
 
89
                        return other is DoDockItem;
 
90
                }
 
91
 
 
92
                #region IRightClickable implementation 
 
93
                
 
94
                public event EventHandler RemoveClicked;
 
95
                
 
96
                public IEnumerable<AbstractMenuArgs> GetMenuItems ()
 
97
                {
 
98
                        yield return new SeparatorMenuButtonArgs ();
 
99
                        
 
100
                        yield return new SimpleMenuButtonArgs (() => DockPreferences.AutoHide = !DockPreferences.AutoHide, 
 
101
                                                               Catalog.GetString ("Automatically Hide"), DockPreferences.AutoHide ? EnableIcon : DisableIcon).AsDark ();
 
102
 
 
103
                        if (!DockPreferences.AutoHide)
 
104
                                yield return new SimpleMenuButtonArgs (() => DockPreferences.AllowOverlap = !DockPreferences.AllowOverlap,
 
105
                                                                       Catalog.GetString ("Allow Window Overlap"), DockPreferences.AllowOverlap ? EnableIcon : DisableIcon).AsDark ();
 
106
                        
 
107
                        yield return new SimpleMenuButtonArgs (() => DockPreferences.IndicateMultipleWindows = !DockPreferences.IndicateMultipleWindows, 
 
108
                                                               Catalog.GetString ("Advanced Indicators"), DockPreferences.IndicateMultipleWindows ? EnableIcon : DisableIcon).AsDark ();
 
109
                        
 
110
                        yield return new SimpleMenuButtonArgs (() => DockPreferences.ZoomEnabled = !DockPreferences.ZoomEnabled, 
 
111
                                                               Catalog.GetString ("Zoom Icons"), DockPreferences.ZoomEnabled ? EnableIcon : DisableIcon).AsDark ();
 
112
                        
 
113
//                      if (DockPreferences.ZoomEnabled) {
 
114
//                              yield return new SeparatorMenuButtonArgs ();
 
115
//                              yield return new WidgetMenuArgs (BuildScaleWidget ());
 
116
//                      }
 
117
                        
 
118
                        if (Gdk.Screen.Default.NMonitors > 1)
 
119
                                yield return new SimpleMenuButtonArgs (() => DockPreferences.Monitor++,
 
120
                                                                       Catalog.GetString ("Switch Monitors"), "display").AsDark ();
 
121
                        
 
122
                        yield return new SeparatorMenuButtonArgs ();
 
123
                        
 
124
                        foreach (AbstractDockletItem dockitem in DockServices.DockletService.Docklets) {
 
125
                                yield return new ToggleDockletMenuButtonArgs (dockitem).AsDark ();
 
126
                        }
 
127
                        
 
128
                        foreach (IRunnableItem item in Services.Application.MainMenuItems) {
 
129
                                yield return new SeparatorMenuButtonArgs ();
 
130
                                yield return new RunnableMenuButtonArgs (item);
 
131
                        }
 
132
                }
 
133
 
 
134
                void HandleValueChanged(object sender, EventArgs e)
 
135
                {
 
136
                        if (!(sender is HScale)) return;
 
137
                        
 
138
                        HScale scale = sender as HScale;
 
139
                        DockPreferences.ZoomPercent = scale.Value;
 
140
                }
 
141
                
 
142
                #endregion 
 
143
                
 
144
                Gtk.HScale BuildScaleWidget ()
 
145
                {
 
146
                        Gtk.HScale hscale = new Gtk.HScale (1.1, 4, .1);
 
147
                        hscale.Value = DockPreferences.ZoomPercent;
 
148
                        hscale.Name = "Zoom";
 
149
                        hscale.CanFocus = false;
 
150
                        hscale.FormatValue +=HandleFormatValue; 
 
151
                        hscale.ModifyFg (StateType.Normal, new Gdk.Color (byte.MaxValue, byte.MaxValue, byte.MaxValue));
 
152
                        hscale.ValueChanged +=HandleValueChanged; 
 
153
                        return hscale;
 
154
                }
 
155
 
 
156
                void HandleFormatValue(object o, FormatValueArgs args)
 
157
                {
 
158
                        args.RetVal = string.Format ("{0}%", Math.Round (args.Value * 100));
 
159
                }
 
160
        }
 
161
}