aquaTheme.tcl 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #
  2. # Aqua theme (OSX native look and feel)
  3. #
  4. namespace eval ttk::theme::aqua {
  5. ttk::style theme settings aqua {
  6. ttk::style configure . \
  7. -font TkDefaultFont \
  8. -background systemWindowBackgroundColor \
  9. -foreground systemLabelColor \
  10. -selectbackground systemSelectedTextBackgroundColor \
  11. -selectforeground systemSelectedTextColor \
  12. -selectborderwidth 0 \
  13. -insertwidth 1
  14. ttk::style map . \
  15. -foreground {
  16. disabled systemDisabledControlTextColor
  17. background systemLabelColor} \
  18. -selectbackground {
  19. background systemSelectedTextBackgroundColor
  20. !focus systemSelectedTextBackgroundColor} \
  21. -selectforeground {
  22. background systemSelectedTextColor
  23. !focus systemSelectedTextColor}
  24. # Button
  25. ttk::style configure TButton -anchor center -width -6 \
  26. -foreground systemControlTextColor
  27. ttk::style map TButton \
  28. -foreground {
  29. pressed white
  30. {alternate !pressed !background} white}
  31. ttk::style configure TMenubutton -anchor center -padding {2 0 0 2}
  32. ttk::style configure Toolbutton -anchor center
  33. # For Entry, Combobox and Spinbox widgets the selected text background
  34. # is the "Highlight color" selected in preferences when the widget
  35. # has focus. It is a gray color when the widget does not have focus or
  36. # the window does not have focus. (The background state implies !focus
  37. # so we only need to specify !focus.)
  38. # Entry
  39. ttk::style map TEntry \
  40. -foreground {
  41. disabled systemDisabledControlTextColor
  42. } \
  43. -selectbackground {
  44. !focus systemUnemphasizedSelectedTextBackgroundColor
  45. }
  46. # Combobox:
  47. ttk::style map TCombobox \
  48. -foreground {
  49. disabled systemDisabledControlTextColor
  50. } \
  51. -selectbackground {
  52. !focus systemUnemphasizedSelectedTextBackgroundColor
  53. }
  54. # Spinbox
  55. ttk::style map TSpinbox \
  56. -foreground {
  57. disabled systemDisabledControlTextColor
  58. } \
  59. -selectbackground {
  60. !focus systemUnemphasizedSelectedTextBackgroundColor
  61. }
  62. # Workaround for #1100117:
  63. # Actually, on Aqua we probably shouldn't stipple images in
  64. # disabled buttons even if it did work...
  65. ttk::style configure . -stipple {}
  66. # Notebook
  67. ttk::style configure TNotebook -tabmargins {10 0} -tabposition n
  68. ttk::style configure TNotebook -padding {18 8 18 17}
  69. ttk::style configure TNotebook.Tab -padding {12 3 12 2}
  70. ttk::style configure TNotebook.Tab -foreground systemControlTextColor
  71. ttk::style map TNotebook.Tab \
  72. -foreground {
  73. background systemControlTextColor
  74. disabled systemDisabledControlTextColor
  75. selected systemSelectedTabTextColor}
  76. # Treeview:
  77. ttk::style configure Heading \
  78. -font TkHeadingFont \
  79. -foreground systemTextColor \
  80. -background systemWindowBackgroundColor
  81. ttk::style configure Treeview -rowheight 18 \
  82. -background systemTextBackgroundColor \
  83. -foreground systemTextColor \
  84. -fieldbackground systemTextBackgroundColor
  85. ttk::style map Treeview \
  86. -background {
  87. selected systemSelectedTextBackgroundColor
  88. }
  89. # Enable animation for ttk::progressbar widget:
  90. ttk::style configure TProgressbar -period 100 -maxphase 120
  91. # For Aqua, labelframe labels should appear outside the border,
  92. # with a 14 pixel inset and 4 pixels spacing between border and label
  93. # (ref: Apple Human Interface Guidelines / Controls / Grouping Controls)
  94. #
  95. ttk::style configure TLabelframe \
  96. -labeloutside true -labelmargins {14 0 14 4}
  97. # TODO: panedwindow sashes should be 9 pixels (HIG:Controls:Split Views)
  98. }
  99. }