classicTheme.tcl 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #
  2. # "classic" Tk theme.
  3. #
  4. # Implements Tk's traditional Motif-like look and feel.
  5. #
  6. namespace eval ttk::theme::classic {
  7. variable colors; array set colors {
  8. -frame "#d9d9d9"
  9. -window "#ffffff"
  10. -activebg "#ececec"
  11. -troughbg "#c3c3c3"
  12. -selectbg "#c3c3c3"
  13. -selectfg "#000000"
  14. -disabledfg "#a3a3a3"
  15. -indicator "#b03060"
  16. -altindicator "#b05e5e"
  17. }
  18. ttk::style theme settings classic {
  19. ttk::style configure "." \
  20. -font TkDefaultFont \
  21. -background $colors(-frame) \
  22. -foreground black \
  23. -selectbackground $colors(-selectbg) \
  24. -selectforeground $colors(-selectfg) \
  25. -troughcolor $colors(-troughbg) \
  26. -indicatorcolor $colors(-frame) \
  27. -highlightcolor $colors(-frame) \
  28. -highlightthickness 1 \
  29. -selectborderwidth 1 \
  30. -insertwidth 2 \
  31. ;
  32. # To match pre-Xft X11 appearance, use:
  33. # ttk::style configure . -font {Helvetica 12 bold}
  34. ttk::style map "." -background \
  35. [list disabled $colors(-frame) active $colors(-activebg)]
  36. ttk::style map "." -foreground \
  37. [list disabled $colors(-disabledfg)]
  38. ttk::style map "." -highlightcolor [list focus black]
  39. ttk::style configure TButton \
  40. -anchor center -padding "3m 1m" -relief raised -shiftrelief 1
  41. ttk::style map TButton -relief [list {!disabled pressed} sunken]
  42. ttk::style configure TCheckbutton -indicatorrelief raised
  43. ttk::style map TCheckbutton \
  44. -indicatorcolor [list \
  45. pressed $colors(-frame) \
  46. alternate $colors(-altindicator) \
  47. selected $colors(-indicator)] \
  48. -indicatorrelief {alternate raised selected sunken pressed sunken} \
  49. ;
  50. ttk::style configure TRadiobutton -indicatorrelief raised
  51. ttk::style map TRadiobutton \
  52. -indicatorcolor [list \
  53. pressed $colors(-frame) \
  54. alternate $colors(-altindicator) \
  55. selected $colors(-indicator)] \
  56. -indicatorrelief {alternate raised selected sunken pressed sunken} \
  57. ;
  58. ttk::style configure TMenubutton -relief raised -padding "3m 1m"
  59. ttk::style configure TEntry -relief sunken -padding 1 -font TkTextFont
  60. ttk::style map TEntry -fieldbackground \
  61. [list readonly $colors(-frame) disabled $colors(-frame)]
  62. ttk::style configure TCombobox -padding 1
  63. ttk::style map TCombobox -fieldbackground \
  64. [list readonly $colors(-frame) disabled $colors(-frame)]
  65. ttk::style configure ComboboxPopdownFrame \
  66. -relief solid -borderwidth 1
  67. ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0}
  68. ttk::style map TSpinbox -fieldbackground \
  69. [list readonly $colors(-frame) disabled $colors(-frame)]
  70. ttk::style configure TLabelframe -borderwidth 2 -relief groove
  71. ttk::style configure TScrollbar -relief raised
  72. ttk::style map TScrollbar -relief {{pressed !disabled} sunken}
  73. ttk::style configure TScale -sliderrelief raised
  74. ttk::style map TScale -sliderrelief {{pressed !disabled} sunken}
  75. ttk::style configure TProgressbar -background SteelBlue
  76. ttk::style configure TNotebook.Tab \
  77. -padding {3m 1m} \
  78. -background $colors(-troughbg)
  79. ttk::style map TNotebook.Tab -background [list selected $colors(-frame)]
  80. # Treeview:
  81. ttk::style configure Heading -font TkHeadingFont -relief raised
  82. ttk::style configure Treeview -background $colors(-window)
  83. ttk::style map Treeview \
  84. -background [list disabled $colors(-frame)\
  85. selected $colors(-selectbg)] \
  86. -foreground [list disabled $colors(-disabledfg) \
  87. selected $colors(-selectfg)]
  88. #
  89. # Toolbar buttons:
  90. #
  91. ttk::style configure Toolbutton -padding 2 -relief flat -shiftrelief 2
  92. ttk::style map Toolbutton -relief \
  93. {disabled flat selected sunken pressed sunken active raised}
  94. ttk::style map Toolbutton -background \
  95. [list pressed $colors(-troughbg) active $colors(-activebg)]
  96. }
  97. }