summaryrefslogtreecommitdiff
path: root/jni/ruby/ext/tk/sample/tkextlib/tile/themes/blue/blue.tcl
blob: 68733e8ad2372954321323ce7163b9b4d0bf8169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# blue.tcl - Copyright (C) 2004 Pat Thoyts <patthoyts@users.sourceforge.net>
#
# blue.tcl,v 1.27 2005/10/08 14:56:57 jenglish Exp
#
#

namespace eval tile::theme::blue {

    package provide tile::theme::blue 0.7

    set imgdir [file join [file dirname [info script]] blue]
    array set I [tile::LoadImages $imgdir *.gif]

    array set colors {
        -frame          "#6699cc"
        -lighter        "#bcd2e8"
        -window         "#e6f3ff"
        -selectbg       "#ffff33"
        -selectfg       "#000000"
        -disabledfg     "#666666"
    }

    style theme create blue -settings {

        style default . \
            -borderwidth        1 \
            -background         $colors(-frame\
            -fieldbackground    $colors(-window) \
            -troughcolor        $colors(-lighter) \
            -selectbackground   $colors(-selectbg) \
            -selectforeground   $colors(-selectfg) \
            ;
        style map . -foreground [list disabled $colors(-disabledfg)]

        ## Buttons.
        #
        style default TButton -padding "10 0"
        style layout TButton {
            Button.button -children {
                Button.focus -children {
                    Button.padding -children {
                        Button.label
                    }
                }
            }
        }

        style element create button image $I(button-n) \
            -map [list pressed $I(button-p)  active $I(button-h)] \
            -border 4 -sticky ew

        style element create Checkbutton.indicator image $I(check-nu) \
            -width 24 -sticky w -map [list \
                {!disabled active selected} $I(check-hc) \
                {!disabled active$I(check-hu) \
                {!disabled selected} $I(check-nc) ]

        style element create Radiobutton.indicator image $I(radio-nu) \
            -width 24 -sticky w -map [list \
                {!disabled active selected} $I(radio-hc) \
                {!disabled active$I(radio-hu) \
                selected $I(radio-nc) ]

        style default TMenubutton -relief raised -padding {10 2}

        ## Toolbar buttons.
        #
        style default Toolbutton \
            -width 0 -relief flat -borderwidth 2 -padding 4 \
            -background $colors(-frame) -foreground #000000 ;
        style map Toolbutton -background [list active $colors(-selectbg)]
        style map Toolbutton -foreground [list active $colors(-selectfg)]
        style map Toolbutton -relief {
            disabled    flat
            selected    sunken
            pressed     sunken
            active      raised
        }

        ## Entry widgets.
        #
        style default TEntry \
            -selectborderwidth 1 -padding 2 -insertwidth 2 -font TkTextFont
        style default TCombobox \
            -selectborderwidth 1 -padding 2 -insertwidth 2 -font TkTextFont

        ## Notebooks.
        #
        style default TNotebook.Tab -padding {4 2 4 2}
        style map TNotebook.Tab \
            -background \
                [list selected $colors(-frameactive $colors(-lighter)] \
            -padding [list selected {4 4 4 2}]

        ## Labelframes.
        #
        style default TLabelframe -borderwidth 2 -relief groove

        ## Scrollbars.
        #
        style layout Vertical.TScrollbar {
            Scrollbar.trough -children {
                Scrollbar.uparrow -side top
                Scrollbar.downarrow -side bottom
                Scrollbar.uparrow -side bottom
                Vertical.Scrollbar.thumb -side top -expand true -sticky ns
            }
        }

        style layout Horizontal.TScrollbar {
            Scrollbar.trough -children {
                Scrollbar.leftarrow -side left
                Scrollbar.rightarrow -side right
                Scrollbar.leftarrow -side right
                Horizontal.Scrollbar.thumb -side left -expand true -sticky we
            }
        }

        style element create Horizontal.Scrollbar.thumb image $I(sb-thumb) \
            -map [list {pressed !disabled} $I(sb-thumb-p)] -border 3

        style element create Vertical.Scrollbar.thumb image $I(sb-vthumb) \
            -map [list {pressed !disabled} $I(sb-vthumb-p)] -border 3

        foreach dir {up down left right} {
            style element create ${dir}arrow image $I(arrow${dir}\
                -map [list \
                    disabled $I(arrow${dir}\
                    pressed $I(arrow${dir}-p) \
                    active $I(arrow${dir}-h)] \
                -border 1 -sticky {}
        }

        ## Scales.
        #
        style element create Scale.slider \
            image $I(slider) -map [list {pressed !disabled} $I(slider-p)]

        style element create Vertical.Scale.slider \
            image $I(vslider) -map [list {pressed !disabled} $I(vslider-p)]

        style element create Horizontal.Progress.bar \
            image $I(sb-thumb) -border 2
        style element create Vertical.Progress.bar \
            image $I(sb-vthumb) -border 2

    }
}