summaryrefslogtreecommitdiff
path: root/jni/ruby/ext/tk/sample/tkextlib/tile/themes/plastik/plastik.tcl
blob: cba5ebd3d421fdf3405ffd0493159ba1f1ee0c97 (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
# plastik.tcl - Copyright (C) 2004 Googie
#
# A sample pixmap theme for the tile package.
#
#  Copyright (c) 2004 Googie
#  Copyright (c) 2005 Pat Thoyts <patthoyts@users.sourceforge.net>
#
# $Id: plastik.tcl 25189 2009-10-02 12:04:37Z akr $

package require Tk 8.4
package require tile 0.5

namespace eval tile::theme::plastik {

    variable version 0.3.1
    package provide tile::theme::plastik $version

    variable imgdir [file join [file dirname [info script]] plastik]
    variable Images;
    array set Images [tile::LoadImages $imgdir *.gif]

    variable colors
    array set colors {
        -frame          "#cccccc"
        -disabledfg     "#aaaaaa"
        -selectbg       "#657a9e"
        -selectfg       "#ffffff"
    }

style theme create plastik -parent default -settings {
    style default . \
        -background $colors(-frame\
        -troughcolor $colors(-frame) \
        -selectbackground $colors(-selectbg) \
        -selectforeground $colors(-selectfg) \
        -font TkDefaultFont \
        -borderwidth 1 \
        ;

    style map . -foreground [list disabled $colors(-disabledfg)]

    #
    # Layouts:
    #
    style layout Vertical.TScrollbar {
        Scrollbar.background
        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.background
        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 layout TButton {
        Button.button -children {
            Button.focus -children {
                Button.padding -children {
                    Button.label -side left -expand true
                }
            }
        }
    }

    #
    # Elements:
    #
    style element create Button.button image $Images(button-n) \
        -border 4 -sticky ew \
        -map [list pressed $Images(button-p)  active $Images(button-h)]

    style element create Checkbutton.indicator image $Images(check-nu) \
        -sticky {} -map [list \
            {active selected}     $Images(check-hc) \
            {pressed selected}    $Images(check-pc) \
            active                $Images(check-hu) \
            selected              $Images(check-nc) \
        ]

    style element create Radiobutton.indicator image $Images(radio-nu) \
        -sticky {} -map [list \
            {active selected}     $Images(radio-hc) \
            {pressed selected}    $Images(radio-pc) \
            active                $Images(radio-hu) \
            selected              $Images(radio-nc) \
        ]

    style element create Horizontal.Scrollbar.thumb \
        image $Images(hsb-n) -border 3 -sticky ew
    style element create Vertical.Scrollbar.thumb \
        image $Images(vsb-n) -border 3 -sticky ns

    style element create Scale.slider \
        image $Images(hslider-n) -sticky {}
    style element create Vertical.Scale.slider \
        image $Images(vslider-n) -sticky {}

    style element create Scrollbar.uparrow image $Images(arrowup-n) \
        -map [list pressed $Images(arrowup-p)] -sticky {}
    style element create Scrollbar.downarrow image $Images(arrowdown-n) \
        -map [list pressed $Images(arrowdown-p)] -sticky {}
    style element create Scrollbar.leftarrow image $Images(arrowleft-n) \
        -map [list pressed $Images(arrowleft-p)] -sticky {}
    style element create Scrollbar.rightarrow image $Images(arrowright-n) \
        -map [list pressed $Images(arrowright-p)] -sticky {}

    #
    # Settings:
    #
    style default TButton -width -10
    style default TNotebook.Tab -padding {6 2 6 2}
    style default TLabelframe -borderwidth 2 -relief groove

} }