Posted to tcl by patthoyts at Thu Mar 05 22:28:44 GMT 2009view raw

  1. diff --git a/library/ttk/altTheme.tcl b/library/ttk/altTheme.tcl
  2. index 3faa731..51ccc2b 100644
  3. --- a/library/ttk/altTheme.tcl
  4. +++ b/library/ttk/altTheme.tcl
  5. @@ -58,6 +58,8 @@ namespace eval ttk::theme::alt {
  6. ttk::style configure TEntry -padding 1
  7. ttk::style map TEntry -fieldbackground \
  8. [list readonly $colors(-frame) disabled $colors(-frame)]
  9. + ttk::style configure TEntryFrame -padding 2
  10. + ttk::style map TEntryFrame -background {}
  11. ttk::style configure TCombobox -padding 1
  12. ttk::style map TCombobox -fieldbackground \
  13. [list readonly $colors(-frame) disabled $colors(-frame)]
  14. diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl
  15. index b421aff..8b8d847 100644
  16. --- a/library/ttk/clamTheme.tcl
  17. +++ b/library/ttk/clamTheme.tcl
  18. @@ -97,6 +97,8 @@ namespace eval ttk::theme::clam {
  19. -darkcolor [list focus "#6f9dc6"] \
  20. ;
  21.  
  22. + ttk::style configure TEntryFrame -padding 2
  23. + ttk::style map TEntryFrame -background {}
  24. ttk::style configure TCombobox -padding 1 -insertwidth 1
  25. ttk::style map TCombobox \
  26. -background [list active $colors(-lighter) \
  27. diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl
  28. index e807705..a6d0cc9 100644
  29. --- a/library/ttk/classicTheme.tcl
  30. +++ b/library/ttk/classicTheme.tcl
  31. @@ -67,6 +67,8 @@ namespace eval ttk::theme::classic {
  32. ttk::style configure TEntry -relief sunken -padding 1 -font TkTextFont
  33. ttk::style map TEntry -fieldbackground \
  34. [list readonly $colors(-frame) disabled $colors(-frame)]
  35. + ttk::style configure TEntryFrame -padding 2 -relief sunken
  36. + ttk::style map TEntryFrame -background {}
  37. ttk::style configure TCombobox -padding 1
  38. ttk::style map TCombobox -fieldbackground \
  39. [list readonly $colors(-frame) disabled $colors(-frame)]
  40. diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl
  41. index 2600082..7eaab36 100644
  42. --- a/library/ttk/defaults.tcl
  43. +++ b/library/ttk/defaults.tcl
  44. @@ -62,6 +62,16 @@ namespace eval ttk::theme::default {
  45. ttk::style map TEntry -fieldbackground \
  46. [list readonly $colors(-frame) disabled $colors(-frame)]
  47.  
  48. + ttk::style layout TEntryFrame {
  49. + TEntryFrame.field -sticky nswe -border 0 -children {
  50. + TEntryFrame.fill -sticky nswe -children {
  51. + TEntryFrame.padding -sticky nswe
  52. + }
  53. + }
  54. + }
  55. + ttk::style configure TEntryFrame -padding 1 -relief sunken
  56. + ttk::style map TEntryFrame -background {}
  57. +
  58. ttk::style configure TCombobox -arrowsize 12 -padding 1
  59. ttk::style map TCombobox -fieldbackground \
  60. [list readonly $colors(-frame) disabled $colors(-frame)]
  61. diff --git a/library/ttk/ttk.tcl b/library/ttk/ttk.tcl
  62. index 266163b..58edb6e 100644
  63. --- a/library/ttk/ttk.tcl
  64. +++ b/library/ttk/ttk.tcl
  65. @@ -115,6 +115,13 @@ source [file join $::ttk::library sizegrip.tcl]
  66. bind TLabelframe <<Invoke>> { tk::TabToWindow [tk_focusNext %W] }
  67. bind TLabel <<Invoke>> { tk::TabToWindow [tk_focusNext %W] }
  68.  
  69. +bind TEntryFrame <<ThemeChanged>> {
  70. + set pad [ttk::style lookup TEntryFrame -padding]
  71. + catch {%W configure -padding [expr {$pad eq {} ? 1 : $pad}]}
  72. +}
  73. +bind TEntryFrame <Enter> {%W instate !disabled {%W state active}}
  74. +bind TEntryFrame <Leave> {%W state !active}
  75. +
  76. ### Load settings for built-in themes:
  77. #
  78. proc ttk::LoadThemes {} {
  79. diff --git a/library/ttk/vistaTheme.tcl b/library/ttk/vistaTheme.tcl
  80. index 76f3e3e..315706b 100644
  81. --- a/library/ttk/vistaTheme.tcl
  82. +++ b/library/ttk/vistaTheme.tcl
  83. @@ -102,6 +102,10 @@ namespace eval ttk::theme::vista {
  84. -selectforeground [list !focus SystemWindowText] \
  85. ;
  86.  
  87. + ttk::style configure TEntryFrame -padding 2
  88. + ttk::style element create TEntryFrame.field vsapi \
  89. + EDIT 6 {disabled 4 focus 3 active 2 {} 1} -padding 2
  90. +
  91. # Spinbox
  92. ttk::style configure TSpinbox -padding 0 ;#{2 0 15 1}
  93. ttk::style element create Spinbox.field vsapi \
  94. diff --git a/library/ttk/winTheme.tcl b/library/ttk/winTheme.tcl
  95. index 63ffabf..533da30 100644
  96. --- a/library/ttk/winTheme.tcl
  97. +++ b/library/ttk/winTheme.tcl
  98. @@ -37,6 +37,7 @@ namespace eval ttk::theme::winnative {
  99. -selectforeground [list !focus SystemWindowText] \
  100. ;
  101.  
  102. + ttk::style configure TEntryFrame -padding 2
  103. ttk::style configure TCombobox -padding 2
  104. ttk::style map TCombobox \
  105. -selectbackground [list !focus SystemWindow] \
  106. diff --git a/library/ttk/xpTheme.tcl b/library/ttk/xpTheme.tcl
  107. index 165eaba..3788af1 100644
  108. --- a/library/ttk/xpTheme.tcl
  109. +++ b/library/ttk/xpTheme.tcl
  110. @@ -44,6 +44,9 @@ namespace eval ttk::theme::xpnative {
  111. -selectbackground [list !focus SystemWindow] \
  112. -selectforeground [list !focus SystemWindowText] \
  113. ;
  114. + ttk::style configure TEntryFrame -padding 1
  115. + ttk::style element create TEntryFrame.field vsapi \
  116. + EDIT 1 {disabled 4 focus 3 active 2 {} 1} -padding 1
  117. ttk::style configure TCombobox -padding 2
  118. ttk::style map TCombobox \
  119. -selectbackground [list !focus SystemWindow] \