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+11845@code.launchpad.net

This proposal supersedes a proposal from 2009-09-03.

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 : Posted in a previous version of this proposal

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