Do

Merge lp:~psybers/do/painters into lp:do

Proposed by Robert Dyer
Status: Merged
Merged at revision: not available
Proposed branch: lp:~psybers/do/painters
Merge into: lp:do
Diff against target: None lines
To merge this branch: bzr merge lp:~psybers/do/painters
Reviewer Review Type Date Requested Status
Do Core Team Pending
Review via email: mp+7132@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert Dyer (psybers) wrote :

DockArea now set's its width to the size of the Painter. The summon painter set's its width to the max of the dock size or 300 (similar to before). Calendar painter has a fixed width. The cursor will only interrupt a painter based on the Y position.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs'
2--- Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs 2009-06-05 19:17:54 +0000
3+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs 2009-06-05 21:48:34 +0000
4@@ -157,7 +157,7 @@
5
6 DockAnimationState AnimationState { get; set; }
7
8- ItemPositionProvider PositionProvider { get; set; }
9+ public static ItemPositionProvider PositionProvider { get; protected set; }
10
11 new DockItemMenu PopupMenu { get; set; }
12
13@@ -495,7 +495,6 @@
14
15 if (tmp) {
16 dockRegion.Inflate (0, (int) (IconSize * (DockPreferences.ZoomPercent - 1)) + 22);
17- CursorIsOverDockArea = dockRegion.Contains (Cursor);
18 } else {
19 if (IsHidden) {
20 switch (DockPreferences.Orientation) {
21@@ -508,9 +507,12 @@
22 break;
23 }
24 }
25-
26+ }
27+
28+ if (PainterOverlayVisible)
29+ CursorIsOverDockArea = dockRegion.Contains (new Gdk.Point (dockRegion.X, Cursor.Y));
30+ else
31 CursorIsOverDockArea = dockRegion.Contains (Cursor);
32- }
33
34 if (CursorIsOverDockArea != tmp) {
35 ResetCursorTimer ();
36
37=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs'
38--- Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs 2009-06-01 20:37:58 +0000
39+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs 2009-06-05 21:34:32 +0000
40@@ -670,16 +670,20 @@
41 else
42 rect = PositionProvider.DockArea (ZoomIn, Cursor);
43
44- int minSize = 10 * rect.Height;
45+ int minWidth = 10 * rect.Height;
46+ int maxWidth = LayoutUtils.MonitorGeometry ().Width;
47+ int dockWidth = 0;
48
49 if (PainterOverlayVisible && Painter != null) {
50- minSize = Math.Max (Painter.MinimumWidth, minSize);
51+ dockWidth = Math.Min (Painter.Width, maxWidth);
52 } else if (!PainterOverlayVisible && LastPainter != null) {
53- minSize = Math.Max (LastPainter.MinimumWidth, minSize);
54+ dockWidth = Math.Min (LastPainter.Width, maxWidth);
55+ } else {
56+ dockWidth = Math.Max (rect.Width, minWidth);
57 }
58
59- if (rect.Width < minSize && DockIconOpacity < 1) {
60- int difference = minSize - rect.Width;
61+ if (rect.Width != dockWidth && DockIconOpacity < 1) {
62+ int difference = dockWidth - rect.Width;
63 int alpha = (int) (difference * PainterOpacity);
64 rect.X -= alpha / 2;
65 rect.Width += alpha;
66
67=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/AbstractIntegratedPainter.cs'
68--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/AbstractIntegratedPainter.cs 2009-06-05 19:19:38 +0000
69+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/AbstractIntegratedPainter.cs 2009-06-05 21:34:32 +0000
70@@ -40,7 +40,7 @@
71 Surface icon_surface, buffer;
72 AbstractDockItem dock_item;
73
74- protected abstract int Width { get; }
75+ protected abstract int PainterWidth { get; }
76
77 protected virtual bool NeedsRepaint {
78 get { return false; }
79@@ -64,7 +64,7 @@
80 public void Clicked (Gdk.Rectangle dockArea, Gdk.Point cursor)
81 {
82 Gdk.Rectangle paintArea = new Gdk.Rectangle (0, 0, Width, dockArea.Height);
83- Gdk.Point paintAreaCursor = new Gdk.Point (cursor.X - dockArea.Left - DockPreferences.FullIconSize - BorderSize - (dockArea.Width - MinimumWidth) / 2,
84+ Gdk.Point paintAreaCursor = new Gdk.Point (cursor.X - dockArea.Left - DockPreferences.FullIconSize - BorderSize,
85 cursor.Y - dockArea.Top);
86
87 if (!paintArea.Contains (paintAreaCursor) || ReceiveClick (paintArea, paintAreaCursor))
88@@ -79,9 +79,9 @@
89 get { return true; }
90 }
91
92- public int MinimumWidth {
93+ public int Width {
94 get {
95- return Width + DockPreferences.FullIconSize + 2 * BorderSize;
96+ return PainterWidth + DockPreferences.FullIconSize + 2 * BorderSize;
97 }
98 }
99
100@@ -119,9 +119,9 @@
101 if (buffer != null)
102 buffer.Destroy ();
103
104- buffer = cr.Target.CreateSimilar (cr.Target.Content, Width, dockArea.Height);
105+ buffer = cr.Target.CreateSimilar (cr.Target.Content, PainterWidth, dockArea.Height);
106 using (Cairo.Context context = new Cairo.Context (buffer)) {
107- PaintArea (context, new Gdk.Rectangle (0, 0, Width, dockArea.Height));
108+ PaintArea (context, new Gdk.Rectangle (0, 0, PainterWidth, dockArea.Height));
109 }
110 buffer_height = dockArea.Height;
111 }
112@@ -132,7 +132,6 @@
113 cr.Clip ();
114
115 int x = dockArea.X + DockPreferences.FullIconSize + BorderSize;
116- x = x + (dockArea.Width - MinimumWidth) / 2;
117 buffer.Show (cr, x, dockArea.Y);
118 cr.ResetClip ();
119 }
120
121=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/CalendarPainter.cs'
122--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/CalendarPainter.cs 2009-05-21 20:12:02 +0000
123+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/CalendarPainter.cs 2009-06-05 21:34:32 +0000
124@@ -64,7 +64,7 @@
125
126 #region IDockPainter implementation
127
128- protected override int Width {
129+ protected override int PainterWidth {
130 get {
131 return 670;
132 }
133
134=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/HotSeatPainter.cs'
135--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/HotSeatPainter.cs 2009-02-22 06:58:26 +0000
136+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/HotSeatPainter.cs 2009-06-05 21:34:32 +0000
137@@ -56,7 +56,7 @@
138 get { return true; }
139 }
140
141- public int MinimumWidth {
142+ public int Width {
143 get { return 0; }
144 }
145
146
147=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/SummonModeRenderer.cs'
148--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/SummonModeRenderer.cs 2009-05-16 06:46:42 +0000
149+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/SummonModeRenderer.cs 2009-06-05 21:48:34 +0000
150@@ -82,8 +82,8 @@
151 get { return false; }
152 }
153
154- public int MinimumWidth {
155- get { return 300; }
156+ public int Width {
157+ get { return Math.Max (300, DockArea.PositionProvider.DockWidth); }
158 }
159
160 public SummonModeRenderer ()
161
162=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/IDockPainter.cs'
163--- Do.Interface.Linux.Docky/src/Docky.Interface/IDockPainter.cs 2009-02-22 06:58:26 +0000
164+++ Do.Interface.Linux.Docky/src/Docky.Interface/IDockPainter.cs 2009-06-05 21:34:32 +0000
165@@ -34,7 +34,7 @@
166
167 bool Interruptable { get; }
168
169- int MinimumWidth { get; }
170+ int Width { get; }
171
172 void Paint (Context cr, Gdk.Rectangle dockArea, Gdk.Point cursor);
173