Copyright © 2008, 2009 Arndt Roger Schneider
package require rtl_all package require gistbox package require gstripes package require gstripesrtl # Deliver tkpgradient for tkpath package require gtkp option add *borderWidth 1 option add *highlightColor #4c6a71 option add *highlightBackground gray82 option add *highlightbackground gray82 option add *Entry.relief solid option add *background gray82 option add *Entry.background white option add *foreground black option add *selectColor #4c6a71 option add *gridColor gray option add *activeStyle none option add *Rtl_tabset.troughColor gray96 option add *Rtl_tabset.background gray82 # These background gradient is the # best match for the the general gradient: option add *Rtl_tabset.transientBg { 0.6 0.77 0.0 0.0} option add *Rtl_tabset.centered 1 option add *Rtl_tabset.lineColor gray57 option add *Rtl_tabset.fontfamily \ {bitstream vera sans} option add *Rtl_tabset.fontsize 11 option add *selectBackground #4c6a71 option add *selectbackground #4c6a71 option add *selectForeground white option add *selectforeground white option add *activeBackground white option add *activeForeground black option add *Menu.activeBackground #4c6a71 option add *Menu.activeForeground white option add *Grip*troughColor #8eb08e # Menus all around application. option add *Menu.activeBorderWidth 0 option add *Menu.borderWidth 2 option add *Menu.relief solid option add *Rtl_mlistbox.background white option add *Rtl_mlistbox.useColumnColors 1 option add *Rtl_mlistbox.color1 gray96 option add *Rtl_mlistbox.color3 gray96 # Outer border ... turned off! option add *Gistbox.borderWidth 0; # Scrollbars: Customize Scrollbars, that they # will reflect the scrolled content: white # background (listbox) white troughcolor black # foreground (listbox) black background set # elementborderwidth, borderwidth to 0 and relief # to flat... Wish there were relief solid for # element relief... option add *Rtl_gridwin.elementborderwidth 2 option add *Rtl_gridwin*Scrollbar.background \ white option add \ *Rtl_gridwin*Scrollbar.activeBackground \ #4c6a71 # Hide scrollbar borders when blended in: option add *Rtl_gridwin.borderwidth 2 option add *Rtl_gridwin.relief sunken option add *Rtl_gridwin.background white option add *Rtl_gridwin.troughcolor white option add *Galette*Rtl_gridwin.relief flat # Make sure Lisboxes and Text # are rendered properly. foreach class {Text Listbox } { option add *Rtl_gridwin*${class}.borderWidth 0 option add \ *Rtl_gridwin*${class}.highlightThickness 0 } option add *font {{bitstream vera sans} 12} option add \ *Rtl_mlistbox.headerFont \ {{bitstream vera sans} 11} option add *Entry.font \ {{bitstream vera sans} 12} option add *Listbox.font \ {{bitstream vera sans} 12} option add *Message.font \ {{bitstream vera sans} 11} option add *Goolbar.font \ {{bitstream vera sans} 12} option add *Text.font \ {{bitstream vera sans mono} 12} option add *Scrollbar.highlightThickness 0 option add *Scrollbar.width 11 option add *Scrollbar.hight 11 option add *Rtl_gridwin.scrollborderwidth 0 option add *Rtl_gridwin.scrollrelief sunken option add *Label.borderWidth 0 option add *Message.borderWidth 0 option add *Label.pady 0 option add *selectBorderWidth 0 option add *Goolbar.gridSize 88 # palettes: option add *Galette.borderwidth 0 option add \ *Galette.toolbar.gridwin.highlightthickness 0 option add \ *Galette.toolbar.gridwin.troughcolor gray57 option add *stripesTransparentColor white option add *stripesOpacity 0.1 #option add *stripes.gradientType gray61 option add *stripes 1 option add *stripesColor gray96 option add *Galette*stripesColor #c3d1bb # Disable stripes for the toolbar, # but leave them on for Galettes. option add *maintoolbar.stripes 0 option add *Button.borderWidth 2 option add *Menubutton.borderWidth 2 option add *Button.relief groove option add *Menubutton.relief groove option add *Gooleditor.borderWidth 0 option add *Rtl_gridwin.highlightthickness 2 option add *Entry.highlightThickness 2 option add *Button.highlightThickness 2 option add *Checkutton.highlightThickness 2 option add *Radioutton.highlightThickness 2 option add *Menubutton.highlightThickness 2 # Mac-look-alike option add *SingleLineMenubar*borderWidth 0 # Auto hide scrollbars when possible option add *Rtl_gridwin.autoHide 1 option add *Rtl_shell*Rtl_gridwin.autoHide 0 option add *Rtl_shell*Rtl_gridwin.auto 0 option add *Galette*Rtl_gridwin.autoHide 0 # Different colors for palettes option add *Galette*grip_z.relief flat option add *Galette.background gray57 option add *Galette*Scrollbar.background gray57 option add *Galette.foreground white option add *highlightColor #4c6a71 option add *Scrollbar.borderWidth 0 option add *Scrollbar.highlightThickness 0 option add *Rtl_tree.intenty 26 #option add *Rtl_combobox.highlightcolor #4c6a71 option add *Menubutton.borderWidth 1 option add *Button.borderWidth 1 option add *Button.highlightThickness 2 option add *Menubutton.highlightThickness 2 option add *Checkbutton.highlightThickness 2 #option add *Radiobutton.selectState normal option add *Radiobutton.selectColor gray option add *Checkbutton.background gray96 option add *Checkbutton.selectColor gray option add *Menu.activeBorderWidth 1 option add *Menu.actvieRelief solid option add *Radiobutton.highlightThickness 2 option add *Checkbutton.highlightThickness 2 option add *Button.highlightThickness 2 option add *Menubutton.highlightThickness 2 option add *Gistbox.irelief solid option add *Button.selectColor gray71 option add *Button.borderColor black option add *Menubutton.radius 4 option add *Rtl_combobox.borderWidth 0 #option add *Rtl_combobox.frame.borderWidth 0 ## Test Full gradient interface: option add *Rtlysizer.background gray88 option add *Rtlysizer.troughColor gray57 # Combobox examples, # only the general way is used: #option add *Rtl_combobox.borderwidth 0 #option add *Rtl_combobox.background gray96 #option add *Rtl_combobox*stripes.background \ gray96 #option add *font_combobox.background gray84 #option add *font_combobox*stripes.background \ gray84 option add *Rtl_combobox.highlightthickness 2 option add \ *Rtl_combobox*stripes.stripesCommand \ gelpstripes # Use gridwin adjust for the focus frame... option add \ *Rtl_combobox*stripes.adjustCommand \ gwadjust option add *stripes.stripesCommand gelpstripes option add *stripes.adjustCommand gelpadjust option add *Rtl_gridwin.borderFrame.gradient white option add *Rtl_gridwin.borderFrame.borderColor \ gray57 option add *Rtl_gridwin.stripes.adjustCommand \ gwadjust option add *Rtl_tabset.distant -1 # Activate some stripes inside gridwins: #option add *Rtl_chooseFont*Rtl_gridwin.stripes 1 option add *Dummy.gridwin.stripes 1 option add *Dummy*Goolbar.stripesCommand \ gelpstripes option add *Dummy*Goolbar.adjustCommand \ gelpadjust option add *Dummy*Goolbar.stripes 1 option add \ *Gooleditor*Goolbar.stripesCommand \ gelpstripes option add \ *Gooleditor*Goolbar.adjustCommand \ gelpadjust option add *Gooleditor*Goolbar.stripes 1 option add *stripesOpacity 0.2 # Creating a background gradient spanning from # white to the background colour: tkpgradient # is used to provide backward compatibility # for TkPath 0.2 to 0.3 proc gelpstripes {base canvas} { rtl::verified { rtl::debug stdout "stripes for: $base" set top [winfo toplevel $base] set rtx [winfo rootx $top] set rty [winfo rooty $top] set rtw [winfo width $top] set rth [winfo height $top] set x [winfo rootx $base] set y [winfo rooty $base] if { $rtw < 10 } { set rtw 200} if { $rth < 10 } { set rth 400} set bg [opget $base background gray] $canvas create prect \ [expr { $rtx - $x - 4 }] \ [expr { $rty - $y - 4 }] \ [expr { $rtw + ($rtx - $x) + 8 }] \ [expr { $rth + ($rty - $y) + 8 }] \ -fill [tkpgradient $canvas \ create radial \ -stops \ [list \ {0 white 0.9} \ [list 1 $bg 0.4]] \ -radialtransition { 0.477551020408 0.540983606557 1.00918367347 0.898979591837 0.139344262295}] \ -stroke {} \ -tags stripes # gstripes::stripes $base $canvas } } # How the background stripes are aligned: proc gelpadjust {base canvas args} { rtl::debug stdout "adjust stripes: $base" rtl::verified { set top [winfo toplevel $base] set rtx [winfo rootx $top] set rty [winfo rooty $top] set rtw [winfo width $top] set rth [winfo height $top] set x [winfo rootx $base] set y [winfo rooty $base] if { $y < $rty } { # menubar .... rty is larger than y! set rty $y } if { 1 == $rtw } { set rtw 470 set rth 569 } $canvas coords stripes \ [expr { $rtx - $x - 4 }] \ [expr { $rty - $y - 4 }] \ [expr { $rtw + ($rtx - $x) + 8 }] \ [expr { $rth + ($rty - $y) + 8 }] } } # Focus adjustment for gridwin and combobox: proc gwadjust {base canvas} { gelpadjust $base $canvas set gridwin [winfo parent $base] if ![string first $gridwin [focus]] { $gridwin focusIn } }