#REFACTORING by stefan
class: PopUpList
changed: #rawLabelSizeOf:
use #deviceFont instead of #createFontOnDevice
--- a/PopUpList.st Tue Aug 09 12:41:15 2016 +0200
+++ b/PopUpList.st Tue Aug 09 12:42:21 2016 +0200
@@ -1010,7 +1010,7 @@
rawLabelSizeOf:aLogo
"compute the extent needed to hold the label plus the mark"
- |ext mmH mmV longest longestWidth labels currentDeviceFont|
+ |ext mmH mmV longest longestWidth labels deviceFont|
ext := super rawLabelSizeOf:aLogo.
@@ -1019,19 +1019,19 @@
and:[adjust ~~ #center]]) ifTrue:[
"compute length of longest menu entry"
- currentDeviceFont := gc createFontOnDevice.
+ deviceFont := gc deviceFont.
longest := logo.
logo isNil ifTrue:[
longestWidth := 0
] ifFalse:[
- longestWidth := currentDeviceFont widthOf:logo.
+ longestWidth := deviceFont widthOf:logo.
].
labels := menu value labels.
labels notNil ifTrue:[
labels do:[:entry |
|this|
- this := currentDeviceFont widthOf:entry printString.
+ this := deviceFont widthOf:entry printString.
this > longestWidth ifTrue:[
longest := entry.
longestWidth := this