mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/tk/sample/tkextlib/tile/themes/kroc.{rb,tcl}: also support tile 0.4.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1049fd5f64
commit
15dfe8eee6
3 changed files with 29 additions and 9 deletions
|
@ -1,3 +1,7 @@
|
|||
2005-06-07 ocean <ocean@ruby-lang.org>
|
||||
|
||||
* sample/tkextlib/tile/themes/kroc.{rb,tcl}: also support tile 0.4.
|
||||
|
||||
2005-06-07 ocean <ocean@ruby-lang.org>
|
||||
|
||||
* sample/tkextlib/tile/themes/kroc.{rb,tcl}: support tile 0.5 or later.
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
imgdir = File.join(File.dirname(__FILE__), 'kroc')
|
||||
$images = Tk::Tile.load_images(imgdir, '*.gif')
|
||||
|
||||
if TkPackage.vcompare(Tk::Tile.package_version, '0.5') >= 0
|
||||
$TNotebook_Tab = Tk::Tile::TNotebook.style('Tab')
|
||||
else
|
||||
$TNotebook_Tab = 'Tab.TNotebook'
|
||||
end
|
||||
|
||||
def kroc_rb_settings
|
||||
# Tk::Tile::Style.default(TkRoot, :background=>'#FCB64F',
|
||||
# :troughcolor=>'#F8C278', :borderwidth=>1)
|
||||
|
@ -52,10 +58,10 @@ def kroc_rb_settings
|
|||
Tk::Tile::Style.default(Tk::Tile::TButton, :padding=>[10,4])
|
||||
|
||||
# Tk::Tile::Style.default('TNotebook.Tab',
|
||||
Tk::Tile::Style.default(Tk::Tile::TNotebook.style('Tab'),
|
||||
Tk::Tile::Style.default($TNotebook_Tab,
|
||||
:padding=>[10, 3], :font=>Tk::Tile::Font::Default)
|
||||
# Tk::Tile::Style.map('TNotebook.Tab',
|
||||
Tk::Tile::Style.map(Tk::Tile::TNotebook.style('Tab'),
|
||||
Tk::Tile::Style.map($TNotebook_Tab,
|
||||
:background=>[:selected, '#FCB64F', '', '#FFE6BA'],
|
||||
:foreground=>['', 'black'],
|
||||
:padding=>[:selected, [10, 6, 10, 3]])
|
||||
|
@ -162,6 +168,7 @@ def kroc_rb_settings
|
|||
|
||||
# Tk::Tile::Style.layout(Tk::Tile::TCheckbutton,
|
||||
Tk::Tile::Style.layout('TCheckbutton', [
|
||||
'Checkbutton.background', # this is not needed in tile 0.5 or later
|
||||
'Checkbutton.border', {:children=>[
|
||||
'Checkbutton.padding', {:children=>[
|
||||
'Checkbutton.indicator', {:side=>:left},
|
||||
|
@ -174,6 +181,7 @@ def kroc_rb_settings
|
|||
|
||||
# Tk::Tile::Style.layout(Tk::Tile::TRadiobutton,
|
||||
Tk::Tile::Style.layout('TRadiobutton', [
|
||||
'Radiobutton.background', # this is not needed in tile 0.5 or later
|
||||
'Radiobutton.border', {:children=>[
|
||||
'Radiobutton.padding', {:children=>[
|
||||
'Radiobutton.indicator', {:side=>:left},
|
||||
|
|
|
@ -15,6 +15,12 @@ namespace eval tile::kroc {
|
|||
set imgdir [file join [file dirname [info script]] kroc]
|
||||
array set Images [tile::LoadImages $imgdir *.gif]
|
||||
|
||||
if {[package vsatisfies [package provide tile] 0.5]} {
|
||||
set TNoteBook_Tab TNotebook.Tab
|
||||
} else {
|
||||
set TNoteBook_Tab Tab.TNotebook
|
||||
}
|
||||
|
||||
style theme create kroc -parent alt -settings {
|
||||
|
||||
style default . -background #FCB64F -troughcolor #F8C278 -borderwidth 1
|
||||
|
@ -24,8 +30,8 @@ namespace eval tile::kroc {
|
|||
|
||||
style default TButton -padding "10 4"
|
||||
|
||||
style default TNotebook.Tab -padding {10 3} -font TkDefaultFont
|
||||
style map TNotebook.Tab \
|
||||
style default $TNoteBook_Tab -padding {10 3} -font TkDefaultFont
|
||||
style map $TNoteBook_Tab \
|
||||
-background [list selected #FCB64F {} #FFE6BA] \
|
||||
-foreground [list {} black] \
|
||||
-padding [list selected {10 6 10 3}]
|
||||
|
@ -112,7 +118,7 @@ namespace eval tile::kroc {
|
|||
}
|
||||
|
||||
#
|
||||
# Settings:
|
||||
# Settings: (*button.background is not needed in tile 0.5 or above)
|
||||
#
|
||||
style layout TButton {
|
||||
Button.button -children {
|
||||
|
@ -126,6 +132,7 @@ namespace eval tile::kroc {
|
|||
|
||||
style layout TCheckbutton {
|
||||
Checkbutton.border -children {
|
||||
Checkbutton.background
|
||||
Checkbutton.padding -children {
|
||||
Checkbutton.indicator -side left
|
||||
Checkbutton.focus -side left -children {
|
||||
|
@ -137,6 +144,7 @@ namespace eval tile::kroc {
|
|||
|
||||
style layout TRadiobutton {
|
||||
Radiobutton.border -children {
|
||||
Radiobutton.background
|
||||
Radiobutton.padding -children {
|
||||
Radiobutton.indicator -side left
|
||||
Radiobutton.focus -expand true -sticky w -children {
|
||||
|
|
Loading…
Reference in a new issue