3
// Copyright (C) 2008 GNOME Do
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.
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.
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/>.
25
using Do.Interface.CairoUtils;
27
using Docky.Utilities;
29
namespace Docky.Interface
31
public class SeparatorItem : BaseDockItem
34
#region IDockItem implementation
36
public override string Description {
40
public override int Width {
41
get { return (int) (DockPreferences.IconSize * .3); }
44
public override bool Scalable {
50
public SeparatorItem ()
52
AnimationType = ClickAnimationType.None;
53
DockPreferences.IconSizeChanged += HandleIconSizeChanged;
56
void HandleIconSizeChanged ()
63
protected override Pixbuf GetSurfacePixbuf ()
69
public override Surface GetIconSurface (Surface buffer)
72
sr = buffer.CreateSimilar (buffer.Content, Width, DockPreferences.IconSize);
73
Context cr = new Context (sr);
76
for (int i=1; i*6+2 < Height; i++) {
77
cr.Rectangle (Width/2-1, i*6, 4, 2);
80
cr.Color = new Cairo.Color (1, 1, 1, .3);
83
(cr as IDisposable).Dispose ();
88
public override Surface GetTextSurface (Surface similar)
93
#region IDisposable implementation
95
public override void Dispose ()
97
DockPreferences.IconSizeChanged -= HandleIconSizeChanged;
106
public override bool Equals (BaseDockItem other)
108
return GetHashCode ().Equals (other.GetHashCode ());