classicTheme.tcl 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. }
  17. ttk::style theme settings classic {
  18. ttk::style configure "." \
  19. -font TkDefaultFont \
  20. -background $colors(-frame) \
  21. -foreground black \
  22. -selectbackground $colors(-selectbg) \
  23. -selectforeground $colors(-selectfg) \
  24. -troughcolor $colors(-troughbg) \
  25. -indicatorcolor $colors(-frame) \
  26. -highlightcolor $colors(-frame) \
  27. -highlightthickness 1 \
  28. -selectborderwidth 1 \
  29. -insertwidth 2 \
  30. ;
  31. # To match pre-Xft X11 appearance, use:
  32. # ttk::style configure . -font {Helvetica 12 bold}
  33. ttk::style map "." -background \
  34. [list disabled $colors(-frame) active $colors(-activebg)]
  35. ttk::style map "." -foreground \
  36. [list disabled $colors(-disabledfg)]
  37. ttk::style map "." -highlightcolor [list focus black]
  38. ttk::style configure TButton \
  39. -anchor center -padding "3m 1m" -relief raised -shiftrelief 1
  40. ttk::style map TButton -relief [list {!disabled pressed} sunken]
  41. ttk::style configure TCheckbutton -indicatorrelief raised
  42. ttk::style map TCheckbutton \
  43. -indicatorcolor [list \
  44. pressed $colors(-frame) selected $colors(-indicator)] \
  45. -indicatorrelief {selected sunken pressed sunken} \
  46. ;
  47. ttk::style configure TRadiobutton -indicatorrelief raised
  48. ttk::style map TRadiobutton \
  49. -indicatorcolor [list \
  50. pressed $colors(-frame) selected $colors(-indicator)] \
  51. -indicatorrelief {selected sunken pressed sunken} \
  52. ;
  53. ttk::style configure TMenubutton -relief raised -padding "3m 1m"
  54. ttk::style configure TEntry -relief sunken -padding 1 -font TkTextFont
  55. ttk::style map TEntry -fieldbackground \
  56. [list readonly $colors(-frame) disabled $colors(-frame)]
  57. ttk::style configure TCombobox -padding 1
  58. ttk::style map TCombobox -fieldbackground \
  59. [list readonly $colors(-frame) disabled $colors(-frame)]
  60. ttk::style configure ComboboxPopdownFrame \
  61. -relief solid -borderwidth 1
  62. ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0}
  63. ttk::style map TSpinbox -fieldbackground \
  64. [list readonly $colors(-frame) disabled $colors(-frame)]
  65. ttk::style configure TLabelframe -borderwidth 2 -relief groove
  66. ttk::style configure TScrollbar -relief raised
  67. ttk::style map TScrollbar -relief {{pressed !disabled} sunken}
  68. ttk::style configure TScale -sliderrelief raised
  69. ttk::style map TScale -sliderrelief {{pressed !disabled} sunken}
  70. ttk::style configure TProgressbar -background SteelBlue
  71. ttk::style configure TNotebook.Tab \
  72. -padding {3m 1m} \
  73. -background $colors(-troughbg)
  74. ttk::style map TNotebook.Tab -background [list selected $colors(-frame)]
  75. # Treeview:
  76. ttk::style configure Heading -font TkHeadingFont -relief raised
  77. ttk::style configure Treeview -background $colors(-window)
  78. ttk::style map Treeview \
  79. -background [list selected $colors(-selectbg)] \
  80. -foreground [list selected $colors(-selectfg)] ;
  81. #
  82. # Toolbar buttons:
  83. #
  84. ttk::style configure Toolbutton -padding 2 -relief flat -shiftrelief 2
  85. ttk::style map Toolbutton -relief \
  86. {disabled flat selected sunken pressed sunken active raised}
  87. ttk::style map Toolbutton -background \
  88. [list pressed $colors(-troughbg) active $colors(-activebg)]
  89. }
  90. }