defaults.tcl 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. #
  2. # Settings for default theme.
  3. #
  4. namespace eval ttk::theme::default {
  5. variable colors
  6. array set colors {
  7. -frame "#d9d9d9"
  8. -foreground "#000000"
  9. -window "#ffffff"
  10. -text "#000000"
  11. -activebg "#ececec"
  12. -selectbg "#4a6984"
  13. -selectfg "#ffffff"
  14. -darker "#c3c3c3"
  15. -disabledfg "#a3a3a3"
  16. -indicator "#4a6984"
  17. }
  18. ttk::style theme settings default {
  19. ttk::style configure "." \
  20. -borderwidth 1 \
  21. -background $colors(-frame) \
  22. -foreground $colors(-foreground) \
  23. -troughcolor $colors(-darker) \
  24. -font TkDefaultFont \
  25. -selectborderwidth 1 \
  26. -selectbackground $colors(-selectbg) \
  27. -selectforeground $colors(-selectfg) \
  28. -insertwidth 1 \
  29. -indicatordiameter 10 \
  30. ;
  31. ttk::style map "." -background \
  32. [list disabled $colors(-frame) active $colors(-activebg)]
  33. ttk::style map "." -foreground \
  34. [list disabled $colors(-disabledfg)]
  35. ttk::style configure TButton \
  36. -anchor center -padding "3 3" -width -9 \
  37. -relief raised -shiftrelief 1
  38. ttk::style map TButton -relief [list {!disabled pressed} sunken]
  39. ttk::style configure TCheckbutton \
  40. -indicatorcolor "#ffffff" -indicatorrelief sunken -padding 1
  41. ttk::style map TCheckbutton -indicatorcolor \
  42. [list pressed $colors(-activebg) selected $colors(-indicator)]
  43. ttk::style configure TRadiobutton \
  44. -indicatorcolor "#ffffff" -indicatorrelief sunken -padding 1
  45. ttk::style map TRadiobutton -indicatorcolor \
  46. [list pressed $colors(-activebg) selected $colors(-indicator)]
  47. ttk::style configure TMenubutton \
  48. -relief raised -padding "10 3"
  49. ttk::style configure TEntry \
  50. -relief sunken -fieldbackground white -padding 1
  51. ttk::style map TEntry -fieldbackground \
  52. [list readonly $colors(-frame) disabled $colors(-frame)]
  53. ttk::style configure TCombobox -arrowsize 12 -padding 1
  54. ttk::style map TCombobox -fieldbackground \
  55. [list readonly $colors(-frame) disabled $colors(-frame)]
  56. ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0}
  57. ttk::style map TSpinbox -fieldbackground \
  58. [list readonly $colors(-frame) disabled $colors(-frame)] \
  59. -arrowcolor [list disabled $colors(-disabledfg)]
  60. ttk::style configure TLabelframe \
  61. -relief groove -borderwidth 2
  62. ttk::style configure TScrollbar \
  63. -width 12 -arrowsize 12
  64. ttk::style map TScrollbar \
  65. -arrowcolor [list disabled $colors(-disabledfg)]
  66. ttk::style configure TScale \
  67. -sliderrelief raised
  68. ttk::style configure TProgressbar \
  69. -background $colors(-selectbg)
  70. ttk::style configure TNotebook.Tab \
  71. -padding {4 2} -background $colors(-darker)
  72. ttk::style map TNotebook.Tab \
  73. -background [list selected $colors(-frame)]
  74. # Treeview.
  75. #
  76. ttk::style configure Heading -font TkHeadingFont -relief raised
  77. ttk::style configure Treeview \
  78. -background $colors(-window) \
  79. -foreground $colors(-text) ;
  80. ttk::style map Treeview \
  81. -background [list selected $colors(-selectbg)] \
  82. -foreground [list selected $colors(-selectfg)] ;
  83. # Combobox popdown frame
  84. ttk::style layout ComboboxPopdownFrame {
  85. ComboboxPopdownFrame.border -sticky nswe
  86. }
  87. ttk::style configure ComboboxPopdownFrame \
  88. -borderwidth 1 -relief solid
  89. #
  90. # Toolbar buttons:
  91. #
  92. ttk::style layout Toolbutton {
  93. Toolbutton.border -children {
  94. Toolbutton.padding -children {
  95. Toolbutton.label
  96. }
  97. }
  98. }
  99. ttk::style configure Toolbutton \
  100. -padding 2 -relief flat
  101. ttk::style map Toolbutton -relief \
  102. [list disabled flat selected sunken pressed sunken active raised]
  103. ttk::style map Toolbutton -background \
  104. [list pressed $colors(-darker) active $colors(-activebg)]
  105. }
  106. }