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
1=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs'
2--- Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs 2009-08-19 07:43:04 +0000
3+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs 2009-08-28 01:51:26 +0000
4@@ -61,6 +61,7 @@
5
6 #region Private Variables
7 DateTime enter_time = new DateTime (0);
8+ DateTime fade_time = new DateTime (0);
9 DateTime interface_change_time = new DateTime (0);
10 DateTime last_draw_timeout = new DateTime (0);
11 DateTime showhide_time = new DateTime (0);
12@@ -334,6 +335,7 @@
13
14 AnimationState.AddCondition (Animations.InputModeChanged,
15 () => DateTime.UtcNow - interface_change_time < SummonTime ||
16+ DateTime.UtcNow - fade_time < SummonTime ||
17 DateTime.UtcNow - showhide_time < SummonTime);
18 }
19
20@@ -540,6 +542,10 @@
21 if (WindowIntersectingOther)
22 showhide_time = enter_time;
23 break;
24+ case AutohideType.Intellifade:
25+ if (WindowIntersectingOther)
26+ fade_time = enter_time;
27+ break;
28 }
29 AnimatedDraw ();
30
31
32=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs'
33--- Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs 2009-08-31 01:35:40 +0000
34+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs 2009-08-31 02:00:00 +0000
35@@ -142,6 +142,19 @@
36 }
37 }
38
39+ double DockOpacity {
40+ get {
41+ if (PainterOverlayVisible)
42+ return 1;
43+ double FadeTime = SummonTime.TotalMilliseconds;
44+ double FadeStartTime = (RenderTime - fade_time).TotalMilliseconds;
45+ double opacity = Math.Min (1, FadeStartTime / FadeTime);
46+ if (CursorIsOverDockArea || !WindowIntersectingOther)
47+ return (FadeTime < FadeStartTime) ? 1 : Math.Min (1, DockPreferences.IntellifadeOpacity + opacity);
48+ return Math.Max (DockPreferences.IntellifadeOpacity, 1 - opacity);
49+ }
50+ }
51+
52 //// <value>
53 /// Get autohide state
54 /// </value>
55@@ -208,7 +221,7 @@
56 get {
57 double offset = 0;
58 // we never hide in these conditions
59- if (DockPreferences.AutohideType == AutohideType.None || DnDTracker.DragResizing || PainterOpacity == 1) {
60+ if (DockPreferences.AutohideType == AutohideType.None || DockPreferences.AutohideType == AutohideType.Intellifade || DnDTracker.DragResizing || PainterOpacity == 1) {
61 if ((RenderTime - FirstRenderTime) > SummonTime)
62 return 0;
63 offset = 1 - Math.Min (1, (DateTime.UtcNow - FirstRenderTime).TotalMilliseconds / SummonTime.TotalMilliseconds);
64@@ -290,14 +303,17 @@
65 showhide_time = UpdateTimeStamp (showhide_time, SummonTime);
66 AnimatedDraw ();
67 }
68+ if (DockPreferences.AutohideType == AutohideType.Intellifade) {
69+ fade_time = UpdateTimeStamp (fade_time, SummonTime);
70+ AnimatedDraw ();
71+ }
72 }
73
74 void DrawDock (Context cr)
75 {
76 Gdk.Rectangle dockArea = GetDockArea ();
77 window.SetBackgroundBlur (dockArea);
78-
79- DockBackgroundRenderer.RenderDockBackground (cr, dockArea);
80+ DockBackgroundRenderer.RenderDockBackground (cr, dockArea, DockOpacity);
81
82 IDockPainter dpaint = (Painter == null) ? LastPainter : Painter;
83
84@@ -311,7 +327,7 @@
85 }
86
87 cr.SetSource (overlay_surface);
88- cr.PaintWithAlpha (PainterOpacity);
89+ cr.PaintWithAlpha (PainterOpacity * DockOpacity);
90 }
91
92 bool isNotSummonTransition = PainterOpacity == 0 || !IsHidden || !DockPreferences.AutoHide;
93@@ -326,7 +342,7 @@
94 int offset = (int) (IconSize * (1 - DockIconOpacity));
95 Gdk.Point iconBufferLocation = new Gdk.Point (0, 0).RelativeMovePoint (offset, RelativeMove.Outward);
96 cr.SetSource (dock_icon_buffer, iconBufferLocation.X, iconBufferLocation.Y);
97- cr.PaintWithAlpha (DockIconOpacity);
98+ cr.PaintWithAlpha (DockIconOpacity * DockOpacity);
99 }
100 }
101
102
103=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/DockBackgroundRenderer.cs'
104--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/DockBackgroundRenderer.cs 2009-05-01 16:09:04 +0000
105+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/DockBackgroundRenderer.cs 2009-08-26 19:30:28 +0000
106@@ -34,32 +34,34 @@
107 {
108 static Surface sr;
109 static int height;
110+ static double oldAlpha;
111
112 const int width = 1500;
113
114- public static void RenderDockBackground (Context context, Gdk.Rectangle dockArea)
115+ public static void RenderDockBackground (Context context, Gdk.Rectangle dockArea, double alpha)
116 {
117- if (sr == null || dockArea.Height != height) {
118+ if (sr == null || dockArea.Height != height || alpha != oldAlpha) {
119
120 if (sr != null)
121 sr.Destroy ();
122
123 height = dockArea.Height;
124+ oldAlpha = alpha;
125 sr = context.Target.CreateSimilar (context.Target.Content, width, dockArea.Height);
126
127 using (Context cr = new Context (sr)) {
128 cr.SetRoundedRectanglePath (.5, .5, width - 1, height + 40, 5); // fall off the bottom
129- cr.Color = new Cairo.Color (0.1, 0.1, 0.1, .75);
130+ cr.Color = new Cairo.Color (0.1, 0.1, 0.1, .75 * alpha);
131 cr.FillPreserve ();
132
133 // gives the dock a "lifted" look and feel
134- cr.Color = new Cairo.Color (0, 0, 0, .6);
135+ cr.Color = new Cairo.Color (0, 0, 0, .6 * alpha);
136 cr.LineWidth = 1;
137 cr.Stroke ();
138
139 cr.SetRoundedRectanglePath (1.5, 1.5, width - 3, height + 40, 5);
140 LinearGradient lg = new LinearGradient (0, 1.5, 0, 10);
141- lg.AddColorStop (0, new Cairo.Color (1, 1, 1, .4));
142+ lg.AddColorStop (0, new Cairo.Color (1, 1, 1, .4 * alpha));
143 lg.AddColorStop (1, new Cairo.Color (1, 1, 1, 0));
144 cr.Pattern = lg;
145 cr.LineWidth = 1;
146
147=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockyConfigurationWidget.cs'
148--- Do.Interface.Linux.Docky/src/Docky.Interface/DockyConfigurationWidget.cs 2009-06-19 04:30:03 +0000
149+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockyConfigurationWidget.cs 2009-08-28 01:51:26 +0000
150@@ -95,6 +95,7 @@
151 autohide_combo.AppendText (((AutohideType) 0).ToString ());
152 autohide_combo.AppendText (((AutohideType) 1).ToString ());
153 autohide_combo.AppendText (((AutohideType) 2).ToString ());
154+ autohide_combo.AppendText (((AutohideType) 3).ToString ());
155 autohide_combo.Active = (int) DockPreferences.AutohideType;
156
157 BuildDocklets ();
158
159=== modified file 'Do.Interface.Linux.Docky/src/Docky.Utilities/AutohideType.cs'
160--- Do.Interface.Linux.Docky/src/Docky.Utilities/AutohideType.cs 2009-04-27 20:42:27 +0000
161+++ Do.Interface.Linux.Docky/src/Docky.Utilities/AutohideType.cs 2009-08-28 01:51:26 +0000
162@@ -26,5 +26,6 @@
163 None = 0,
164 Autohide,
165 Intellihide,
166+ Intellifade,
167 }
168 }
169
170=== modified file 'Do.Interface.Linux.Docky/src/Docky.Utilities/DockPreferences.cs'
171--- Do.Interface.Linux.Docky/src/Docky.Utilities/DockPreferences.cs 2009-08-28 06:46:50 +0000
172+++ Do.Interface.Linux.Docky/src/Docky.Utilities/DockPreferences.cs 2009-09-03 04:38:19 +0000
173@@ -68,6 +68,8 @@
174 SetZoomEnabled ((bool)e.Value);
175 if (e.Key == "IconSize")
176 SetIconSize ((int)e.Value);
177+ if (e.Key == "IntellifadeOpacity")
178+ SetIntellifadeOpacity ((double)e.Value);
179 if (e.Key == "SummonTime")
180 SetSummonTime (new TimeSpan (0, 0, 0, 0, (int)e.Value));
181 if (e.Key == "AutomaticIcons")
182@@ -188,6 +190,25 @@
183 get { return ZoomPercent; }
184 }
185
186+ static double intellifade_opacity = prefs.Get ("IntellifadeOpacity", 0.4);
187+ public static double IntellifadeOpacity {
188+ get { return intellifade_opacity; }
189+ set {
190+ if (SetIntellifadeOpacity (value))
191+ prefs.Set ("IntellifadeOpacity", value);
192+ }
193+ }
194+ static bool SetIntellifadeOpacity (double val)
195+ {
196+ if (val < 0)
197+ val = 0;
198+ if (val > 1)
199+ val = 1;
200+ if (intellifade_opacity == val) return false;
201+ intellifade_opacity = val;
202+ return true;
203+ }
204+
205 public static bool AutoHide {
206 get { return AutohideType != AutohideType.None; }
207 }