altTheme.tcl 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #
  2. # Ttk widget set: Alternate theme
  3. #
  4. namespace eval ttk::theme::alt {
  5. variable colors
  6. array set colors {
  7. -frame "#d9d9d9"
  8. -window "#ffffff"
  9. -darker "#c3c3c3"
  10. -border "#414141"
  11. -activebg "#ececec"
  12. -disabledfg "#a3a3a3"
  13. -selectbg "#4a6984"
  14. -selectfg "#ffffff"
  15. -altindicator "#aaaaaa"
  16. }
  17. ttk::style theme settings alt {
  18. ttk::style configure "." \
  19. -background $colors(-frame) \
  20. -foreground black \
  21. -troughcolor $colors(-darker) \
  22. -bordercolor $colors(-border) \
  23. -selectbackground $colors(-selectbg) \
  24. -selectforeground $colors(-selectfg) \
  25. -font TkDefaultFont \
  26. ;
  27. ttk::style map "." -background \
  28. [list disabled $colors(-frame) active $colors(-activebg)] ;
  29. ttk::style map "." -foreground [list disabled $colors(-disabledfg)] ;
  30. ttk::style map "." -embossed [list disabled 1] ;
  31. ttk::style configure TButton \
  32. -anchor center -width -11 -padding "1 1" \
  33. -relief raised -shiftrelief 1 \
  34. -highlightthickness 1 -highlightcolor $colors(-frame)
  35. ttk::style map TButton -relief {
  36. {pressed !disabled} sunken
  37. {active !disabled} raised
  38. } -highlightcolor {alternate black}
  39. ttk::style configure TCheckbutton -indicatorcolor "#ffffff" -padding 2
  40. ttk::style configure TRadiobutton -indicatorcolor "#ffffff" -padding 2
  41. ttk::style map TCheckbutton -indicatorcolor \
  42. [list pressed $colors(-frame) \
  43. alternate $colors(-altindicator) \
  44. disabled $colors(-frame)]
  45. ttk::style map TRadiobutton -indicatorcolor \
  46. [list pressed $colors(-frame) \
  47. alternate $colors(-altindicator) \
  48. disabled $colors(-frame)]
  49. ttk::style configure TMenubutton \
  50. -width -11 -padding "3 3" -relief raised
  51. ttk::style configure TEntry -padding 1
  52. ttk::style map TEntry -fieldbackground \
  53. [list readonly $colors(-frame) disabled $colors(-frame)]
  54. ttk::style configure TCombobox -padding 1
  55. ttk::style map TCombobox -fieldbackground \
  56. [list readonly $colors(-frame) disabled $colors(-frame)] \
  57. -arrowcolor [list disabled $colors(-disabledfg)]
  58. ttk::style configure ComboboxPopdownFrame \
  59. -relief solid -borderwidth 1
  60. ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0}
  61. ttk::style map TSpinbox -fieldbackground \
  62. [list readonly $colors(-frame) disabled $colors(-frame)] \
  63. -arrowcolor [list disabled $colors(-disabledfg)]
  64. ttk::style configure Toolbutton -relief flat -padding 2
  65. ttk::style map Toolbutton -relief \
  66. {disabled flat selected sunken pressed sunken active raised}
  67. ttk::style map Toolbutton -background \
  68. [list pressed $colors(-darker) active $colors(-activebg)]
  69. ttk::style configure TScrollbar -relief raised
  70. ttk::style configure TLabelframe -relief groove -borderwidth 2
  71. ttk::style configure TNotebook -tabmargins {2 2 1 0}
  72. ttk::style configure TNotebook.Tab \
  73. -padding {4 2} -background $colors(-darker)
  74. ttk::style map TNotebook.Tab \
  75. -background [list selected $colors(-frame)] \
  76. -expand [list selected {2 2 1 0}] \
  77. ;
  78. # Treeview:
  79. ttk::style configure Heading -font TkHeadingFont -relief raised
  80. ttk::style configure Treeview -background $colors(-window)
  81. ttk::style map Treeview \
  82. -background [list disabled $colors(-frame)\
  83. selected $colors(-selectbg)] \
  84. -foreground [list disabled $colors(-disabledfg) \
  85. selected $colors(-selectfg)]
  86. ttk::style configure TScale \
  87. -groovewidth 4 -troughrelief sunken \
  88. -sliderwidth raised -borderwidth 2
  89. ttk::style configure TProgressbar \
  90. -background $colors(-selectbg) -borderwidth 0
  91. }
  92. }