altTheme.tcl 3.3 KB

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