Do

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

Proposed by Robert Dyer
Status: Superseded
Proposed branch: lp:~psybers/do/intellifade
Merge into: lp:do
Diff against target: None lines
To merge this branch: bzr merge lp:~psybers/do/intellifade
Reviewer Review Type Date Requested Status
Do Core Team Pending
Review via email: mp+11110@code.launchpad.net

This proposal has been superseded by a proposal from 2009-09-16.

To post a comment you must log in.
Revision history for this message
Robert Dyer (psybers) wrote :

Adds 'Intellifade' as another hide option. This is pretty similar to Intellihide, but instead of sliding off screen it fades the dock to a certain opacity (0.4 default). That opacity is gconf configurable, allowing people to mimic the old AllowWindowOverlap behavior (opacity 1) or to truly mimic Intellihide but with only a different animation (opacity 0).

It also adds new functionality in that you can allow the dock to remain visible, but faded when not active. Thus I can still see my clock/weather/etc but it's faded enough to not get in my way too! =)

lp:~psybers/do/intellifade updated
1306. By Robert Dyer <rdyer@yamuna>

merge trunk

1307. By Robert Dyer <rdyer@yamuna>

merge trunk

1308. By Robert Dyer <rdyer@yamuna>

merge trunk

1309. By Robert Dyer <rdyer@yamuna>

make fade time more consistent for all opacities and clean the code some

1310. By Robert Dyer <rdyer@yamuna>

fix a flickering issue when minimizing/restoring windows

1311. By Robert Dyer <rdyer@yamuna>

clean code to remove unneeded fade_time var

1312. By Robert Dyer <rdyer@narmada>

merge trunk

Unmerged revisions

1312. By Robert Dyer <rdyer@narmada>

merge trunk

1311. By Robert Dyer <rdyer@yamuna>

clean code to remove unneeded fade_time var

1310. By Robert Dyer <rdyer@yamuna>

fix a flickering issue when minimizing/restoring windows

1309. By Robert Dyer <rdyer@yamuna>

make fade time more consistent for all opacities and clean the code some

1308. By Robert Dyer <rdyer@yamuna>

merge trunk

1307. By Robert Dyer <rdyer@yamuna>

merge trunk

1306. By Robert Dyer <rdyer@yamuna>

merge trunk

1305. By Robert Dyer <rdyer@yamuna>

removing old code

1304. By Robert Dyer <rdyer@yamuna>

merge trunk

1303. By Robert Dyer <rdyer@yamuna>

merge trunk

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-08-19 07:43:04 +0000
+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs 2009-08-28 01:51:26 +0000
@@ -61,6 +61,7 @@
61 61
62 #region Private Variables62 #region Private Variables
63 DateTime enter_time = new DateTime (0);63 DateTime enter_time = new DateTime (0);
64 DateTime fade_time = new DateTime (0);
64 DateTime interface_change_time = new DateTime (0);65 DateTime interface_change_time = new DateTime (0);
65 DateTime last_draw_timeout = new DateTime (0);66 DateTime last_draw_timeout = new DateTime (0);
66 DateTime showhide_time = new DateTime (0);67 DateTime showhide_time = new DateTime (0);
@@ -334,6 +335,7 @@
334 335
335 AnimationState.AddCondition (Animations.InputModeChanged,336 AnimationState.AddCondition (Animations.InputModeChanged,
336 () => DateTime.UtcNow - interface_change_time < SummonTime || 337 () => DateTime.UtcNow - interface_change_time < SummonTime ||
338 DateTime.UtcNow - fade_time < SummonTime ||
337 DateTime.UtcNow - showhide_time < SummonTime);339 DateTime.UtcNow - showhide_time < SummonTime);
338 }340 }
339 341
@@ -540,6 +542,10 @@
540 if (WindowIntersectingOther)542 if (WindowIntersectingOther)
541 showhide_time = enter_time;543 showhide_time = enter_time;
542 break;544 break;
545 case AutohideType.Intellifade:
546 if (WindowIntersectingOther)
547 fade_time = enter_time;
548 break;
543 }549 }
544 AnimatedDraw ();550 AnimatedDraw ();
545 551
546552
=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs'
--- Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs 2009-08-31 01:35:40 +0000
+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs 2009-08-31 02:00:00 +0000
@@ -142,6 +142,19 @@
142 }142 }
143 }143 }
144 144
145 double DockOpacity {
146 get {
147 if (PainterOverlayVisible)
148 return 1;
149 double FadeTime = SummonTime.TotalMilliseconds;
150 double FadeStartTime = (RenderTime - fade_time).TotalMilliseconds;
151 double opacity = Math.Min (1, FadeStartTime / FadeTime);
152 if (CursorIsOverDockArea || !WindowIntersectingOther)
153 return (FadeTime < FadeStartTime) ? 1 : Math.Min (1, DockPreferences.IntellifadeOpacity + opacity);
154 return Math.Max (DockPreferences.IntellifadeOpacity, 1 - opacity);
155 }
156 }
157
145 //// <value>158 //// <value>
146 /// Get autohide state159 /// Get autohide state
147 /// </value>160 /// </value>
@@ -208,7 +221,7 @@
208 get {221 get {
209 double offset = 0;222 double offset = 0;
210 // we never hide in these conditions223 // we never hide in these conditions
211 if (DockPreferences.AutohideType == AutohideType.None || DnDTracker.DragResizing || PainterOpacity == 1) {224 if (DockPreferences.AutohideType == AutohideType.None || DockPreferences.AutohideType == AutohideType.Intellifade || DnDTracker.DragResizing || PainterOpacity == 1) {
212 if ((RenderTime - FirstRenderTime) > SummonTime)225 if ((RenderTime - FirstRenderTime) > SummonTime)
213 return 0;226 return 0;
214 offset = 1 - Math.Min (1, (DateTime.UtcNow - FirstRenderTime).TotalMilliseconds / SummonTime.TotalMilliseconds);227 offset = 1 - Math.Min (1, (DateTime.UtcNow - FirstRenderTime).TotalMilliseconds / SummonTime.TotalMilliseconds);
@@ -290,14 +303,17 @@
290 showhide_time = UpdateTimeStamp (showhide_time, SummonTime);303 showhide_time = UpdateTimeStamp (showhide_time, SummonTime);
291 AnimatedDraw ();304 AnimatedDraw ();
292 }305 }
306 if (DockPreferences.AutohideType == AutohideType.Intellifade) {
307 fade_time = UpdateTimeStamp (fade_time, SummonTime);
308 AnimatedDraw ();
309 }
293 }310 }
294 311
295 void DrawDock (Context cr)312 void DrawDock (Context cr)
296 {313 {
297 Gdk.Rectangle dockArea = GetDockArea ();314 Gdk.Rectangle dockArea = GetDockArea ();
298 window.SetBackgroundBlur (dockArea);315 window.SetBackgroundBlur (dockArea);
299 316 DockBackgroundRenderer.RenderDockBackground (cr, dockArea, DockOpacity);
300 DockBackgroundRenderer.RenderDockBackground (cr, dockArea);
301317
302 IDockPainter dpaint = (Painter == null) ? LastPainter : Painter;318 IDockPainter dpaint = (Painter == null) ? LastPainter : Painter;
303 319
@@ -311,7 +327,7 @@
311 }327 }
312328
313 cr.SetSource (overlay_surface);329 cr.SetSource (overlay_surface);
314 cr.PaintWithAlpha (PainterOpacity);330 cr.PaintWithAlpha (PainterOpacity * DockOpacity);
315 }331 }
316 332
317 bool isNotSummonTransition = PainterOpacity == 0 || !IsHidden || !DockPreferences.AutoHide;333 bool isNotSummonTransition = PainterOpacity == 0 || !IsHidden || !DockPreferences.AutoHide;
@@ -326,7 +342,7 @@
326 int offset = (int) (IconSize * (1 - DockIconOpacity));342 int offset = (int) (IconSize * (1 - DockIconOpacity));
327 Gdk.Point iconBufferLocation = new Gdk.Point (0, 0).RelativeMovePoint (offset, RelativeMove.Outward);343 Gdk.Point iconBufferLocation = new Gdk.Point (0, 0).RelativeMovePoint (offset, RelativeMove.Outward);
328 cr.SetSource (dock_icon_buffer, iconBufferLocation.X, iconBufferLocation.Y);344 cr.SetSource (dock_icon_buffer, iconBufferLocation.X, iconBufferLocation.Y);
329 cr.PaintWithAlpha (DockIconOpacity);345 cr.PaintWithAlpha (DockIconOpacity * DockOpacity);
330 }346 }
331 }347 }
332 348
333349
=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/DockBackgroundRenderer.cs'
--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/DockBackgroundRenderer.cs 2009-05-01 16:09:04 +0000
+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/DockBackgroundRenderer.cs 2009-08-26 19:30:28 +0000
@@ -34,32 +34,34 @@
34 {34 {
35 static Surface sr;35 static Surface sr;
36 static int height;36 static int height;
37 static double oldAlpha;
37 38
38 const int width = 1500;39 const int width = 1500;
39 40
40 public static void RenderDockBackground (Context context, Gdk.Rectangle dockArea)41 public static void RenderDockBackground (Context context, Gdk.Rectangle dockArea, double alpha)
41 {42 {
42 if (sr == null || dockArea.Height != height) {43 if (sr == null || dockArea.Height != height || alpha != oldAlpha) {
43 44
44 if (sr != null)45 if (sr != null)
45 sr.Destroy ();46 sr.Destroy ();
46 47
47 height = dockArea.Height;48 height = dockArea.Height;
49 oldAlpha = alpha;
48 sr = context.Target.CreateSimilar (context.Target.Content, width, dockArea.Height);50 sr = context.Target.CreateSimilar (context.Target.Content, width, dockArea.Height);
49 51
50 using (Context cr = new Context (sr)) {52 using (Context cr = new Context (sr)) {
51 cr.SetRoundedRectanglePath (.5, .5, width - 1, height + 40, 5); // fall off the bottom53 cr.SetRoundedRectanglePath (.5, .5, width - 1, height + 40, 5); // fall off the bottom
52 cr.Color = new Cairo.Color (0.1, 0.1, 0.1, .75);54 cr.Color = new Cairo.Color (0.1, 0.1, 0.1, .75 * alpha);
53 cr.FillPreserve ();55 cr.FillPreserve ();
54 56
55 // gives the dock a "lifted" look and feel57 // gives the dock a "lifted" look and feel
56 cr.Color = new Cairo.Color (0, 0, 0, .6);58 cr.Color = new Cairo.Color (0, 0, 0, .6 * alpha);
57 cr.LineWidth = 1;59 cr.LineWidth = 1;
58 cr.Stroke ();60 cr.Stroke ();
59 61
60 cr.SetRoundedRectanglePath (1.5, 1.5, width - 3, height + 40, 5);62 cr.SetRoundedRectanglePath (1.5, 1.5, width - 3, height + 40, 5);
61 LinearGradient lg = new LinearGradient (0, 1.5, 0, 10);63 LinearGradient lg = new LinearGradient (0, 1.5, 0, 10);
62 lg.AddColorStop (0, new Cairo.Color (1, 1, 1, .4));64 lg.AddColorStop (0, new Cairo.Color (1, 1, 1, .4 * alpha));
63 lg.AddColorStop (1, new Cairo.Color (1, 1, 1, 0));65 lg.AddColorStop (1, new Cairo.Color (1, 1, 1, 0));
64 cr.Pattern = lg;66 cr.Pattern = lg;
65 cr.LineWidth = 1;67 cr.LineWidth = 1;
6668
=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockyConfigurationWidget.cs'
--- Do.Interface.Linux.Docky/src/Docky.Interface/DockyConfigurationWidget.cs 2009-06-19 04:30:03 +0000
+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockyConfigurationWidget.cs 2009-08-28 01:51:26 +0000
@@ -95,6 +95,7 @@
95 autohide_combo.AppendText (((AutohideType) 0).ToString ());95 autohide_combo.AppendText (((AutohideType) 0).ToString ());
96 autohide_combo.AppendText (((AutohideType) 1).ToString ());96 autohide_combo.AppendText (((AutohideType) 1).ToString ());
97 autohide_combo.AppendText (((AutohideType) 2).ToString ());97 autohide_combo.AppendText (((AutohideType) 2).ToString ());
98 autohide_combo.AppendText (((AutohideType) 3).ToString ());
98 autohide_combo.Active = (int) DockPreferences.AutohideType;99 autohide_combo.Active = (int) DockPreferences.AutohideType;
99 100
100 BuildDocklets ();101 BuildDocklets ();
101102
=== modified file 'Do.Interface.Linux.Docky/src/Docky.Utilities/AutohideType.cs'
--- Do.Interface.Linux.Docky/src/Docky.Utilities/AutohideType.cs 2009-04-27 20:42:27 +0000
+++ Do.Interface.Linux.Docky/src/Docky.Utilities/AutohideType.cs 2009-08-28 01:51:26 +0000
@@ -26,5 +26,6 @@
26 None = 0,26 None = 0,
27 Autohide,27 Autohide,
28 Intellihide,28 Intellihide,
29 Intellifade,
29 }30 }
30}31}
3132
=== modified file 'Do.Interface.Linux.Docky/src/Docky.Utilities/DockPreferences.cs'
--- Do.Interface.Linux.Docky/src/Docky.Utilities/DockPreferences.cs 2009-08-28 06:46:50 +0000
+++ Do.Interface.Linux.Docky/src/Docky.Utilities/DockPreferences.cs 2009-09-03 04:38:19 +0000
@@ -68,6 +68,8 @@
68 SetZoomEnabled ((bool)e.Value);68 SetZoomEnabled ((bool)e.Value);
69 if (e.Key == "IconSize")69 if (e.Key == "IconSize")
70 SetIconSize ((int)e.Value);70 SetIconSize ((int)e.Value);
71 if (e.Key == "IntellifadeOpacity")
72 SetIntellifadeOpacity ((double)e.Value);
71 if (e.Key == "SummonTime")73 if (e.Key == "SummonTime")
72 SetSummonTime (new TimeSpan (0, 0, 0, 0, (int)e.Value));74 SetSummonTime (new TimeSpan (0, 0, 0, 0, (int)e.Value));
73 if (e.Key == "AutomaticIcons")75 if (e.Key == "AutomaticIcons")
@@ -188,6 +190,25 @@
188 get { return ZoomPercent; }190 get { return ZoomPercent; }
189 }191 }
190 192
193 static double intellifade_opacity = prefs.Get ("IntellifadeOpacity", 0.4);
194 public static double IntellifadeOpacity {
195 get { return intellifade_opacity; }
196 set {
197 if (SetIntellifadeOpacity (value))
198 prefs.Set ("IntellifadeOpacity", value);
199 }
200 }
201 static bool SetIntellifadeOpacity (double val)
202 {
203 if (val < 0)
204 val = 0;
205 if (val > 1)
206 val = 1;
207 if (intellifade_opacity == val) return false;
208 intellifade_opacity = val;
209 return true;
210 }
211
191 public static bool AutoHide {212 public static bool AutoHide {
192 get { return AutohideType != AutohideType.None; }213 get { return AutohideType != AutohideType.None; }
193 }214 }