~ubuntu-branches/ubuntu/precise/gnome-do/precise-backports

« back to all changes in this revision

Viewing changes to Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/SummonModeRenderer.cs

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2009-03-13 18:00:35 UTC
  • mfrom: (1.1.6 upstream) (0.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090313180035-08lo8130dasdg7n8
Tags: 0.8.1.3-0ubuntu1
* New upstream release (LP: #344578).
  + Gnome Do causes keyboard keys to be remapped (LP: #308143)
  + Docky window too small when summoned (LP: #317381)
  + Minimize/Maximize does not work on all windows (LP: #317908)
  + Docky blocks drag and drop over large areas of the screen
    (LP: #318471)
  + Docky fails to autohide properly when changing themes
    (LP: #318672)
  + Paste via ctrl+v does not work in 1st pane (LP: #318922)
  + Autostart is in wrong assembly (LP: #319114)
  + Docky has no results list (LP: #319797)
  + Docky trash applet does not reflect current state
    (LP: #320621)
  + Docky panels splits into two when over filled (LP: #324648)
  + Docky ui division is inconsistent and confusing
    (LP: #324718)
  + poor performance with two screens (LP: #323294)
  + Docky trash applet doesn't check if trash exists
    (LP: #323453)
  + docky panel splits into two when overfilled (LP: #324648)
  + Docky's UI division is inconsistent and confusing
    (LP: #324718)
  + Do crashes when using a pastebin launcher with docky
    (LP: #325178)
  + Make docky aware of icon theme switch (LP: #328721)
  + Docky doesn't update icon status for some apps that minimize
    to system tray. (LP: #329120)
  + Docky does not work properly with pull-down window
    (LP: #334663)
  + sensitivity of zooming the icons in the dock isn't
    configurable (LP: #336214)
  + Regression: In 0.8.1, "Request attention" is no longer
    indicated (LP: #337594)
  + Clock's Calendar mode auto-hides when leaving the bounds of
    the original dock (LP: #337783)
  + gnome-do does not notice change of icon theme (LP: #204368)
  + Thumbnails are never displayed when files have spaces in
    their names (LP: #311551)
  + Open improperly escapes URLs. (LP: #317416)
  + Docky: Right-click dialog appears on wrong monitor
    (LP: #319062)
  + Dragging items off Docky possible in summon mode
    (LP: #319452)
  + Docky shows icon according to the filename (LP: #320892)
  + Mouse click inactive when Do(cky) is summoned (LP: #324937)
  + Docky trash don't have a right-click menu (LP: #317947)
  + Polish docky's window name labels (LP: #318487)
  + Docky: Scroll on window icon should switch between windows
    of that app (LP: #319805)
  + Docky does not preserve window stack (z?) order when
    switching apps by clicking on app icon (LP: #326661)
  + Docky window switching should be easier. (LP: #327079)
  + Color of indicators on Docky cannot be changed
    (LP: #332936)
  + Do's ResultWindow is using wrong text color (LP: #288771)
  + Docky won't unhide after rev 1053 (LP: #337113)
  + Do's icon label in Docky should be "GNOME Do" instead of
    "Summon GNOME Do" (LP: #338496)
* Build against gtk, gnome mono packages from Experimental.
* debian/control:
  + Bump versioned dep on libgtk2.0-cil to ensure
    Gdk.Screen.IsComposited exists
  + Add libwnck2.20-cil build-dep
  + Add librsvg2-2.18-cil build-dep
  + gnome-sharp2 transition.
* debian/patches/03_show_in_all_DEs
  + Drop; fixed in new upstream
* debian/gnome-do.1
  + Update for new version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// SummonModeRenderer.cs
 
2
// 
 
3
// Copyright (C) 2008 GNOME Do
 
4
//
 
5
// This program is free software: you can redistribute it and/or modify
 
6
// it under the terms of the GNU General Public License as published by
 
7
// the Free Software Foundation, either version 3 of the License, or
 
8
// (at your option) any later version.
 
9
//
 
10
// This program is distributed in the hope that it will be useful,
 
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
// GNU General Public License for more details.
 
14
//
 
15
// You should have received a copy of the GNU General Public License
 
16
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
//
 
18
 
 
19
using System;
 
20
using System.Collections.Generic;
 
21
using System.Diagnostics;
 
22
 
 
23
using Cairo;
 
24
using Gdk;
 
25
using Mono.Unix;
 
26
 
 
27
using Do.Interface;
 
28
using Do.Interface.AnimationBase;
 
29
using Do.Interface.CairoUtils;
 
30
 
 
31
using Do.Platform;
 
32
using Do.Universe;
 
33
 
 
34
using Docky.Core;
 
35
using Docky.Interface;
 
36
using Docky.Utilities;
 
37
 
 
38
namespace Docky.Interface.Painters
 
39
{
 
40
        public class SummonModeRenderer : IDockPainter
 
41
        {
 
42
                const int IconSize = 16;
 
43
                
 
44
                bool paint;
 
45
                Gdk.Rectangle previous_area;
 
46
 
 
47
                public event EventHandler<PaintNeededArgs> PaintNeeded;
 
48
 
 
49
                public event EventHandler ShowRequested;
 
50
                public event EventHandler HideRequested;
 
51
                
 
52
                PixbufSurfaceCache LargeIconCache { get; set; }
 
53
                TextRenderer TextUtility { get; set; }
 
54
                
 
55
                DockState State {
 
56
                        get { return DockState.Instance; }
 
57
                }
 
58
                
 
59
                bool ShouldRenderButton {
 
60
                        get {
 
61
                                return State.CurrentPane != Pane.Third && State [State.CurrentPane] != null && State [State.CurrentPane] is Item;
 
62
                        }
 
63
                }
 
64
                
 
65
                int TextOffset {
 
66
                        get {
 
67
                                return (int) (DockPreferences.IconSize * 3.5);
 
68
                        }
 
69
                }
 
70
 
 
71
                public bool DoubleBuffer {
 
72
                        get { return true; }
 
73
                }
 
74
 
 
75
                public bool Interruptable {
 
76
                        get { return false; }
 
77
                }
 
78
                
 
79
                public int MinimumWidth {
 
80
                        get { return 300; }
 
81
                }
 
82
                
 
83
                public SummonModeRenderer ()
 
84
                {
 
85
                        paint = true;
 
86
                        TextUtility = new TextRenderer (DockWindow.Window);
 
87
                        
 
88
                        RegisterEvents ();
 
89
                }
 
90
 
 
91
                void RegisterEvents ()
 
92
                {
 
93
                        DockPreferences.IconSizeChanged += HandleIconSizeChanged;
 
94
                        DockServices.DoInteropService.Summoned += HandleSummoned;
 
95
                        DockServices.DoInteropService.Vanished += HandleVanished;
 
96
                        DockState.Instance.StateChanged += HandleStateChanged;
 
97
                }
 
98
 
 
99
                void UnregisterEvents ()
 
100
                {
 
101
                        DockPreferences.IconSizeChanged -= HandleIconSizeChanged;
 
102
                        DockServices.DoInteropService.Summoned -= HandleSummoned;
 
103
                        DockServices.DoInteropService.Vanished -= HandleVanished;
 
104
                        DockState.Instance.StateChanged -= HandleStateChanged;
 
105
                }
 
106
 
 
107
                void HandleStateChanged (object sender, EventArgs e)
 
108
                {
 
109
                        if (PaintNeeded != null) {
 
110
                                paint = true;
 
111
                                PaintNeededArgs args;
 
112
                                if (DateTime.UtcNow - DockState.Instance.CurrentPaneTime < DockArea.BaseAnimationTime) 
 
113
                                        args = new PaintNeededArgs (DockArea.BaseAnimationTime);
 
114
                                else
 
115
                                        args = new PaintNeededArgs ();
 
116
                                PaintNeeded (this, args);
 
117
                        }
 
118
                }
 
119
 
 
120
                void HandleVanished(object sender, EventArgs e)
 
121
                {
 
122
                        if (HideRequested != null)
 
123
                                HideRequested (this, new EventArgs ());
 
124
                }
 
125
 
 
126
                void HandleSummoned(object sender, EventArgs e)
 
127
                {
 
128
                        if (ShowRequested != null)
 
129
                                ShowRequested (this, new EventArgs ());
 
130
                        paint = true;
 
131
                }
 
132
 
 
133
                void HandleIconSizeChanged ()
 
134
                {
 
135
                        if (LargeIconCache != null)
 
136
                                LargeIconCache.Dispose ();
 
137
                        LargeIconCache = null;
 
138
                }
 
139
 
 
140
                public void Clicked (Gdk.Rectangle dockArea, Gdk.Point cursor)
 
141
                {
 
142
                        Gdk.Point center = GetButtonCenter (ref dockArea);
 
143
                        Gdk.Rectangle rect = new Gdk.Rectangle (center.X - IconSize / 2, center.Y - IconSize / 2, IconSize, IconSize);
 
144
                        if (rect.Contains (cursor) && State [State.CurrentPane] is Item) {
 
145
                                DockServices.ItemsService.AddItemToDock (State [State.CurrentPane]);
 
146
                                DockServices.DoInteropService.RequestClickOff ();
 
147
                        } else if (!dockArea.Contains (cursor)) {
 
148
                                DockServices.DoInteropService.RequestClickOff ();
 
149
                        }
 
150
                }
 
151
 
 
152
                public void Interrupt ()
 
153
                {
 
154
                        Log.Error ("Docky has been interupted innapropriately.  Please report this bug.");
 
155
                }
 
156
                
 
157
                Gdk.Point GetButtonCenter (ref Gdk.Rectangle dockArea)
 
158
                {
 
159
                        return new Gdk.Point (dockArea.X + IconSize / 2 + 5, dockArea.Y + dockArea.Height - (IconSize / 2 + 5));
 
160
                }
 
161
                        
 
162
                public void Paint (Context cr, Gdk.Rectangle dockArea, Gdk.Point cursor)
 
163
                {
 
164
                        if (previous_area == dockArea && 
 
165
                            !paint && 
 
166
                            DateTime.UtcNow - DockState.Instance.CurrentPaneTime > DockArea.BaseAnimationTime) {
 
167
                                previous_area = dockArea;
 
168
                                return;
 
169
                        }
 
170
                        previous_area = dockArea;
 
171
                        
 
172
                        paint = false;
 
173
                        cr.AlphaFill ();
 
174
                        
 
175
                        if (LargeIconCache == null)
 
176
                                LargeIconCache = new PixbufSurfaceCache (10, 2 * DockPreferences.IconSize, 2 * DockPreferences.IconSize, cr.Target);
 
177
                                
 
178
                        for (int i=0; i<3; i++) {
 
179
                                Pane pane  = (Pane)i;
 
180
                                int left_x;
 
181
                                double zoom;
 
182
                                GetXForPane (ref dockArea, pane, out left_x, out zoom);
 
183
                                
 
184
                                if (pane == Pane.Third && !State.ThirdPaneVisible)
 
185
                                        continue;
 
186
                                
 
187
                                string icon = null;
 
188
                                double opacity = .6 + zoom * .4;
 
189
                                switch (PaneDrawState (pane)) {
 
190
                                case DrawState.NoResult:
 
191
                                        icon = "gtk-delete";
 
192
                                        break;
 
193
                                case DrawState.Normal:
 
194
                                        icon = State[pane].Icon;
 
195
                                        break;
 
196
                                case DrawState.Text:
 
197
                                        icon = "gnome-mime-text";
 
198
                                        break;
 
199
                                case DrawState.ExplicitText:
 
200
                                        icon = "gnome-mime-text";
 
201
                                        opacity = .2 * opacity;
 
202
                                        break;
 
203
                                case DrawState.None:
 
204
                                        continue;
 
205
                                }
 
206
                                
 
207
                                if (icon == null)
 
208
                                        continue;
 
209
                                
 
210
                                if (!LargeIconCache.ContainsKey (icon))
 
211
                                    LargeIconCache.AddPixbufSurface (icon, icon);
 
212
 
 
213
                                cr.Scale (zoom, zoom);
 
214
                                if (DockPreferences.Orientation == DockOrientation.Top) {
 
215
                                        cr.SetSource (LargeIconCache.GetSurface (icon), 
 
216
                                                      left_x * (1 / zoom), 
 
217
                                                      (dockArea.Y * (1 / zoom)));
 
218
                                } else {
 
219
                                        cr.SetSource (LargeIconCache.GetSurface (icon), 
 
220
                                                      left_x * (1 / zoom), 
 
221
                                                      ((dockArea.Y + dockArea.Height) - (DockPreferences.IconSize * 2 * zoom) - 5) * (1 / zoom));
 
222
                                }
 
223
                                cr.PaintWithAlpha (opacity);
 
224
                                cr.Scale (1 / zoom, 1 / zoom);
 
225
                        }
 
226
 
 
227
                        switch (PaneDrawState (State.CurrentPane))
 
228
                        {
 
229
                        case DrawState.NoResult:
 
230
                                RenderText (cr, Catalog.GetString ("No result found for") + ": " + State.GetPaneQuery (State.CurrentPane), ref dockArea);
 
231
                                break;
 
232
                        case DrawState.Normal:
 
233
                                RenderNormalText (cr, ref dockArea);
 
234
                                if (ShouldRenderButton)
 
235
                                        RenderAddButton (cr, ref dockArea, ref cursor);
 
236
                                break;
 
237
                        case DrawState.Text:
 
238
                                RenderTextModeText (cr, ref dockArea);
 
239
                                break;
 
240
                        case DrawState.ExplicitText:
 
241
                                RenderExplicitText (cr, ref dockArea);
 
242
                                break;
 
243
                        case DrawState.None:
 
244
                                // do nothing
 
245
                                break;
 
246
                        }
 
247
                }
 
248
                
 
249
                void RenderNormalText (Context cr, ref Gdk.Rectangle dockArea)
 
250
                {
 
251
                        int base_x = dockArea.X + 30;
 
252
                        string text = GLib.Markup.EscapeText (State[State.CurrentPane].Name);
 
253
                        text = Do.Interface.Util.FormatCommonSubstrings (text, State.GetPaneQuery (State.CurrentPane), DockPreferences.HighlightFormat);
 
254
                        
 
255
                        Pango.Color color = new Pango.Color ();
 
256
                        color.Blue = color.Red = color.Green = ushort.MaxValue;
 
257
                        
 
258
                        double text_scale = (DockPreferences.IconSize / 64.0);
 
259
                        int small_text_height = (int) (12 * text_scale);
 
260
                        
 
261
                        int big_text_height;
 
262
                        if (8 < small_text_height) {
 
263
                                big_text_height = (int) (20 * text_scale);
 
264
                                TextUtility.RenderLayoutText (cr, text, base_x + TextOffset, 
 
265
                                                              dockArea.Y + (int) (15 * text_scale), dockArea.Width - TextOffset - 50, 
 
266
                                                              big_text_height, color, Pango.Alignment.Left, Pango.EllipsizeMode.End);
 
267
                                
 
268
                                TextUtility.RenderLayoutText (cr, GLib.Markup.EscapeText (State[State.CurrentPane].Description), 
 
269
                                                              base_x + TextOffset, dockArea.Y + (int) (42 * text_scale), 
 
270
                                                              dockArea.Width - TextOffset - 50, small_text_height, color, 
 
271
                                                              Pango.Alignment.Left, Pango.EllipsizeMode.End);
 
272
                                
 
273
                                
 
274
                        } else {
 
275
                                big_text_height = (int) (35 * text_scale);
 
276
                                TextUtility.RenderLayoutText (cr, text, base_x + TextOffset, 
 
277
                                                              dockArea.Y + dockArea.Height / 2 - 3 * big_text_height / 5, dockArea.Width - TextOffset - 50, 
 
278
                                                              big_text_height, color, Pango.Alignment.Left, Pango.EllipsizeMode.End);
 
279
                        }
 
280
                }
 
281
                
 
282
                void RenderExplicitText (Context cr, ref Gdk.Rectangle dockArea)
 
283
                {
 
284
                        int base_x = dockArea.X + 15;
 
285
                        
 
286
                        string text;
 
287
                        Element current = State [State.CurrentPane];
 
288
                        
 
289
                        if (current == null)
 
290
                                text = State.GetPaneQuery (State.CurrentPane);
 
291
                        else if (current is ITextItem)
 
292
                                text = (current as ITextItem).Text;
 
293
                        else
 
294
                                text = current.Name;
 
295
 
 
296
                        if (string.IsNullOrEmpty (text))
 
297
                            return;
 
298
 
 
299
                        text = GLib.Markup.EscapeText (text);
 
300
                        
 
301
                        double text_scale = (DockPreferences.IconSize / 64.0);
 
302
                        int text_height = Math.Max (11, (int) (15 * text_scale));
 
303
                                
 
304
                        Pango.Color color = new Pango.Color ();
 
305
                        color.Blue = color.Red = color.Green = ushort.MaxValue;
 
306
                        
 
307
                        Gdk.Rectangle rect = TextUtility.RenderLayoutText (cr, text, base_x, 
 
308
                                                                           dockArea.Y + (int) (15 * text_scale), 
 
309
                                                                           (dockArea.X + dockArea.Width) - (base_x + 15), text_height,
 
310
                                                                           color, Pango.Alignment.Left, Pango.EllipsizeMode.None);
 
311
                        
 
312
                        cr.Rectangle (rect.X, rect.Y, 2, rect.Height);
 
313
                        cr.Color = new Cairo.Color (1, 1, 1);
 
314
                        cr.Fill ();
 
315
                }
 
316
                
 
317
                void RenderTextModeText (Context cr, ref Gdk.Rectangle dockArea)
 
318
                {
 
319
                        int base_x = dockArea.X + 15;
 
320
                        
 
321
                        string text;
 
322
                        Element current = State [State.CurrentPane];
 
323
 
 
324
                        if (current == null)
 
325
                                text = State.GetPaneQuery (State.CurrentPane);
 
326
                        else if (current is ITextItem)
 
327
                                text = (current as ITextItem).Text;
 
328
                        else
 
329
                                text = current.Name;
 
330
 
 
331
                        if (string.IsNullOrEmpty (text))
 
332
                                return;
 
333
 
 
334
                        text = GLib.Markup.EscapeText (text);
 
335
                        
 
336
                        double text_scale = (DockPreferences.IconSize / 64.0);
 
337
                        int text_height = Math.Max (11, (int) (15 * text_scale));
 
338
                        
 
339
                        Pango.Color color = new Pango.Color ();
 
340
                        color.Blue = color.Red = color.Green = ushort.MaxValue;
 
341
                        
 
342
                        TextUtility.RenderLayoutText (cr, text, base_x + TextOffset, 
 
343
                                                      dockArea.Y + (int) (15 * text_scale), (dockArea.X + dockArea.Width) - (base_x + TextOffset + 40), 
 
344
                                                      text_height, color, Pango.Alignment.Left, Pango.EllipsizeMode.None);
 
345
                }
 
346
                
 
347
                void RenderText (Context cr, string text, ref Gdk.Rectangle dockArea)
 
348
                {
 
349
                        int base_x = dockArea.X + 15;
 
350
                        
 
351
                        double text_scale = (DockPreferences.IconSize / 64.0);
 
352
                        
 
353
                        int text_height = (int) (20 * text_scale);
 
354
                                
 
355
                        Pango.Color color = new Pango.Color ();
 
356
                        color.Blue = color.Red = color.Green = ushort.MaxValue;
 
357
                        
 
358
                        TextUtility.RenderLayoutText (cr, text, base_x + TextOffset, 
 
359
                                                      dockArea.Y + (int) (15 * text_scale), (dockArea.X + dockArea.Width) - (base_x + TextOffset + 40), 
 
360
                                                      text_height, color, Pango.Alignment.Left, Pango.EllipsizeMode.End);
 
361
                }
 
362
                
 
363
                void RenderAddButton (Context cr, ref Gdk.Rectangle dockArea, ref Gdk.Point cursor)
 
364
                {
 
365
                        Gdk.Point buttonCenter = GetButtonCenter (ref dockArea);
 
366
                        
 
367
                        int x = buttonCenter.X - IconSize / 2;
 
368
                        int y = buttonCenter.Y - IconSize / 2;
 
369
                        
 
370
                        cr.SetRoundedRectanglePath (x, y, IconSize, IconSize, IconSize / 2);
 
371
                        cr.LineWidth = 2;
 
372
                        // fixme
 
373
                        cr.Color = new Cairo.Color (1, 1, 1);
 
374
                        cr.Stroke ();
 
375
                        
 
376
                        cr.MoveTo (x + IconSize / 2, y + 4);
 
377
                        cr.LineTo (x + IconSize / 2, y + (IconSize - 4));
 
378
                        cr.MoveTo (x + 4, y + IconSize / 2);
 
379
                        cr.LineTo (x + (IconSize - 4), y + IconSize / 2);
 
380
                        cr.Stroke ();
 
381
                }
 
382
                
 
383
                void GetXForPane (ref Gdk.Rectangle dockArea, Pane pane, out int left_x, out double zoom)
 
384
                {
 
385
                        int base_x = dockArea.X + 15;
 
386
                        double zoom_value = .3;
 
387
                        double slide_state = Math.Min (1, (DateTime.UtcNow - State.CurrentPaneTime).TotalMilliseconds / DockArea.BaseAnimationTime.TotalMilliseconds);
 
388
                        
 
389
                        double growing_zoom = zoom_value + slide_state * (1 - zoom_value);
 
390
                        double shrinking_zoom = zoom_value + (1 - slide_state) * (1 - zoom_value);
 
391
                        switch (pane) {
 
392
                        case Pane.First:
 
393
                                left_x = base_x;
 
394
                                if (State.CurrentPane == Pane.First && (State.PreviousPane == Pane.Second || State.PreviousPane == Pane.Third)) {
 
395
                                        zoom = growing_zoom;
 
396
                                } else if (State.PreviousPane == Pane.First && (State.CurrentPane == Pane.Second || State.CurrentPane == Pane.Third)) {
 
397
                                        zoom = shrinking_zoom;
 
398
                                } else {
 
399
                                        zoom = zoom_value;
 
400
                                }
 
401
                                break;
 
402
                        case Pane.Second:
 
403
                                if (State.PreviousPane == Pane.Second && State.CurrentPane == Pane.First) {
 
404
                                        zoom = shrinking_zoom;
 
405
                                        left_x = base_x + (int) ((DockPreferences.IconSize * 2) * (growing_zoom));
 
406
                                } else if (State.PreviousPane == Pane.Second && State.CurrentPane == Pane.Third) {
 
407
                                        zoom = shrinking_zoom;
 
408
                                        left_x = base_x + (int) (DockPreferences.IconSize * 2 * zoom_value);
 
409
                                } else if (State.PreviousPane == Pane.First && State.CurrentPane == Pane.Second) {
 
410
                                        zoom = growing_zoom;
 
411
                                        left_x = base_x + (int) ((DockPreferences.IconSize * 2) * (shrinking_zoom));
 
412
                                } else if (State.PreviousPane == Pane.First && State.CurrentPane == Pane.Third) {
 
413
                                        zoom = zoom_value;
 
414
                                        left_x = base_x + (int) ((DockPreferences.IconSize * 2) * (shrinking_zoom));
 
415
                                } else if (State.PreviousPane == Pane.Third && State.CurrentPane == Pane.First) {
 
416
                                        zoom = zoom_value;
 
417
                                        left_x = base_x + (int) ((DockPreferences.IconSize * 2) * (growing_zoom));
 
418
                                } else {// (State.PreviousPane == Pane.Third && State.CurrentPane == Pane.Second) {
 
419
                                        zoom = growing_zoom;
 
420
                                        left_x = base_x + (int) (DockPreferences.IconSize * 2 * zoom_value);
 
421
                                }
 
422
                                break;
 
423
                        default:
 
424
                                if (State.PreviousPane == Pane.Second && State.CurrentPane == Pane.First) {
 
425
                                        zoom = zoom_value;
 
426
                                        left_x = base_x + (int) (DockPreferences.IconSize * 2 * (1 + zoom_value));
 
427
                                } else if (State.PreviousPane == Pane.Second && State.CurrentPane == Pane.Third) {
 
428
                                        zoom = growing_zoom;
 
429
                                        left_x = base_x + (int) (DockPreferences.IconSize * 2 * zoom_value) + (int) ((DockPreferences.IconSize * 2) * (shrinking_zoom));
 
430
                                } else if (State.PreviousPane == Pane.First && State.CurrentPane == Pane.Second) {
 
431
                                        zoom = zoom_value;
 
432
                                        left_x = base_x + (int) (DockPreferences.IconSize * 2 * (1 + zoom_value));
 
433
                                } else if (State.PreviousPane == Pane.First && State.CurrentPane == Pane.Third) {
 
434
                                        zoom = growing_zoom;
 
435
                                        left_x = base_x + (int) (DockPreferences.IconSize * 2 * zoom_value) + (int) ((DockPreferences.IconSize * 2) * (shrinking_zoom));
 
436
                                } else if (State.PreviousPane == Pane.Third && State.CurrentPane == Pane.First) {
 
437
                                        zoom = shrinking_zoom;
 
438
                                        left_x = base_x + (int) (DockPreferences.IconSize * 2 * zoom_value) + (int) ((DockPreferences.IconSize * 2) * (growing_zoom));
 
439
                                } else {// (State.PreviousPane == Pane.Third && State.CurrentPane == Pane.Second) {
 
440
                                        zoom = shrinking_zoom;
 
441
                                        left_x = base_x + (int) (DockPreferences.IconSize * 2 * zoom_value) + (int) ((DockPreferences.IconSize * 2) * (growing_zoom));
 
442
                                }
 
443
                                break;
 
444
                        }
 
445
                        double offset_scale = 1;
 
446
                        left_x = (int) (left_x * offset_scale + base_x * (1 - offset_scale));
 
447
                }
 
448
                
 
449
                DrawState PaneDrawState (Pane pane)
 
450
                {
 
451
                        if (pane != State.CurrentPane && (State.GetTextModeType (State.CurrentPane) == TextModeType.Explicit))
 
452
                                return DrawState.None;
 
453
                        
 
454
                        if (pane == Pane.Third && !State.ThirdPaneVisible)
 
455
                                return DrawState.None;
 
456
                        
 
457
                        if (State.GetTextModeType (pane) == TextModeType.Explicit)
 
458
                                return DrawState.ExplicitText;
 
459
                        
 
460
                        if (State.GetTextMode (pane))
 
461
                                return DrawState.Text;
 
462
                        
 
463
                        if (State.GetPaneItem (pane) != null)
 
464
                                return DrawState.Normal;
 
465
                        
 
466
                        if (!string.IsNullOrEmpty (State.GetPaneQuery (pane))) {
 
467
                                return DrawState.NoResult;
 
468
                        }
 
469
 
 
470
                        return DrawState.None;
 
471
                }
 
472
 
 
473
                public void Dispose ()
 
474
                {
 
475
                        UnregisterEvents ();
 
476
                        TextUtility.Dispose ();
 
477
                        TextUtility = null;
 
478
                }
 
479
        }
 
480
}