clamTheme.tcl 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #
  2. # "Clam" theme.
  3. #
  4. # Inspired by the XFCE family of Gnome themes.
  5. #
  6. namespace eval ttk::theme::clam {
  7. variable colors
  8. array set colors {
  9. -disabledfg "#999999"
  10. -frame "#dcdad5"
  11. -window "#ffffff"
  12. -dark "#cfcdc8"
  13. -darker "#bab5ab"
  14. -darkest "#9e9a91"
  15. -lighter "#eeebe7"
  16. -lightest "#ffffff"
  17. -selectbg "#4a6984"
  18. -selectfg "#ffffff"
  19. -altindicator "#5895bc"
  20. -disabledaltindicator "#a0a0a0"
  21. }
  22. ttk::style theme settings clam {
  23. ttk::style configure "." \
  24. -background $colors(-frame) \
  25. -foreground black \
  26. -bordercolor $colors(-darkest) \
  27. -darkcolor $colors(-dark) \
  28. -lightcolor $colors(-lighter) \
  29. -troughcolor $colors(-darker) \
  30. -selectbackground $colors(-selectbg) \
  31. -selectforeground $colors(-selectfg) \
  32. -selectborderwidth 0 \
  33. -font TkDefaultFont \
  34. ;
  35. ttk::style map "." \
  36. -background [list disabled $colors(-frame) \
  37. active $colors(-lighter)] \
  38. -foreground [list disabled $colors(-disabledfg)] \
  39. -selectbackground [list !focus $colors(-darkest)] \
  40. -selectforeground [list !focus white] \
  41. ;
  42. # -selectbackground [list !focus "#847d73"]
  43. ttk::style configure TButton \
  44. -anchor center -width -11 -padding 5 -relief raised
  45. ttk::style map TButton \
  46. -background [list \
  47. disabled $colors(-frame) \
  48. pressed $colors(-darker) \
  49. active $colors(-lighter)] \
  50. -lightcolor [list pressed $colors(-darker)] \
  51. -darkcolor [list pressed $colors(-darker)] \
  52. -bordercolor [list alternate "#000000"] \
  53. ;
  54. ttk::style configure Toolbutton \
  55. -anchor center -padding 2 -relief flat
  56. ttk::style map Toolbutton \
  57. -relief [list \
  58. disabled flat \
  59. selected sunken \
  60. pressed sunken \
  61. active raised] \
  62. -background [list \
  63. disabled $colors(-frame) \
  64. pressed $colors(-darker) \
  65. active $colors(-lighter)] \
  66. -lightcolor [list pressed $colors(-darker)] \
  67. -darkcolor [list pressed $colors(-darker)] \
  68. ;
  69. ttk::style configure TCheckbutton \
  70. -indicatorbackground "#ffffff" \
  71. -indicatormargin {1 1 4 1} \
  72. -padding 2 ;
  73. ttk::style configure TRadiobutton \
  74. -indicatorbackground "#ffffff" \
  75. -indicatormargin {1 1 4 1} \
  76. -padding 2 ;
  77. ttk::style map TCheckbutton -indicatorbackground \
  78. [list pressed $colors(-frame) \
  79. {!disabled alternate} $colors(-altindicator) \
  80. {disabled alternate} $colors(-disabledaltindicator) \
  81. disabled $colors(-frame)]
  82. ttk::style map TRadiobutton -indicatorbackground \
  83. [list pressed $colors(-frame) \
  84. {!disabled alternate} $colors(-altindicator) \
  85. {disabled alternate} $colors(-disabledaltindicator) \
  86. disabled $colors(-frame)]
  87. ttk::style configure TMenubutton \
  88. -width -11 -padding 5 -relief raised
  89. ttk::style configure TEntry -padding 1 -insertwidth 1
  90. ttk::style map TEntry \
  91. -background [list readonly $colors(-frame)] \
  92. -bordercolor [list focus $colors(-selectbg)] \
  93. -lightcolor [list focus "#6f9dc6"] \
  94. -darkcolor [list focus "#6f9dc6"] \
  95. ;
  96. ttk::style configure TCombobox -padding 1 -insertwidth 1
  97. ttk::style map TCombobox \
  98. -background [list active $colors(-lighter) \
  99. pressed $colors(-lighter)] \
  100. -fieldbackground [list {readonly focus} $colors(-selectbg) \
  101. readonly $colors(-frame)] \
  102. -foreground [list {readonly focus} $colors(-selectfg)] \
  103. -arrowcolor [list disabled $colors(-disabledfg)]
  104. ttk::style configure ComboboxPopdownFrame \
  105. -relief solid -borderwidth 1
  106. ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0}
  107. ttk::style map TSpinbox \
  108. -background [list readonly $colors(-frame)] \
  109. -arrowcolor [list disabled $colors(-disabledfg)]
  110. ttk::style configure TNotebook.Tab -padding {6 2 6 2}
  111. ttk::style map TNotebook.Tab \
  112. -padding [list selected {6 4 6 2}] \
  113. -background [list selected $colors(-frame) {} $colors(-darker)] \
  114. -lightcolor [list selected $colors(-lighter) {} $colors(-dark)] \
  115. ;
  116. # Treeview:
  117. ttk::style configure Heading \
  118. -font TkHeadingFont -relief raised -padding {3}
  119. ttk::style configure Treeview -background $colors(-window)
  120. ttk::style map Treeview \
  121. -background [list disabled $colors(-frame)\
  122. selected $colors(-selectbg)] \
  123. -foreground [list disabled $colors(-disabledfg) \
  124. selected $colors(-selectfg)]
  125. ttk::style configure TLabelframe \
  126. -labeloutside true -labelmargins {0 0 0 4} \
  127. -borderwidth 2 -relief raised
  128. ttk::style configure TProgressbar -background $colors(-frame)
  129. ttk::style configure Sash -sashthickness 6 -gripcount 10
  130. }
  131. }