Check-in [2193648775]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:merge with trunk
Timelines: family | ancestors | descendants | both | wtf-8-experiment
Files: files | file ages | folders
SHA1: 2193648775a57bcd857f81324013708101d11ebb
User & Date: chw 2020-06-27 16:02:45.556
Context
2020-06-28
18:10
merge with trunk check-in: f36e4b71d1 user: chw tags: wtf-8-experiment
2020-06-27
16:02
merge with trunk check-in: 2193648775 user: chw tags: wtf-8-experiment
16:01
update awthemes to version 9.2.2 check-in: 85917cdb18 user: chw tags: trunk
15:41
merge with trunk check-in: e3311543eb user: chw tags: wtf-8-experiment
Changes
Unified Diff Ignore Whitespace Patch
Changes to assets/awthemes9/README.txt.
21
22
23
24
25
26
27






28
29
30
31
32
33
34
35
36
37
38
39
40
  # tk scaling only
  tclsh demottk.tcl winxpblue -ttkscale 2.0
  # user with high dpi, smaller font
  tclsh demottk.tcl winxpblue -ttkscale 2.0 -fontscale 0.7
  # scaled styling
  tclsh demoscaled.tcl winxpblue







 9.2 (2020-4-30)
   - arc: notebook: use roundedtop-dark style.
   - fix: set of background/highlight colors: remove extra adjustment.
   - fix: setBackground() color adjustments.

 9.1.1 (2020-4-27)
   - fix package provide statements.

9.1 (2020-4-27)
   - progressbar: rect-bord: fixed sizing.
   - progressbar: rect-bord: removed border on trough.
   - various fixes for all themes.
   - Added 'arc' theme by Sergei Golovan







>
>
>
>
>
>
|




|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  # tk scaling only
  tclsh demottk.tcl winxpblue -ttkscale 2.0
  # user with high dpi, smaller font
  tclsh demottk.tcl winxpblue -ttkscale 2.0 -fontscale 0.7
  # scaled styling
  tclsh demoscaled.tcl winxpblue

9.2.2 (2020-6-6)
   - fix: settextcolors: background color.

9.2.1 (2020-5-20)
   - fix: progressbar: rect, rect-bord border size.

9.2 (2020-4-30)
   - arc: notebook: use roundedtop-dark style.
   - fix: set of background/highlight colors: remove extra adjustment.
   - fix: setBackground() color adjustments.

9.1.1 (2020-4-27)
   - fix package provide statements.

9.1 (2020-4-27)
   - progressbar: rect-bord: fixed sizing.
   - progressbar: rect-bord: removed border on trough.
   - various fixes for all themes.
   - Added 'arc' theme by Sergei Golovan
Changes to assets/awthemes9/awthemes.tcl.
123
124
125
126
127
128
129




130
131
132
133
134
135
136
#     - Disabled checkbutton/radiobutton look match the enabled look.
#     - readonly combobox is not identical.
#     - toolbutton and menubutton press states are set the same as
#       the button press.
#
# Change History
#




# 9.2 (2020-4-30)
#   - arc: notebook: use roundedtop-dark style.
#   - fix: set of background/highlight colors: remove extra adjustment.
#   - fix: setBackground() color adjustments.
# 9.1.1 (2020-4-27)
#   - fix package provide statements.
# 9.1 (2020-4-27)







>
>
>
>







123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#     - Disabled checkbutton/radiobutton look match the enabled look.
#     - readonly combobox is not identical.
#     - toolbutton and menubutton press states are set the same as
#       the button press.
#
# Change History
#
# 9.2.2 (2020-6-6)
#   - fix: settextcolors: background color.
# 9.2.1 (2020-5-20)
#   - fix: progressbar: rect, rect-bord border size.
# 9.2 (2020-4-30)
#   - arc: notebook: use roundedtop-dark style.
#   - fix: set of background/highlight colors: remove extra adjustment.
#   - fix: setBackground() color adjustments.
# 9.1.1 (2020-4-27)
#   - fix package provide statements.
# 9.1 (2020-4-27)
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
#   - added setMenuColors helper routine
#   - cleaned up the radiobutton image
#   - resized checkbutton and radiobutton images.
# 0.1
#   - initial coding
#

package provide awthemes 9.2

package require Tk
# set ::notksvg to true for testing purposes
if { ! [info exists ::notksvg] || ! $::notksvg } {
  catch { package require tksvg }
}








|







338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
#   - added setMenuColors helper routine
#   - cleaned up the radiobutton image
#   - resized checkbutton and radiobutton images.
# 0.1
#   - initial coding
#

package provide awthemes 9.2.2

package require Tk
# set ::notksvg to true for testing purposes
if { ! [info exists ::notksvg] || ! $::notksvg } {
  catch { package require tksvg }
}

3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
    if { $useflag eq "-entry" } {
      $w configure -background $colors(entrybg.bg)
    } elseif { $useflag eq "-dark" } {
      $w configure -background $colors(bg.dark)
    } else {
      $w configure -background $colors(bg.bg)
    }
    $w configure -background $colors(entrybg.bg)
    $w configure -foreground $colors(entryfg.fg)
    $w configure -selectforeground $colors(selectfg.fg)
    $w configure -selectbackground $colors(selectbg.bg)
    $w configure -inactiveselectbackground $colors(selectbg.bg.inactive)
    $w configure -borderwidth 1p
    $w configure -highlightcolor $colors(focus.color)
    $w configure -highlightbackground $colors(bg.bg)







<







3173
3174
3175
3176
3177
3178
3179

3180
3181
3182
3183
3184
3185
3186
    if { $useflag eq "-entry" } {
      $w configure -background $colors(entrybg.bg)
    } elseif { $useflag eq "-dark" } {
      $w configure -background $colors(bg.dark)
    } else {
      $w configure -background $colors(bg.bg)
    }

    $w configure -foreground $colors(entryfg.fg)
    $w configure -selectforeground $colors(selectfg.fg)
    $w configure -selectbackground $colors(selectbg.bg)
    $w configure -inactiveselectbackground $colors(selectbg.bg.inactive)
    $w configure -borderwidth 1p
    $w configure -highlightcolor $colors(focus.color)
    $w configure -highlightbackground $colors(bg.bg)
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
        button.relief                   raised                  static
        checkbutton.border              bg.border               color
        checkbutton.focusthickness      2                       static
        checkbutton.padding             {5 0 1 2}               static
        checkbutton.scale               1.0                     static
        combobox.entry.image.border     entry.image.border      color
        combobox.entry.image.padding    entry.image.padding     color
        combobox.padding                0                       static
        combobox.relief                 none                    static
        debug                           0                       static
        entrybg.bg                      bg.dark                 color
        entrybg.disabled                {entrybg.bg 0.6}        disabled
        entryfg.disabled                {entryfg.fg 0.6}        disabled
        entryfg.fg                      fg.fg                   color
        entry.image.border              1                       static







|







3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
        button.relief                   raised                  static
        checkbutton.border              bg.border               color
        checkbutton.focusthickness      2                       static
        checkbutton.padding             {5 0 1 2}               static
        checkbutton.scale               1.0                     static
        combobox.entry.image.border     entry.image.border      color
        combobox.entry.image.padding    entry.image.padding     color
        combobox.padding                {3 1}                   static
        combobox.relief                 none                    static
        debug                           0                       static
        entrybg.bg                      bg.dark                 color
        entrybg.disabled                {entrybg.bg 0.6}        disabled
        entryfg.disabled                {entryfg.fg 0.6}        disabled
        entryfg.fg                      fg.fg                   color
        entry.image.border              1                       static
Changes to assets/awthemes9/demottk.tcl.
117
118
119
120
121
122
123
124
125
126


127
128
129
130





131
132
133
134
135
136
137
138
139
140
141
142
143
144








145
146
147
148
149
150
151
  # now do the require so that -notksvg has an effect.
  catch { package require awthemes }
  set vars(havethemeutils) false
  if { ! [catch {package present awthemes}] } {
    set vars(havethemeutils) true
  }

  set vars(havecbt) false
  if { ! $vars(nocbt) } {
    catch { package require checkButtonToggle }


    if { ! [catch {package present checkButtonToggle}] } {
      set vars(havecbt) true
    }
  }






  set vars(haveflex) false
  set vars(menucmd) menu
  set vars(topmenuargs) {}
  set vars(menuargs) {}
  if { ! $vars(noflex) } {
    catch { package require flexmenu }
    if { ! [catch {package present flexmenu}] } {
      set vars(haveflex) true
      set vars(menucmd) ::flexmenu
      set vars(topmenuargs) [list -type menubar]
      set vars(menuargs) [list -mode frame]
    }
  }









  if { $vars(havethemeutils) && $vars(gc) ne {} } {
    ::themeutils::setHighlightColor $vars(theme) $vars(gc)
  }
  if { $vars(havethemeutils) && $vars(nbg) ne {} } {
    ::themeutils::setBackgroundColor $vars(theme) $vars(nbg)
  }







<
|
|
>
>
|
|
|
|
>
>
>
>
>














>
>
>
>
>
>
>
>







117
118
119
120
121
122
123

124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
  # now do the require so that -notksvg has an effect.
  catch { package require awthemes }
  set vars(havethemeutils) false
  if { ! [catch {package present awthemes}] } {
    set vars(havethemeutils) true
  }


  if { ! $::notksvg } {
    catch { package require tksvg }
  }
  set vars(havetksvg) false
  if { ! [catch {package present tksvg}] } {
    set vars(havetksvg) true
  }

  if { $vars(tkscaling) ne {} && $vars(tkscaling) ne "default" } {
    tk scaling -displayof . $vars(tkscaling)
  }
  set calcdpi [expr {round([tk scaling]*72.0)}]
  set vars(scalefactor) [expr {$calcdpi/100.0}]

  set vars(haveflex) false
  set vars(menucmd) menu
  set vars(topmenuargs) {}
  set vars(menuargs) {}
  if { ! $vars(noflex) } {
    catch { package require flexmenu }
    if { ! [catch {package present flexmenu}] } {
      set vars(haveflex) true
      set vars(menucmd) ::flexmenu
      set vars(topmenuargs) [list -type menubar]
      set vars(menuargs) [list -mode frame]
    }
  }

  set vars(havecbt) false
  if { ! $vars(nocbt) } {
    catch { package require checkButtonToggle }
    if { ! [catch {package present checkButtonToggle}] } {
      set vars(havecbt) true
    }
  }

  if { $vars(havethemeutils) && $vars(gc) ne {} } {
    ::themeutils::setHighlightColor $vars(theme) $vars(gc)
  }
  if { $vars(havethemeutils) && $vars(nbg) ne {} } {
    ::themeutils::setBackgroundColor $vars(theme) $vars(nbg)
  }
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
    ::themeutils::setThemeColors $vars(theme) \
        style.progressbar rounded-line \
        style.scale circle-rev \
        style.scrollbar-grip none \
        scrollbar.has.arrows false
  }


  if { ! $::notksvg } {
    catch { package require tksvg }
  }
  set vars(havetksvg) false
  if { ! [catch {package present tksvg}] } {
    set vars(havetksvg) true
  }

  if { $vars(tkscaling) ne {} && $vars(tkscaling) ne "default" } {
    tk scaling -displayof . $vars(tkscaling)
  }

  set calcdpi [expr {round([tk scaling]*72.0)}]
  set vars(scalefactor) [expr {$calcdpi/100.0}]

  # Tk defaults to pixels.  Sigh.
  # Use points so that the fonts scale.
  font configure TkDefaultFont -size 11
  set origfontsz [font metrics TkDefaultFont -ascent]
  font configure TkDefaultFont -size [expr {round(11.0*$vars(fontscale))}]
  font create TextFont
  font configure TextFont -size  [expr {round(10.0*$vars(fontscale))}]







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







173
174
175
176
177
178
179
















180
181
182
183
184
185
186
    ::themeutils::setThemeColors $vars(theme) \
        style.progressbar rounded-line \
        style.scale circle-rev \
        style.scrollbar-grip none \
        scrollbar.has.arrows false
  }

















  # Tk defaults to pixels.  Sigh.
  # Use points so that the fonts scale.
  font configure TkDefaultFont -size 11
  set origfontsz [font metrics TkDefaultFont -ascent]
  font configure TkDefaultFont -size [expr {round(11.0*$vars(fontscale))}]
  font create TextFont
  font configure TextFont -size  [expr {round(10.0*$vars(fontscale))}]
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
  }

  ttk::style theme use $vars(theme)

  set vars(val) 55
  set vars(valb) $vars(theme)
  set vars(bgentry) [ttk::style lookup TFrame -background]
  set off 0
  set on 1

  . configure -background [ttk::style lookup TFrame -background]

  $vars(menucmd) .mb -font MenuFont {*}$vars(topmenuargs) {*}$vars(menuargs)
  if { $vars(haveflex) } {
    pack .mb -in . -side top -fill x -anchor nw -pady 0 -padx 0 -expand false
  } else {
    . configure -menu .mb
  }

  $vars(menucmd) .mb_example -tearoff 0 -font MenuFont {*}$vars(menuargs)
  .mb_example add command -label Menu-1
  .mb_example add command -label Menu-2
  .mb add cascade -label Example -menu .mb_example

  $vars(menucmd) .mb_b -tearoff 0 -font MenuFont {*}$vars(menuargs)
  .mb add cascade -label {not in use} -menu .mb_b

  $vars(menucmd) .mb_widgets -tearoff 0 -font MenuFont {*}$vars(menuargs)
  .mb_widgets add checkbutton -label checkA
  .mb_widgets add checkbutton -label checkB
  .mb_widgets add radiobutton -label radioA -value 0
  .mb_widgets add radiobutton -label radioB -value 1
  .mb_widgets add command -label widgets-2
  .mb add cascade -label widgets -menu .mb_widgets

  foreach {w} {.mb .mb_example .mb_widgets} {
    if { [info commands ::ttk::theme::${vars(theme)}::setMenuColors] ne {} } {
      ::ttk::theme::${vars(theme)}::setMenuColors $w
    } else {
      set c [ttk::style lookup . -background]







|
|



















|
|
|
|
<







223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254

255
256
257
258
259
260
261
  }

  ttk::style theme use $vars(theme)

  set vars(val) 55
  set vars(valb) $vars(theme)
  set vars(bgentry) [ttk::style lookup TFrame -background]
  set ::off 0
  set ::on 1

  . configure -background [ttk::style lookup TFrame -background]

  $vars(menucmd) .mb -font MenuFont {*}$vars(topmenuargs) {*}$vars(menuargs)
  if { $vars(haveflex) } {
    pack .mb -in . -side top -fill x -anchor nw -pady 0 -padx 0 -expand false
  } else {
    . configure -menu .mb
  }

  $vars(menucmd) .mb_example -tearoff 0 -font MenuFont {*}$vars(menuargs)
  .mb_example add command -label Menu-1
  .mb_example add command -label Menu-2
  .mb add cascade -label Example -menu .mb_example

  $vars(menucmd) .mb_b -tearoff 0 -font MenuFont {*}$vars(menuargs)
  .mb add cascade -label {not in use} -menu .mb_b

  $vars(menucmd) .mb_widgets -tearoff 0 -font MenuFont {*}$vars(menuargs)
  .mb_widgets add checkbutton -label checkA -variable ::on
  .mb_widgets add checkbutton -label checkB -variable ::off
  .mb_widgets add radiobutton -label radioA -value 0 -variable ::on
  .mb_widgets add radiobutton -label radioB -value 1 -variable ::on

  .mb add cascade -label widgets -menu .mb_widgets

  foreach {w} {.mb .mb_example .mb_widgets} {
    if { [info commands ::ttk::theme::${vars(theme)}::setMenuColors] ne {} } {
      ::ttk::theme::${vars(theme)}::setMenuColors $w
    } else {
      set c [ttk::style lookup . -background]
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
        -font TkDefaultFont
    .comboro$k state [list readonly $s]
    option add *TCombobox*Listbox.font TkDefaultFont
    grid .combo$k .comboro$k -in .lf$k -sticky w -padx 3p -pady 3p
    grid configure .combo$k -columnspan 2
    grid configure .comboro$k -columnspan 2 -column 2

    ttk::checkbutton .cboff$k -text off -variable off -state $s
    ttk::checkbutton .cbon$k -text on -variable on -state $s
    grid .cboff$k .cbon$k -in .lf$k -sticky w -padx 3p -pady 3p
    incr row
    if { $vars(havecbt) } {
      ttk::checkbutton .cbtoff$k -text off -variable off -state $s \
          -style Toggle.TCheckbutton
      ttk::checkbutton .cbton$k -text on -variable on -state $s \
          -style Toggle.TCheckbutton
      grid .cbtoff$k .cbton$k -in .lf$k -sticky w -padx 3p -pady 3p
      incr row
    }

    ttk::separator .sep$k
    grid .sep$k -in .lf$k -sticky ew -padx 3p -pady 3p -columnspan 4
    incr row

    ttk::radiobutton .rboff$k -text off -variable on -value 0 -state $s
    ttk::radiobutton .rbon$k -text on -variable on -value 1 -state $s
    grid .rboff$k .rbon$k -in .lf$k -sticky w -padx 3p -pady 3p
    incr row

    grid columnconfigure .lf$k 4 -weight 1

    ttk::scale .sc$k \
        -from 0 \







|
|



|

|









|
|







331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
        -font TkDefaultFont
    .comboro$k state [list readonly $s]
    option add *TCombobox*Listbox.font TkDefaultFont
    grid .combo$k .comboro$k -in .lf$k -sticky w -padx 3p -pady 3p
    grid configure .combo$k -columnspan 2
    grid configure .comboro$k -columnspan 2 -column 2

    ttk::checkbutton .cboff$k -text on -variable ::off -state $s
    ttk::checkbutton .cbon$k -text off -variable ::on -state $s
    grid .cboff$k .cbon$k -in .lf$k -sticky w -padx 3p -pady 3p
    incr row
    if { $vars(havecbt) } {
      ttk::checkbutton .cbtoff$k -variable ::off -state $s \
          -style Toggle.TCheckbutton
      ttk::checkbutton .cbton$k -variable ::on -state $s \
          -style Toggle.TCheckbutton
      grid .cbtoff$k .cbton$k -in .lf$k -sticky w -padx 3p -pady 3p
      incr row
    }

    ttk::separator .sep$k
    grid .sep$k -in .lf$k -sticky ew -padx 3p -pady 3p -columnspan 4
    incr row

    ttk::radiobutton .rboff$k -text off -variable ::on -value 0 -state $s
    ttk::radiobutton .rbon$k -text on -variable ::on -value 1 -state $s
    grid .rboff$k .rbon$k -in .lf$k -sticky w -padx 3p -pady 3p
    incr row

    grid columnconfigure .lf$k 4 -weight 1

    ttk::scale .sc$k \
        -from 0 \
567
568
569
570
571
572
573
574

575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
      </g>
    </svg>
    }

    set elsizegrip false
    set sgimg {}
    if { [tk windowingsystem] eq "aqua" &&
        ! $elsizegrip } {

      # aqua doesn't have a good sizegrip
      regsub -all _SZGRIP_ $sgdata
          [::colorutils::rgbToHexStr $::sysvars::v(darwin.appearance) 2]
          sgdata
      set sgimg [image create photo -data $sgdata -format svg]
      ttk::style element create new.sizegrip image $sgimg
      set elsizegrip true
    }
    if { ! $elsizegrip &&
      ([info commands ::ttk::theme::${vars(theme)}::hasImage] eq {} ||
    ! [::ttk::theme::${vars(theme)}::hasImage sizegrip]) } {
      set tcol #000000
      # for dark themes, set tcol to a bright yellow
      regsub -all _SZGRIP_ $sgdata $tcol sgdata
      set sgimg [image create photo -data $sgdata -format svg]
      ttk::style element create new.sizegrip image $sgimg
      set elsizegrip true
    }







|
>









|
|







564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
      </g>
    </svg>
    }

    set elsizegrip false
    set sgimg {}
    if { [tk windowingsystem] eq "aqua" &&
        ! $elsizegrip &&
        $vars(havetksvg) } {
      # aqua doesn't have a good sizegrip
      regsub -all _SZGRIP_ $sgdata
          [::colorutils::rgbToHexStr $::sysvars::v(darwin.appearance) 2]
          sgdata
      set sgimg [image create photo -data $sgdata -format svg]
      ttk::style element create new.sizegrip image $sgimg
      set elsizegrip true
    }
    if { ! $elsizegrip &&
        ([info commands ::ttk::theme::${vars(theme)}::hasImage] eq {} ||
        ! [::ttk::theme::${vars(theme)}::hasImage sizegrip]) } {
      set tcol #000000
      # for dark themes, set tcol to a bright yellow
      regsub -all _SZGRIP_ $sgdata $tcol sgdata
      set sgimg [image create photo -data $sgdata -format svg]
      ttk::style element create new.sizegrip image $sgimg
      set elsizegrip true
    }
Changes to assets/awthemes9/i/awthemes/progressbar/rect-bord/settings.tcl.
1
2
set colors(slider.image.border) {2 0}
set colors(trough.image.border) {2 0}
|
|
1
2
set colors(slider.image.border) {3 0}
set colors(trough.image.border) {3 0}
Changes to assets/awthemes9/i/awthemes/progressbar/rect/settings.tcl.
1
2
set colors(slider.image.border) {1 0}
set colors(trough.image.border) {1 0}
|
|
1
2
set colors(slider.image.border) {2 0}
set colors(trough.image.border) {2 0}
Changes to assets/awthemes9/pkgIndex.tcl.
1
2
3
4
5
6
7
8
package ifneeded awthemes 9.2 \
    [list source [file join $dir awthemes.tcl]]
package ifneeded colorutils 4.8 \
    [list source [file join $dir colorutils.tcl]]

package ifneeded arc 1.2 \
    [list source [file join $dir awarc.tcl]]
package ifneeded awdark 7.7 \
|







1
2
3
4
5
6
7
8
package ifneeded awthemes 9.2.2 \
    [list source [file join $dir awthemes.tcl]]
package ifneeded colorutils 4.8 \
    [list source [file join $dir colorutils.tcl]]

package ifneeded arc 1.2 \
    [list source [file join $dir awarc.tcl]]
package ifneeded awdark 7.7 \