~ubuntu-branches/ubuntu/wily/gnome-do/wily

« back to all changes in this revision

Viewing changes to Do.Interface.Linux.Docky/src/Docky.Interface/Util.cs

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2009-06-27 10:40:45 UTC
  • mfrom: (1.1.8 upstream) (0.1.5 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090627104045-7st10y1cqr6dpz37
Tags: 0.8.2+dfsg-1
* New upstream release
  + No longer uses a plugin repository.  Fixes many plugin-
    related issues. (LP: #343096, LP: #330025, LP #345001)
  + No longer blocks on "About Do" (LP: #361679)
  + Reacts correctly when a Composite manager is enabled/
    disabled at runtime. (LP: #346347, LP: #390150)
  + Fixes for space reserved by Docky blocking drag and 
    drop operations. (LP: #354729, LP: #347052, LP: #382843)
  + Properly sets "Hidden" key on autostart files in response to 
    "Start on login" option.  (Closes: #526023) (LP: #369988)
* debian/patches/10_application_search_path:
  + Drop; included upstream
* debian/patches/10_sk_translation_update:
  + Import sk translation update from Debian BTS.
    (Closes: #531779)
* debian/patches/11_fix_autostart_when_directory_does_not_exist:
  + Patch from upstream.  Fixes the "Start on login" option when the 
    ~/.config/autostart directory does not exist. (LP: #393729)
* debian/control:
  + Update standards version to 3.8.2; no changes required.
  + Add libtool to Build-Depends; required for autoreconf.
  + Add Recommends: on new gnome-do-docklets package.
* debian/gnome-do.1
  + Fix spelling: GNOME-Do => GNOME Do.
  + Miscelaneous lintian fixes; NAME section, escaping minus signs with \-
* debian/copyright:
  + Update for new copyright holders.
  + Minor update to DEP-5 format

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
namespace Docky.Interface
33
33
{
34
 
        public enum ClickAction {
35
 
                Focus,
36
 
                Minimize,
37
 
                Restore,
38
 
                None,
39
 
        }
40
34
 
41
35
        public enum IconSource {
42
36
                Statistics,
43
37
                Custom,
44
38
                Application,
 
39
                Docklet,
45
40
                Unknown,
46
41
        }
47
42
        
60
55
                const int Height = 35;
61
56
                const string FormatString = "<span weight=\"600\">{0}</span>";
62
57
                
63
 
                public static Surface GetBorderedTextSurface (string text, int maxWidth, Surface similar) 
64
 
                {
65
 
                        return GetBorderedTextSurface (text, maxWidth, similar, DockOrientation.Bottom);
66
 
                }
67
 
                
68
58
                /// <summary>
69
59
                /// Gets a surface containing a transparent black rounded rectangle with the provided text on top.
70
60
                /// </summary>
81
71
                /// A <see cref="Surface"/>
82
72
                /// </returns>
83
73
                public static Surface GetBorderedTextSurface (string text, int maxWidth, Surface similar, 
84
 
                                                              DockOrientation orientation)
 
74
                                                              DockOrientation orientation, out Gdk.Rectangle size)
85
75
                {
86
76
                        Surface sr;
87
 
                        sr = similar.CreateSimilar (similar.Content, maxWidth, Height);
 
77
                        // we are going to give ourselves a bit of a buffer due to pango weirdness
 
78
                        sr = similar.CreateSimilar (similar.Content, maxWidth + 5, Height);
88
79
                        
89
80
                        Context cr = new Context (sr);
90
81
                        
94
85
                        Gdk.Rectangle textArea = Core.DockServices.DrawingService.TextPathAtPoint (textContext);
95
86
                        cr.NewPath ();
96
87
                        
 
88
                        size = new Gdk.Rectangle (0, 0, textArea.Width + 20, Height);
 
89
                        textContext.MaximumWidth = textArea.Width;
 
90
                        
 
91
                        
97
92
                        int localHeight = textArea.Height;
98
 
                        cr.SetRoundedRectanglePath (textArea.X + .5,  .5, textArea.Width + 20 - 1,  localHeight + 10 - 1, 5);
 
93
                        cr.SetRoundedRectanglePath (.5, .5, textArea.Width + 20 - 1, localHeight + 10 - 1, 5);
99
94
                        
100
95
                        cr.Color = new Cairo.Color (0.1, 0.1, 0.1, .75);
101
96
                        cr.FillPreserve ();