~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockVisualStyle.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// DockVisualStyle.cs
 
3
//
 
4
// Author:
 
5
//       Lluis Sanchez <lluis@xamarin.com>
 
6
//
 
7
// Copyright (c) 2012 Xamarin Inc
 
8
//
 
9
// Permission is hereby granted, free of charge, to any person obtaining a copy
 
10
// of this software and associated documentation files (the "Software"), to deal
 
11
// in the Software without restriction, including without limitation the rights
 
12
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
13
// copies of the Software, and to permit persons to whom the Software is
 
14
// furnished to do so, subject to the following conditions:
 
15
//
 
16
// The above copyright notice and this permission notice shall be included in
 
17
// all copies or substantial portions of the Software.
 
18
//
 
19
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
20
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
21
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
22
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
23
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
24
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
25
// THE SOFTWARE.
 
26
using System;
 
27
 
 
28
namespace MonoDevelop.Components.Docking
 
29
{
 
30
        public sealed class DockVisualStyle
 
31
        {
 
32
                public Gdk.Color? PadBackgroundColor { get; set; }
 
33
                public Gdk.Color? PadTitleLabelColor { get; set; }
 
34
                public DockTabStyle? TabStyle { get; set; }
 
35
                public Gdk.Color? TreeBackgroundColor { get; set; }
 
36
                public bool? ShowPadTitleIcon { get; set; }
 
37
                public bool? UppercaseTitles { get; set; }
 
38
                public bool? ExpandedTabs { get; set; }
 
39
                public Gdk.Color? InactivePadBackgroundColor { get; set; }
 
40
                public int? PadTitleHeight { get; set; }
 
41
 
 
42
                // When set, pads in a region with this style can't be stacked horizontally
 
43
                public bool? SingleColumnMode { get; set; }
 
44
 
 
45
                // When set, pads in a region with this style can't be stacked vertically
 
46
                public bool? SingleRowMode { get; set; }
 
47
 
 
48
                public DockVisualStyle ()
 
49
                {
 
50
                }
 
51
 
 
52
                public DockVisualStyle Clone ()
 
53
                {
 
54
                        return (DockVisualStyle) MemberwiseClone ();
 
55
                }
 
56
 
 
57
                public void CopyValuesFrom (DockVisualStyle style)
 
58
                {
 
59
                        if (style.PadBackgroundColor != null)
 
60
                                PadBackgroundColor = style.PadBackgroundColor;
 
61
                        if (style.PadTitleLabelColor != null)
 
62
                                PadTitleLabelColor = style.PadTitleLabelColor;
 
63
                        if (style.TabStyle != null)
 
64
                                TabStyle = style.TabStyle;
 
65
                        if (style.TreeBackgroundColor != null)
 
66
                                TreeBackgroundColor = style.TreeBackgroundColor;
 
67
                        if (style.ShowPadTitleIcon != null)
 
68
                                ShowPadTitleIcon = style.ShowPadTitleIcon;
 
69
                        if (style.UppercaseTitles != null)
 
70
                                UppercaseTitles = style.UppercaseTitles;
 
71
                        if (style.ExpandedTabs != null)
 
72
                                ExpandedTabs = style.ExpandedTabs;
 
73
                        if (style.InactivePadBackgroundColor != null)
 
74
                                InactivePadBackgroundColor = style.InactivePadBackgroundColor;
 
75
                        if (style.PadTitleHeight != null)
 
76
                                PadTitleHeight = style.PadTitleHeight;
 
77
                        if (style.SingleColumnMode != null)
 
78
                                SingleColumnMode = style.SingleColumnMode;
 
79
                        if (style.SingleRowMode != null)
 
80
                                SingleRowMode = style.SingleRowMode;
 
81
                }
 
82
 
 
83
                public static DockVisualStyle CreateDefaultStyle ()
 
84
                {
 
85
                        DockVisualStyle s = new DockVisualStyle ();
 
86
                        s.PadBackgroundColor = new Gdk.Color (0,0,0);
 
87
                        s.PadTitleLabelColor = new Gdk.Color (0,0,0);
 
88
                        s.TabStyle = DockTabStyle.Normal;
 
89
                        s.TreeBackgroundColor = null;
 
90
                        s.ShowPadTitleIcon = true;
 
91
                        s.UppercaseTitles = false;
 
92
                        s.ExpandedTabs = false;
 
93
                        s.InactivePadBackgroundColor = new Gdk.Color (0,0,0);
 
94
                        s.PadTitleHeight = -1;
 
95
                        s.SingleRowMode = false;
 
96
                        s.SingleColumnMode = false;
 
97
                        return s;
 
98
                }
 
99
        }
 
100
 
 
101
        public enum DockTabStyle
 
102
        {
 
103
                Normal,
 
104
                Simple
 
105
        }
 
106
}
 
107