pkg/gui: fixes for label widths
This commit is contained in:
parent
306194e9fa
commit
ab9caeb05c
|
@ -160,7 +160,9 @@
|
||||||
|
|
||||||
(define install-button
|
(define install-button
|
||||||
(new button%
|
(new button%
|
||||||
[label (string-constant install-pkg-install)]
|
[label (pick-wider normal-control-font
|
||||||
|
(string-constant install-pkg-install)
|
||||||
|
(string-constant install-pkg-update))]
|
||||||
[parent button-line]
|
[parent button-line]
|
||||||
[style '(border)]
|
[style '(border)]
|
||||||
[callback (lambda (b e)
|
[callback (lambda (b e)
|
||||||
|
@ -379,7 +381,8 @@
|
||||||
(send status-text set-label default-status))))
|
(send status-text set-label default-status))))
|
||||||
|
|
||||||
(define/private (->label-string s)
|
(define/private (->label-string s)
|
||||||
(substring s 0 (min 200 (string-length s))))
|
(let ([s (regexp-replace* #rx"[\r\n]+" s " ")])
|
||||||
|
(substring s 0 (min 200 (string-length s)))))
|
||||||
|
|
||||||
(define pkgs '#())
|
(define pkgs '#())
|
||||||
(define tagss #(hash))
|
(define tagss #(hash))
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
pkg
|
pkg
|
||||||
racket/list
|
racket/list
|
||||||
framework
|
framework
|
||||||
net/url)
|
net/url
|
||||||
|
"common.rkt")
|
||||||
|
|
||||||
(provide by-source-panel%)
|
(provide by-source-panel%)
|
||||||
|
|
||||||
|
@ -105,7 +106,9 @@
|
||||||
|
|
||||||
(define ok-button
|
(define ok-button
|
||||||
(new button%
|
(new button%
|
||||||
[label sc-install-pkg-install]
|
[label (pick-wider normal-control-font
|
||||||
|
sc-install-pkg-install
|
||||||
|
sc-install-pkg-update)]
|
||||||
[parent button-panel]
|
[parent button-panel]
|
||||||
[style '(border)]
|
[style '(border)]
|
||||||
[callback (lambda (b e)
|
[callback (lambda (b e)
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
racket/format)
|
racket/format)
|
||||||
|
|
||||||
(provide really-remove?
|
(provide really-remove?
|
||||||
sc-install-pkg-remove)
|
sc-install-pkg-remove
|
||||||
|
pick-wider)
|
||||||
|
|
||||||
(define sc-install-pkg-remove (string-constant install-pkg-remove))
|
(define sc-install-pkg-remove (string-constant install-pkg-remove))
|
||||||
(define really-uninstall?-msg (string-constant install-pkg-really-remove?))
|
(define really-uninstall?-msg (string-constant install-pkg-really-remove?))
|
||||||
|
@ -23,3 +24,9 @@
|
||||||
parent
|
parent
|
||||||
'(caution default=1))))
|
'(caution default=1))))
|
||||||
|
|
||||||
|
(define (pick-wider font a b)
|
||||||
|
(define-values (wa ha) (get-window-text-extent a font))
|
||||||
|
(define-values (wb hb) (get-window-text-extent b font))
|
||||||
|
(if (wa . > . wb)
|
||||||
|
a
|
||||||
|
b))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user