~ubuntu-branches/ubuntu/hardy/ruby1.8/hardy-updates

« back to all changes in this revision

Viewing changes to ext/tk/sample/tkextlib/tile/themes/keramik/keramik.tcl

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-03-13 22:11:58 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313221158-h3oql37brlaf2go2
Tags: 1.8.6-1
* new upstream version, 1.8.6.
* libruby1.8 conflicts with libopenssl-ruby1.8 (< 1.8.6) (closes: #410018)
* changed packaging style to cdbs from dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# keramik.tcl - 
 
2
#
 
3
# A sample pixmap theme for the tile package.
 
4
#
 
5
#  Copyright (c) 2004 Googie
 
6
#  Copyright (c) 2004 Pat Thoyts <patthoyts@users.sourceforge.net>
 
7
#
 
8
# $Id: keramik.tcl 11708 2007-02-12 23:01:19Z shyouhei $
 
9
 
 
10
package require Tk 8.4;                 # minimum version for Tile
 
11
package require tile 0.5;               # depends upon tile 0.5
 
12
 
 
13
namespace eval tile {
 
14
    namespace eval theme {
 
15
        namespace eval keramik {
 
16
            variable version 0.3.2
 
17
        }
 
18
    }
 
19
}
 
20
 
 
21
namespace eval tile::theme::keramik {
 
22
 
 
23
    variable imgdir [file join [file dirname [info script]] keramik]
 
24
    variable I
 
25
    array set I [tile::LoadImages $imgdir *.gif]
 
26
 
 
27
    variable colors
 
28
    array set colors {
 
29
        -frame      "#cccccc"
 
30
        -lighter    "#cccccc"
 
31
        -window     "#ffffff"
 
32
        -selectbg   "#eeeeee"
 
33
        -selectfg   "#000000"
 
34
        -disabledfg "#aaaaaa"
 
35
    }
 
36
 
 
37
    style theme create keramik -parent alt -settings {
 
38
 
 
39
 
 
40
        # -----------------------------------------------------------------
 
41
        # Theme defaults
 
42
        #
 
43
        style default . \
 
44
            -borderwidth 1 \
 
45
            -background $colors(-frame) \
 
46
            -troughcolor $colors(-lighter) \
 
47
            -font TkDefaultFont \
 
48
            ;
 
49
 
 
50
        style map . -foreground [list disabled $colors(-disabledfg)]
 
51
                
 
52
        # -----------------------------------------------------------------
 
53
        # Button elements
 
54
        #  - the button has a large rounded border and needs a bit of
 
55
        #    horizontal padding.
 
56
        #  - the checkbutton and radiobutton have the focus drawn around 
 
57
        #    the whole widget - hence the new layouts.
 
58
        #
 
59
        style layout TButton {
 
60
            Button.background
 
61
            Button.button -children {
 
62
                Button.focus -children {
 
63
                    Button.label
 
64
                }
 
65
            }
 
66
        }
 
67
        style layout Toolbutton {
 
68
            Toolbutton.background
 
69
            Toolbutton.button -children {
 
70
                Toolbutton.focus -children {
 
71
                    Toolbutton.label
 
72
                }
 
73
            }
 
74
        }
 
75
        style element create button image $I(button-n) \
 
76
            -border {8 6 8 16} -padding {6 6} -sticky news \
 
77
            -map [list {pressed !disabled} $I(button-p) \
 
78
                      {active !selected}  $I(button-h) \
 
79
                      selected $I(button-s) \
 
80
                      disabled $I(button-d)]
 
81
        style default TButton -padding {10 6}
 
82
 
 
83
        style element create Toolbutton.button image $I(tbar-n) \
 
84
            -border {2 8 2 16} -padding {2 2} -sticky news \
 
85
            -map [list {pressed !disabled} $I(tbar-p) \
 
86
                      {active !selected}   $I(tbar-a) \
 
87
                      selected             $I(tbar-p)]
 
88
 
 
89
        style element create Checkbutton.indicator image $I(check-u) \
 
90
            -width 20 -sticky w \
 
91
            -map [list selected $I(check-c)]
 
92
 
 
93
        style element create Radiobutton.indicator image $I(radio-u) \
 
94
            -width 20 -sticky w \
 
95
            -map [list  selected $I(radio-c)]
 
96
 
 
97
        # The layout for the menubutton is modified to have a button element
 
98
        # drawn on top of the background. This means we can have transparent
 
99
        # pixels in the button element. Also, the pixmap has a special
 
100
        # region on the right for the arrow. So we draw the indicator as a
 
101
        # sibling element to the button, and draw it after (ie on top of) the
 
102
        # button image.
 
103
        style layout TMenubutton {
 
104
            Menubutton.background
 
105
            Menubutton.button -children {
 
106
                Menubutton.focus -children {
 
107
                    Menubutton.padding -children {
 
108
                        Menubutton.label -side left -expand true
 
109
                    }
 
110
                }
 
111
            }
 
112
            Menubutton.indicator -side right
 
113
        }
 
114
        style element create Menubutton.button image $I(mbut-n) \
 
115
            -map [list {active !disabled} $I(mbut-a) \
 
116
                      {pressed !disabled} $I(mbut-a) \
 
117
                      {disabled}          $I(mbut-d)] \
 
118
            -border {7 10 29 15} -padding {7 4 29 4} -sticky news
 
119
        style element create Menubutton.indicator image $I(mbut-arrow-n) \
 
120
            -width 11 -sticky w -padding {0 0 18 0}
 
121
 
 
122
        # -----------------------------------------------------------------
 
123
        # Scrollbars, scale and progress elements
 
124
        #  - the scrollbar has three arrow buttons, two at the bottom and
 
125
        #    one at the top.
 
126
        #
 
127
        style layout Vertical.TScrollbar {
 
128
            Scrollbar.background 
 
129
            Scrollbar.trough -children {
 
130
                Scrollbar.uparrow -side top
 
131
                Scrollbar.downarrow -side bottom
 
132
                Scrollbar.uparrow -side bottom
 
133
                Vertical.Scrollbar.thumb -side top -expand true -sticky ns
 
134
            }
 
135
        }
 
136
        
 
137
        style layout Horizontal.TScrollbar {
 
138
            Scrollbar.background 
 
139
            Scrollbar.trough -children {
 
140
                Scrollbar.leftarrow -side left
 
141
                Scrollbar.rightarrow -side right
 
142
                Scrollbar.leftarrow -side right
 
143
                Horizontal.Scrollbar.thumb -side left -expand true -sticky we
 
144
            }
 
145
        }
 
146
 
 
147
        style default TScrollbar -width 16
 
148
 
 
149
        style element create Horizontal.Scrollbar.thumb image $I(hsb-n) \
 
150
            -border {6 4} -width 15 -height 16 -sticky news \
 
151
            -map [list {pressed !disabled} $I(hsb-p)]
 
152
        
 
153
        style element create Vertical.Scrollbar.thumb image $I(vsb-n) \
 
154
            -border {4 6} -width 16 -height 15 -sticky news \
 
155
            -map [list {pressed !disabled} $I(vsb-p)]
 
156
        
 
157
        style element create Scale.slider image $I(hslider-n) \
 
158
            -border 3
 
159
        
 
160
        style element create Vertical.Scale.slider image $I(vslider-n) \
 
161
            -border 3
 
162
        
 
163
        style element create Horizontal.Progress.bar image $I(hsb-n) \
 
164
            -border {6 4}
 
165
        
 
166
        style element create Vertical.Progress.bar image $I(vsb-n) \
 
167
            -border {4 6}
 
168
        
 
169
        style element create uparrow image $I(arrowup-n) \
 
170
            -map [list {pressed !disabled} $I(arrowup-p)]
 
171
                  
 
172
        style element create downarrow image $I(arrowdown-n) \
 
173
            -map [list {pressed !disabled} $I(arrowdown-p)]
 
174
 
 
175
        style element create rightarrow image $I(arrowright-n) \
 
176
            -map [list {pressed !disabled} $I(arrowright-p)]
 
177
 
 
178
        style element create leftarrow image $I(arrowleft-n) \
 
179
            -map [list {pressed !disabled} $I(arrowleft-p)]
 
180
        
 
181
        # -----------------------------------------------------------------
 
182
        # Notebook elements
 
183
        #
 
184
        style element create tab image $I(tab-n) \
 
185
            -map [list selected $I(tab-p) active $I(tab-p)] \
 
186
            -border {6 6 6 2} -height 12
 
187
 
 
188
        ## Labelframes.
 
189
        #
 
190
        style default TLabelframe -borderwidth 2 -relief groove
 
191
    }
 
192
}
 
193
 
 
194
package provide tile::theme::keramik $::tile::theme::keramik::version