diff options
Diffstat (limited to 'tests/scrollbar.test')
| -rw-r--r-- | tests/scrollbar.test | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/scrollbar.test b/tests/scrollbar.test index ef24860..ad24d8d 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -18,38 +18,38 @@ proc scroll args { proc getTroughSize {w} { if {[testConstraint testmetrics]} { - # Only Windows has [testmetrics] + # Only Windows has [testmetrics] if [string match v* [$w cget -orient]] { return [expr {[winfo height $w] - 2*[testmetrics cyvscroll $w]}] } else { return [expr {[winfo width $w] - 2*[testmetrics cxhscroll $w]}] } } else { - if {[tk windowingsystem] eq "x11"} { - # Calculations here assume that the arrow area is a square. + if {[tk windowingsystem] eq "x11"} { + # Calculations here assume that the arrow area is a square. if [string match v* [$w cget -orient]] { - return [expr {[winfo height $w] \ - - ([winfo width $w] \ + return [expr {[winfo height $w] \ + - ([winfo width $w] \ - [$w cget -highlightthickness] \ - [$w cget -bd] + 1)*2}] } else { - return [expr {[winfo width $w] \ - - ([winfo height $w] \ + return [expr {[winfo width $w] \ + - ([winfo height $w] \ - [$w cget -highlightthickness] \ - [$w cget -bd] + 1)*2}] } - } else { - # macOS aqua + } else { + # macOS aqua if [string match v* [$w cget -orient]] { - return [expr {[winfo height $w] \ + return [expr {[winfo height $w] \ - ([$w cget -highlightthickness] \ +[$w cget -bd])*2}] } else { - return [expr {[winfo width $w] \ + return [expr {[winfo width $w] \ - ([$w cget -highlightthickness] \ +[$w cget -bd])*2}] } - } + } } } @@ -78,7 +78,7 @@ foreach test { {-bd 4 4 badValue {expected screen distance but got "badValue"}} {-bg #ff0000 #ff0000 non-existent {unknown color name "non-existent"}} - {-borderwidth 1.3 1 badValue {expected screen distance but got "badValue"}} + {-borderwidth 1.3 1.3 badValue {expected screen distance but got "badValue"}} {-command "set x" {set x} {} {}} {-elementborderwidth 4 4 badValue {expected screen distance but got "badValue"}} {-cursor arrow arrow badValue {bad cursor spec "badValue"}} @@ -302,10 +302,10 @@ if {[testConstraint testmetrics]} { place configure .t.s -width [expr {2*[testmetrics cxhscroll .t.s]+1}] } else { if {[tk windowingsystem] eq "x11"} { - place configure .t.s -width [expr {[winfo height .t.s] - 2*([.t.s cget -highlightthickness] + [.t.s cget -bd] + 1)}] + place configure .t.s -width [expr {[winfo height .t.s] - 2*([.t.s cget -highlightthickness] + [.t.s cget -bd] + 1)}] } else { - # macOS aqua - place configure .t.s -width [expr {2*([.t.s cget -highlightthickness] + [.t.s cget -bd])}] + # macOS aqua + place configure .t.s -width [expr {2*([.t.s cget -highlightthickness] + [.t.s cget -bd])}] } } update @@ -718,9 +718,9 @@ test scrollbar-10.3 {<MouseWheel> event on horizontal scrollbar} -setup { test scrollbar-11.1 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destruction} -body { proc destroy_scrollbar {} { - if {[winfo exists .top.s]} { - destroy .top.s - } + if {[winfo exists .top.s]} { + destroy .top.s + } } toplevel .top scrollbar .top.s @@ -735,9 +735,9 @@ test scrollbar-11.1 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destructi } -result {} test scrollbar-11.2 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destruction} -body { proc destroy_scrollbar {{y 0}} { - if {[winfo exists .top.s]} { - destroy .top.s - } + if {[winfo exists .top.s]} { + destroy .top.s + } } toplevel .top wm minsize .top 50 400 |
