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
=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs'
--- Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs 2009-06-05 19:17:54 +0000
+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs 2009-06-05 21:48:34 +0000
@@ -157,7 +157,7 @@
157 157
158 DockAnimationState AnimationState { get; set; }158 DockAnimationState AnimationState { get; set; }
159 159
160 ItemPositionProvider PositionProvider { get; set; }160 public static ItemPositionProvider PositionProvider { get; protected set; }
161161
162 new DockItemMenu PopupMenu { get; set; }162 new DockItemMenu PopupMenu { get; set; }
163 163
@@ -495,7 +495,6 @@
495 495
496 if (tmp) {496 if (tmp) {
497 dockRegion.Inflate (0, (int) (IconSize * (DockPreferences.ZoomPercent - 1)) + 22);497 dockRegion.Inflate (0, (int) (IconSize * (DockPreferences.ZoomPercent - 1)) + 22);
498 CursorIsOverDockArea = dockRegion.Contains (Cursor);
499 } else {498 } else {
500 if (IsHidden) {499 if (IsHidden) {
501 switch (DockPreferences.Orientation) {500 switch (DockPreferences.Orientation) {
@@ -508,9 +507,12 @@
508 break;507 break;
509 }508 }
510 }509 }
511 510 }
511
512 if (PainterOverlayVisible)
513 CursorIsOverDockArea = dockRegion.Contains (new Gdk.Point (dockRegion.X, Cursor.Y));
514 else
512 CursorIsOverDockArea = dockRegion.Contains (Cursor);515 CursorIsOverDockArea = dockRegion.Contains (Cursor);
513 }
514 516
515 if (CursorIsOverDockArea != tmp) {517 if (CursorIsOverDockArea != tmp) {
516 ResetCursorTimer ();518 ResetCursorTimer ();
517519
=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs'
--- Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs 2009-06-01 20:37:58 +0000
+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs 2009-06-05 21:34:32 +0000
@@ -670,16 +670,20 @@
670 else670 else
671 rect = PositionProvider.DockArea (ZoomIn, Cursor);671 rect = PositionProvider.DockArea (ZoomIn, Cursor);
672672
673 int minSize = 10 * rect.Height;673 int minWidth = 10 * rect.Height;
674 int maxWidth = LayoutUtils.MonitorGeometry ().Width;
675 int dockWidth = 0;
674 676
675 if (PainterOverlayVisible && Painter != null) {677 if (PainterOverlayVisible && Painter != null) {
676 minSize = Math.Max (Painter.MinimumWidth, minSize);678 dockWidth = Math.Min (Painter.Width, maxWidth);
677 } else if (!PainterOverlayVisible && LastPainter != null) {679 } else if (!PainterOverlayVisible && LastPainter != null) {
678 minSize = Math.Max (LastPainter.MinimumWidth, minSize);680 dockWidth = Math.Min (LastPainter.Width, maxWidth);
681 } else {
682 dockWidth = Math.Max (rect.Width, minWidth);
679 }683 }
680 684
681 if (rect.Width < minSize && DockIconOpacity < 1) {685 if (rect.Width != dockWidth && DockIconOpacity < 1) {
682 int difference = minSize - rect.Width;686 int difference = dockWidth - rect.Width;
683 int alpha = (int) (difference * PainterOpacity);687 int alpha = (int) (difference * PainterOpacity);
684 rect.X -= alpha / 2;688 rect.X -= alpha / 2;
685 rect.Width += alpha;689 rect.Width += alpha;
686690
=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/AbstractIntegratedPainter.cs'
--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/AbstractIntegratedPainter.cs 2009-06-05 19:19:38 +0000
+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/AbstractIntegratedPainter.cs 2009-06-05 21:34:32 +0000
@@ -40,7 +40,7 @@
40 Surface icon_surface, buffer;40 Surface icon_surface, buffer;
41 AbstractDockItem dock_item;41 AbstractDockItem dock_item;
42 42
43 protected abstract int Width { get; }43 protected abstract int PainterWidth { get; }
44 44
45 protected virtual bool NeedsRepaint {45 protected virtual bool NeedsRepaint {
46 get { return false; }46 get { return false; }
@@ -64,7 +64,7 @@
64 public void Clicked (Gdk.Rectangle dockArea, Gdk.Point cursor)64 public void Clicked (Gdk.Rectangle dockArea, Gdk.Point cursor)
65 {65 {
66 Gdk.Rectangle paintArea = new Gdk.Rectangle (0, 0, Width, dockArea.Height);66 Gdk.Rectangle paintArea = new Gdk.Rectangle (0, 0, Width, dockArea.Height);
67 Gdk.Point paintAreaCursor = new Gdk.Point (cursor.X - dockArea.Left - DockPreferences.FullIconSize - BorderSize - (dockArea.Width - MinimumWidth) / 2,67 Gdk.Point paintAreaCursor = new Gdk.Point (cursor.X - dockArea.Left - DockPreferences.FullIconSize - BorderSize,
68 cursor.Y - dockArea.Top);68 cursor.Y - dockArea.Top);
6969
70 if (!paintArea.Contains (paintAreaCursor) || ReceiveClick (paintArea, paintAreaCursor))70 if (!paintArea.Contains (paintAreaCursor) || ReceiveClick (paintArea, paintAreaCursor))
@@ -79,9 +79,9 @@
79 get { return true; }79 get { return true; }
80 }80 }
81 81
82 public int MinimumWidth {82 public int Width {
83 get {83 get {
84 return Width + DockPreferences.FullIconSize + 2 * BorderSize;84 return PainterWidth + DockPreferences.FullIconSize + 2 * BorderSize;
85 }85 }
86 }86 }
87 87
@@ -119,9 +119,9 @@
119 if (buffer != null)119 if (buffer != null)
120 buffer.Destroy ();120 buffer.Destroy ();
121 121
122 buffer = cr.Target.CreateSimilar (cr.Target.Content, Width, dockArea.Height);122 buffer = cr.Target.CreateSimilar (cr.Target.Content, PainterWidth, dockArea.Height);
123 using (Cairo.Context context = new Cairo.Context (buffer)) {123 using (Cairo.Context context = new Cairo.Context (buffer)) {
124 PaintArea (context, new Gdk.Rectangle (0, 0, Width, dockArea.Height));124 PaintArea (context, new Gdk.Rectangle (0, 0, PainterWidth, dockArea.Height));
125 }125 }
126 buffer_height = dockArea.Height;126 buffer_height = dockArea.Height;
127 }127 }
@@ -132,7 +132,6 @@
132 cr.Clip ();132 cr.Clip ();
133 133
134 int x = dockArea.X + DockPreferences.FullIconSize + BorderSize;134 int x = dockArea.X + DockPreferences.FullIconSize + BorderSize;
135 x = x + (dockArea.Width - MinimumWidth) / 2;
136 buffer.Show (cr, x, dockArea.Y);135 buffer.Show (cr, x, dockArea.Y);
137 cr.ResetClip ();136 cr.ResetClip ();
138 }137 }
139138
=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/CalendarPainter.cs'
--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/CalendarPainter.cs 2009-05-21 20:12:02 +0000
+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/CalendarPainter.cs 2009-06-05 21:34:32 +0000
@@ -64,7 +64,7 @@
64 64
65 #region IDockPainter implementation 65 #region IDockPainter implementation
66 66
67 protected override int Width {67 protected override int PainterWidth {
68 get {68 get {
69 return 670;69 return 670;
70 }70 }
7171
=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/HotSeatPainter.cs'
--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/HotSeatPainter.cs 2009-02-22 06:58:26 +0000
+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/HotSeatPainter.cs 2009-06-05 21:34:32 +0000
@@ -56,7 +56,7 @@
56 get { return true; }56 get { return true; }
57 }57 }
58 58
59 public int MinimumWidth {59 public int Width {
60 get { return 0; }60 get { return 0; }
61 }61 }
62 62
6363
=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/SummonModeRenderer.cs'
--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/SummonModeRenderer.cs 2009-05-16 06:46:42 +0000
+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/SummonModeRenderer.cs 2009-06-05 21:48:34 +0000
@@ -82,8 +82,8 @@
82 get { return false; }82 get { return false; }
83 }83 }
84 84
85 public int MinimumWidth {85 public int Width {
86 get { return 300; }86 get { return Math.Max (300, DockArea.PositionProvider.DockWidth); }
87 }87 }
88 88
89 public SummonModeRenderer ()89 public SummonModeRenderer ()
9090
=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/IDockPainter.cs'
--- Do.Interface.Linux.Docky/src/Docky.Interface/IDockPainter.cs 2009-02-22 06:58:26 +0000
+++ Do.Interface.Linux.Docky/src/Docky.Interface/IDockPainter.cs 2009-06-05 21:34:32 +0000
@@ -34,7 +34,7 @@
3434
35 bool Interruptable { get; }35 bool Interruptable { get; }
36 36
37 int MinimumWidth { get; }37 int Width { get; }
38 38
39 void Paint (Context cr, Gdk.Rectangle dockArea, Gdk.Point cursor);39 void Paint (Context cr, Gdk.Rectangle dockArea, Gdk.Point cursor);
4040