author | Claus Gittinger <cg@exept.de> |
Fri, 06 May 2016 11:52:41 +0200 | |
changeset 16460 | c8ec3e7fb2e1 |
parent 16320 | cd9e227fdeec |
child 16482 | 5b57eef90d30 |
permissions | -rw-r--r-- |
14205 | 1 |
"{ Package: 'stx:libtool' }" |
2 |
||
14213
ebed72d87fe8
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14205
diff
changeset
|
3 |
"{ NameSpace: Tools }" |
ebed72d87fe8
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14205
diff
changeset
|
4 |
|
14205 | 5 |
AbstractSettingsApplication subclass:#FontSettingsApplication |
6 |
instanceVariableNames:'filter allOfThem labelDef buttonDef listDef menuDef textDef |
|
7 |
othersDef allFontLabelHolder buttonsFontLabelHolder |
|
8 |
textFontLabelHolder labelsFontLabelHolder listsFontLabelHolder |
|
9 |
menusFontLabelHolder otherFontLabelHolder allLabel buttonsLabel |
|
10 |
textLabel labelLabel listsLabel menuLabel inputFieldLabel |
|
11 |
inputFieldDef inputFieldFontLabelHolder otherLabel |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
12 |
linuxFontWorkaround otherDef tooltipDef tooltipFontLabelHolder |
15932 | 13 |
tooltipLabel useXftFontsOnly fontSizeSelectionHolder |
16460 | 14 |
lookSelectionHolder useXFontsOnly' |
14205 | 15 |
classVariableNames:'' |
16 |
poolDictionaries:'' |
|
17 |
category:'Interface-Smalltalk' |
|
18 |
! |
|
19 |
||
20 |
||
21 |
!FontSettingsApplication class methodsFor:'instance creation'! |
|
22 |
||
23 |
fontForEncoding:encodingMatch |
|
24 |
||
25 |
| inst | |
|
26 |
||
27 |
inst := self new. |
|
28 |
inst encodingMatch:encodingMatch. |
|
29 |
self initialize. |
|
30 |
self open. |
|
31 |
! ! |
|
32 |
||
33 |
!FontSettingsApplication class methodsFor:'help specs'! |
|
34 |
||
35 |
flyByHelpSpec |
|
36 |
"This resource specification was automatically generated |
|
37 |
by the UIHelpTool of ST/X." |
|
38 |
||
39 |
"Do not manually edit this!! If it is corrupted, |
|
40 |
the UIHelpTool may not be able to read the specification." |
|
41 |
||
42 |
" |
|
43 |
UIHelpTool openOnClass:FontSettingsAppl |
|
44 |
" |
|
45 |
||
46 |
<resource: #help> |
|
47 |
||
48 |
^ super flyByHelpSpec addPairsFrom:#( |
|
49 |
||
15933 | 50 |
changeCodeFont |
51 |
'Open a font dialog to change the font used in code views only' |
|
52 |
||
53 |
changeInputFieldFont |
|
54 |
'Open a font dialog to change the font used in input fields only' |
|
55 |
||
56 |
changeLabelFont |
|
57 |
'Open a font dialog to change the font used in labels only' |
|
58 |
||
59 |
changeListFont |
|
60 |
'Open a font dialog to change the font used in lists only' |
|
61 |
||
62 |
changeMenuFont |
|
63 |
'Open a font dialog to change the font used in menus only' |
|
64 |
||
65 |
changeButtonFont |
|
66 |
'Open a font dialog to change the font used in buttons only' |
|
67 |
||
68 |
changeTooltipFont |
|
69 |
'Open a font dialog to change the font used in tooltips only' |
|
70 |
||
71 |
changeAllFont |
|
72 |
'Open a font dialog to change the font used in all views' |
|
73 |
||
14205 | 74 |
#resetToDefault |
75 |
'Reset fonts back to original default values (as specified in the window style-file and OS settings)' |
|
76 |
||
77 |
#changeToHighContrast |
|
15932 | 78 |
'Change settings for higher contrast.\Useful for presentations and outdor operation (bright sunlight)' |
79 |
||
80 |
#changeToNormalContrast |
|
81 |
'Change settings for normal contrast.' |
|
14205 | 82 |
|
83 |
#changeToBigFonts |
|
84 |
'Change settings for bigger fonts.\Useful for presentations' |
|
85 |
||
86 |
#changeToHugeFonts |
|
87 |
'Change settings for huge fonts.\Useful for presentations' |
|
88 |
||
15932 | 89 |
#changeToSmallFonts |
90 |
'Change settings for small fonts.\Useful on smaller screens (13 or 15 inch)' |
|
91 |
||
92 |
#changeToNormalFonts |
|
93 |
'Change settings for default font sizes.' |
|
94 |
||
14205 | 95 |
#changeToSTXLook |
96 |
'Change settings for an ST/X-like look with fixed-width code fonts' |
|
97 |
||
98 |
#changeToSTXLookXft |
|
99 |
'Change settings for an ST/X-like look with fixed-width code fonts).\Uses better looking Xft fonts if avaiable (XWindow only)' |
|
100 |
||
101 |
#changeToSqueakLook |
|
102 |
'Change settings for a Squeak-like look with variable code fonts' |
|
103 |
||
104 |
#changeToVisualAgeLook |
|
105 |
'Change settings for a VisualAge-like look with bold variable code fonts' |
|
15933 | 106 |
|
107 |
#useXftFontsOnly |
|
16460 | 108 |
'Don''t try to use and don''t offer non-Xft fonts in font selection dialogs (XWindow only).\If checked, ST/X will use the much nicer looking, but sometimes slower Xft fonts.' |
109 |
||
110 |
#useXFontsOnly |
|
111 |
'Don''t try to use and don''t offer Xft fonts in font selection dialogs (XWindow only).\Check this, if you are working with remote displays via a slow communication line,\to suppress any Xft font usage.\(Xft font rendering requires a much higher bandwidth.)' |
|
112 |
||
14205 | 113 |
) |
114 |
||
115 |
"Created: / 17-03-2012 / 11:37:51 / cg" |
|
116 |
! ! |
|
117 |
||
118 |
!FontSettingsApplication class methodsFor:'image specs'! |
|
119 |
||
120 |
defaultIcon |
|
121 |
<resource: #programImage> |
|
122 |
||
123 |
^ ToolbarIconLibrary fontIcon |
|
124 |
! |
|
125 |
||
126 |
defaultIcon2 |
|
14417
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
127 |
<resource: #image> |
14205 | 128 |
"This resource specification was automatically generated |
129 |
by the ImageEditor of ST/X." |
|
130 |
"Do not manually edit this!! If it is corrupted, |
|
131 |
the ImageEditor may not be able to read the specification." |
|
132 |
" |
|
133 |
self defaultIcon2 inspect |
|
134 |
ImageEditor openOnClass:self andSelector:#defaultIcon2 |
|
14417
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
135 |
Icon flushCachedIcons" |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
136 |
|
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
137 |
^ Icon constantNamed:#'FontSettingsAppl class defaultIcon2' |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
138 |
ifAbsentPut:[ |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
139 |
(Depth4Image new) |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
140 |
width:22; |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
141 |
height:22; |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
142 |
photometric:(#palette); |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
143 |
bitsPerSample:(#( 4 )); |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
144 |
samplesPerPixel:(1); |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
145 |
bits:(ByteArray |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
146 |
fromPackedString:' |
14205 | 147 |
@@@@@@@@@@@@@@@@@@@@@!!X @@@@@@@!!X @@@6H@@@@@@DP6H@@@Y!!H@@@@@QDY"@@@BY"@@@@ADQBY"@@@FX @@@@@DQCX @@@6H@@@@@QEP6H@@@@ @@@@ |
148 |
ADUDP @C@@@@@@@DQSH@@@L @@@@@@QEL @@@2@@@@@@ADT2@@@CH@@@@@@DQSH@@@L @@@@@@QEL @@@2@@@@@@QDT2@@@CH@@@@@QDQSH@@@@ @@@@@DQE |
|
14417
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
149 |
P @@@@@@@@@@@DQ@@@@@@@@@@@@@@D@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b'); |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
150 |
colorMapFromArray:#[ 0 0 0 255 255 255 150 150 150 213 213 213 215 48 48 134 54 54 240 240 240 ]; |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
151 |
mask:((ImageMask new) |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
152 |
width:22; |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
153 |
height:22; |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
154 |
bits:(ByteArray |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
155 |
fromPackedString:'@@@@@G @OG0@O''<@O7>@O<?@A>? A?? A??@A<?@A<>@A<>@A<>@A=>@C?>@G<>@C<\@@8D@@H@@@@@@@@@@@@@@'); |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
156 |
yourself); |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
157 |
yourself |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
158 |
] |
14205 | 159 |
! ! |
160 |
||
161 |
!FontSettingsApplication class methodsFor:'interface specs'! |
|
162 |
||
163 |
windowSpec |
|
164 |
"This resource specification was automatically generated |
|
165 |
by the UIPainter of ST/X." |
|
166 |
||
167 |
"Do not manually edit this!! If it is corrupted, |
|
168 |
the UIPainter may not be able to read the specification." |
|
169 |
||
170 |
" |
|
14319
a84b4a0c15ca
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14213
diff
changeset
|
171 |
UIPainter new openOnClass:Tools::FontSettingsApplication andSelector:#windowSpec |
a84b4a0c15ca
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14213
diff
changeset
|
172 |
Tools::FontSettingsApplication new openInterface:#windowSpec |
a84b4a0c15ca
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14213
diff
changeset
|
173 |
Tools::FontSettingsApplication open |
14205 | 174 |
" |
175 |
||
176 |
<resource: #canvas> |
|
177 |
||
178 |
^ |
|
179 |
#(FullSpec |
|
180 |
name: windowSpec |
|
181 |
window: |
|
182 |
(WindowSpec |
|
183 |
label: 'Font Settings' |
|
184 |
name: 'Font Settings' |
|
14319
a84b4a0c15ca
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14213
diff
changeset
|
185 |
flags: 1 |
14205 | 186 |
min: (Point 10 10) |
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
187 |
bounds: (Rectangle 0 0 643 810) |
14205 | 188 |
) |
189 |
component: |
|
190 |
(SpecCollection |
|
191 |
collection: ( |
|
192 |
(VerticalPanelViewSpec |
|
193 |
name: 'VerticalPanel1' |
|
194 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
195 |
horizontalLayout: fitSpace |
|
196 |
verticalLayout: topSpace |
|
197 |
horizontalSpace: 3 |
|
198 |
verticalSpace: 3 |
|
199 |
component: |
|
200 |
(SpecCollection |
|
201 |
collection: ( |
|
202 |
(TextEditorSpec |
|
203 |
name: 'TextEditor1' |
|
204 |
style: labelFont |
|
205 |
model: infoText |
|
206 |
hasHorizontalScrollBar: true |
|
207 |
hasVerticalScrollBar: true |
|
208 |
miniScrollerHorizontal: true |
|
209 |
miniScrollerVertical: true |
|
210 |
isReadOnly: true |
|
211 |
hasKeyboardFocusInitially: false |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
212 |
extent: (Point 637 132) |
15887 | 213 |
postBuildCallback: postBuildHelpLabel: |
14205 | 214 |
viewClassName: 'ListView' |
15887 | 215 |
) |
216 |
(DividerSpec |
|
217 |
name: 'Separator14' |
|
218 |
extent: (Point 637 4) |
|
14205 | 219 |
) |
220 |
(ViewSpec |
|
221 |
name: 'CodeBox' |
|
222 |
component: |
|
223 |
(SpecCollection |
|
224 |
collection: ( |
|
225 |
(LabelSpec |
|
226 |
label: 'Code' |
|
227 |
name: 'Label1' |
|
228 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
229 |
translateLabel: true |
|
230 |
adjust: left |
|
231 |
) |
|
15887 | 232 |
(ActionButtonSpec |
233 |
label: 'Change...' |
|
234 |
name: 'Button1' |
|
15933 | 235 |
layout: (LayoutFrame 100 0.0 15 0 205 0 37 0) |
16460 | 236 |
activeHelpKey: changeCodeFont |
15887 | 237 |
translateLabel: true |
238 |
tabable: true |
|
239 |
model: changeTextFont |
|
240 |
) |
|
14205 | 241 |
(LabelSpec |
242 |
label: 'Text Font' |
|
243 |
name: 'Label2' |
|
15933 | 244 |
layout: (LayoutFrame 210 0 15 0 -2 1 37 0) |
14205 | 245 |
translateLabel: true |
246 |
labelChannel: textFontLabelHolder |
|
247 |
adjust: left |
|
248 |
postBuildCallback: postBuildTextFontLabel: |
|
249 |
) |
|
250 |
) |
|
251 |
||
252 |
) |
|
15887 | 253 |
extent: (Point 637 45) |
14205 | 254 |
) |
255 |
(ViewSpec |
|
256 |
name: 'InputFieldsBox' |
|
257 |
component: |
|
258 |
(SpecCollection |
|
259 |
collection: ( |
|
260 |
(LabelSpec |
|
261 |
label: 'Input Fields' |
|
262 |
name: 'Input Fields' |
|
263 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
264 |
translateLabel: true |
|
265 |
adjust: left |
|
266 |
) |
|
15887 | 267 |
(ActionButtonSpec |
268 |
label: 'Change...' |
|
269 |
name: 'ChangeText' |
|
15933 | 270 |
layout: (LayoutFrame 100 0.0 15 0 205 0 37 0) |
16460 | 271 |
activeHelpKey: changeInputFieldFont |
15887 | 272 |
translateLabel: true |
273 |
tabable: true |
|
274 |
model: changeInputFieldFont |
|
275 |
) |
|
14205 | 276 |
(LabelSpec |
277 |
label: 'InputFields Font' |
|
278 |
name: 'InputFieldsFont' |
|
15933 | 279 |
layout: (LayoutFrame 210 0 15 0 -2 1 37 0) |
14205 | 280 |
translateLabel: true |
281 |
labelChannel: inputFieldFontLabelHolder |
|
282 |
adjust: left |
|
283 |
postBuildCallback: postBuildInputFieldFontLabel: |
|
284 |
) |
|
285 |
) |
|
286 |
||
287 |
) |
|
15887 | 288 |
extent: (Point 637 45) |
14205 | 289 |
) |
290 |
(ViewSpec |
|
291 |
name: 'ListsBox' |
|
292 |
component: |
|
293 |
(SpecCollection |
|
294 |
collection: ( |
|
295 |
(LabelSpec |
|
296 |
label: 'Lists' |
|
297 |
name: 'Lists' |
|
298 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
299 |
translateLabel: true |
|
300 |
adjust: left |
|
301 |
) |
|
15887 | 302 |
(ActionButtonSpec |
303 |
label: 'Change...' |
|
304 |
name: 'ChangeLists' |
|
15933 | 305 |
layout: (LayoutFrame 100 0.0 15 0 205 0 37 0) |
16460 | 306 |
activeHelpKey: changeListFont |
15887 | 307 |
translateLabel: true |
308 |
tabable: true |
|
309 |
model: changeListsFont |
|
310 |
) |
|
14205 | 311 |
(LabelSpec |
312 |
label: 'Lists Font' |
|
313 |
name: 'ListsFont' |
|
15933 | 314 |
layout: (LayoutFrame 210 0 15 0 -2 1 37 0) |
14205 | 315 |
translateLabel: true |
316 |
labelChannel: listsFontLabelHolder |
|
317 |
adjust: left |
|
318 |
postBuildCallback: postBuildListsFontLabel: |
|
319 |
) |
|
320 |
) |
|
321 |
||
322 |
) |
|
15887 | 323 |
extent: (Point 637 45) |
14205 | 324 |
) |
325 |
(ViewSpec |
|
326 |
name: 'MenusBox' |
|
327 |
component: |
|
328 |
(SpecCollection |
|
329 |
collection: ( |
|
330 |
(LabelSpec |
|
331 |
label: 'Menus' |
|
332 |
name: 'Menus' |
|
333 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
334 |
translateLabel: true |
|
335 |
adjust: left |
|
336 |
) |
|
15887 | 337 |
(ActionButtonSpec |
338 |
label: 'Change...' |
|
339 |
name: 'ChangeMenus' |
|
15933 | 340 |
layout: (LayoutFrame 100 0.0 15 0 205 0 37 0) |
16460 | 341 |
activeHelpKey: changeMenuFont |
15887 | 342 |
translateLabel: true |
343 |
tabable: true |
|
344 |
model: changeMenusFont |
|
345 |
) |
|
14205 | 346 |
(LabelSpec |
347 |
label: 'Menus Font' |
|
348 |
name: 'MenusFont' |
|
15933 | 349 |
layout: (LayoutFrame 210 0 15 0 -2 1 37 0) |
14205 | 350 |
translateLabel: true |
351 |
labelChannel: menusFontLabelHolder |
|
352 |
adjust: left |
|
353 |
postBuildCallback: postBuildMenuesFontLabel: |
|
354 |
) |
|
355 |
) |
|
356 |
||
357 |
) |
|
15887 | 358 |
extent: (Point 637 45) |
14205 | 359 |
) |
360 |
(ViewSpec |
|
361 |
name: 'LabelsBox' |
|
362 |
component: |
|
363 |
(SpecCollection |
|
364 |
collection: ( |
|
365 |
(LabelSpec |
|
366 |
label: 'Labels' |
|
367 |
name: 'Labels' |
|
368 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
369 |
translateLabel: true |
|
370 |
adjust: left |
|
371 |
) |
|
15887 | 372 |
(ActionButtonSpec |
373 |
label: 'Change...' |
|
374 |
name: 'ChangeLabels' |
|
15933 | 375 |
layout: (LayoutFrame 100 0.0 15 0 205 0 37 0) |
16460 | 376 |
activeHelpKey: changeLabelFont |
15887 | 377 |
translateLabel: true |
378 |
tabable: true |
|
379 |
model: changeLabelsFont |
|
380 |
) |
|
14205 | 381 |
(LabelSpec |
382 |
label: 'Labels' |
|
383 |
name: 'LabelsFont' |
|
15933 | 384 |
layout: (LayoutFrame 210 0 15 0 -2 1 37 0) |
14205 | 385 |
translateLabel: true |
386 |
labelChannel: labelsFontLabelHolder |
|
387 |
adjust: left |
|
388 |
postBuildCallback: postBuildLabelsFontLabel: |
|
389 |
) |
|
390 |
) |
|
391 |
||
392 |
) |
|
15887 | 393 |
extent: (Point 637 45) |
14205 | 394 |
) |
395 |
(ViewSpec |
|
396 |
name: 'ButtonsBox' |
|
397 |
component: |
|
398 |
(SpecCollection |
|
399 |
collection: ( |
|
400 |
(LabelSpec |
|
401 |
label: 'Buttons' |
|
402 |
name: 'Buttons' |
|
403 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
404 |
translateLabel: true |
|
405 |
adjust: left |
|
406 |
) |
|
15887 | 407 |
(ActionButtonSpec |
408 |
label: 'Change...' |
|
409 |
name: 'Change Buttons' |
|
15933 | 410 |
layout: (LayoutFrame 100 0.0 15 0 205 0 37 0) |
16460 | 411 |
activeHelpKey: changeButtonFont |
15887 | 412 |
translateLabel: true |
413 |
tabable: true |
|
414 |
model: changeButtonsFont |
|
415 |
) |
|
14205 | 416 |
(LabelSpec |
417 |
label: 'Buttons Font' |
|
418 |
name: 'ButtonsFont' |
|
15933 | 419 |
layout: (LayoutFrame 210 0 15 0 -2 1 37 0) |
14205 | 420 |
translateLabel: true |
421 |
labelChannel: buttonsFontLabelHolder |
|
422 |
adjust: left |
|
423 |
postBuildCallback: postBuildButtonsFontLabel: |
|
424 |
) |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
425 |
) |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
426 |
|
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
427 |
) |
15887 | 428 |
extent: (Point 637 45) |
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
429 |
) |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
430 |
(ViewSpec |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
431 |
name: 'ToolTipsBox' |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
432 |
component: |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
433 |
(SpecCollection |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
434 |
collection: ( |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
435 |
(LabelSpec |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
436 |
label: 'Tooltips' |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
437 |
name: 'Label7' |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
438 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
439 |
translateLabel: true |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
440 |
adjust: left |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
441 |
) |
15887 | 442 |
(ActionButtonSpec |
443 |
label: 'Change...' |
|
444 |
name: 'Button11' |
|
15933 | 445 |
layout: (LayoutFrame 100 0.0 15 0 205 0 37 0) |
16460 | 446 |
activeHelpKey: changeTooltipFont |
15887 | 447 |
translateLabel: true |
448 |
tabable: true |
|
449 |
model: changeTooltipFont |
|
450 |
) |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
451 |
(LabelSpec |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
452 |
label: 'Label' |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
453 |
name: 'Label8' |
15933 | 454 |
layout: (LayoutFrame 210 0 15 0 -2 1 37 0) |
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
455 |
translateLabel: true |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
456 |
labelChannel: tooltipFontLabelHolder |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
457 |
adjust: left |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
458 |
postBuildCallback: postBuildTooltipFontLabel: |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
459 |
) |
14205 | 460 |
) |
461 |
||
462 |
) |
|
15887 | 463 |
extent: (Point 637 45) |
14205 | 464 |
) |
465 |
(ViewSpec |
|
466 |
name: 'OtherBox' |
|
467 |
component: |
|
468 |
(SpecCollection |
|
469 |
collection: ( |
|
470 |
(LabelSpec |
|
471 |
label: 'All Others' |
|
472 |
name: 'Label5' |
|
473 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
474 |
translateLabel: true |
|
475 |
adjust: left |
|
476 |
) |
|
15887 | 477 |
(ActionButtonSpec |
478 |
label: 'Change...' |
|
479 |
name: 'Button9' |
|
15933 | 480 |
layout: (LayoutFrame 100 0.0 15 0 205 0 37 0) |
15887 | 481 |
translateLabel: true |
482 |
tabable: true |
|
483 |
model: changeOtherFont |
|
484 |
) |
|
14205 | 485 |
(LabelSpec |
486 |
label: 'Label' |
|
487 |
name: 'Label6' |
|
15933 | 488 |
layout: (LayoutFrame 210 0 15 0 -2 1 37 0) |
16460 | 489 |
activeHelpKey: changeOtherFont |
14205 | 490 |
translateLabel: true |
491 |
labelChannel: otherFontLabelHolder |
|
492 |
adjust: left |
|
493 |
postBuildCallback: postBuildOtherFontLabel: |
|
494 |
) |
|
495 |
(DividerSpec |
|
496 |
name: 'Separator13' |
|
497 |
layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1) |
|
498 |
) |
|
499 |
) |
|
500 |
||
501 |
) |
|
15887 | 502 |
extent: (Point 637 45) |
14205 | 503 |
) |
504 |
(ViewSpec |
|
505 |
name: 'AllBox' |
|
506 |
component: |
|
507 |
(SpecCollection |
|
508 |
collection: ( |
|
509 |
(LabelSpec |
|
510 |
label: 'All' |
|
511 |
name: 'All' |
|
15887 | 512 |
layout: (LayoutFrame 0 0.0 4 0 0 1.0 24 0) |
14205 | 513 |
translateLabel: true |
514 |
adjust: left |
|
515 |
) |
|
516 |
(ActionButtonSpec |
|
517 |
label: 'Change...' |
|
518 |
name: 'ChangeAll' |
|
15887 | 519 |
layout: (LayoutFrame 100 0.0 11 0 205 0 33 0) |
16460 | 520 |
activeHelpKey: changeAllFont |
14205 | 521 |
translateLabel: true |
522 |
tabable: true |
|
523 |
model: changeAllFont |
|
524 |
) |
|
525 |
(DividerSpec |
|
526 |
name: 'Separator1' |
|
527 |
layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1) |
|
528 |
) |
|
529 |
) |
|
530 |
||
531 |
) |
|
15887 | 532 |
extent: (Point 637 45) |
14205 | 533 |
) |
534 |
(CheckBoxSpec |
|
535 |
label: 'Linux font workaround: do not reset fonts on snapshot restart' |
|
536 |
name: 'LinuxFontWorkaroundBox' |
|
537 |
visibilityChannel: linuxFontWorkaroundVisible |
|
538 |
model: linuxFontWorkaround |
|
539 |
translateLabel: true |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
540 |
extent: (Point 637 30) |
14205 | 541 |
) |
15887 | 542 |
(CheckBoxSpec |
16460 | 543 |
label: 'Only Use Xft Fonts / Suppress Ugly X-Fonts (Unix Only)' |
15887 | 544 |
name: 'CheckBox1' |
15932 | 545 |
activeHelpKey: useXftFontsOnly |
15887 | 546 |
visibilityChannel: useXftFontsOnlyVisible |
16460 | 547 |
enableChannel: useXftFontsOnlyEnabled |
15887 | 548 |
model: useXftFontsOnly |
549 |
translateLabel: true |
|
550 |
extent: (Point 637 30) |
|
551 |
) |
|
16460 | 552 |
(CheckBoxSpec |
553 |
label: 'Only Use X Fonts / Suppress Slow Xft-Fonts (Unix Only)' |
|
554 |
name: 'CheckBox2' |
|
555 |
activeHelpKey: useXFontsOnlyVisible |
|
556 |
visibilityChannel: useXFontsOnlyVisible |
|
557 |
enableChannel: useXFontsOnlyEnabled |
|
558 |
model: useXFontsOnly |
|
559 |
translateLabel: true |
|
560 |
extent: (Point 637 30) |
|
561 |
) |
|
14205 | 562 |
(DividerSpec |
563 |
name: 'Separator12' |
|
564 |
visibilityChannel: linuxFontWorkaroundVisible |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
565 |
extent: (Point 637 3) |
14205 | 566 |
) |
567 |
(ViewSpec |
|
568 |
name: 'SpecialsBox' |
|
569 |
component: |
|
570 |
(SpecCollection |
|
571 |
collection: ( |
|
572 |
(ActionButtonSpec |
|
573 |
label: 'Default' |
|
574 |
name: 'Button2' |
|
15887 | 575 |
layout: (LayoutFrame 0 0.0 13 0 130 0 35 0) |
14205 | 576 |
activeHelpKey: resetToDefault |
577 |
translateLabel: true |
|
578 |
tabable: true |
|
579 |
model: changeToDefault |
|
580 |
) |
|
15932 | 581 |
(LabelSpec |
582 |
label: 'Font Size:' |
|
583 |
name: 'Label9' |
|
584 |
layout: (LayoutFrame 148 0.0 13 0 298 0 35 0) |
|
585 |
translateLabel: true |
|
586 |
adjust: left |
|
587 |
) |
|
588 |
(ComboListSpec |
|
589 |
name: 'ComboList1' |
|
590 |
layout: (LayoutFrame 256 0 13 0 0 1 35 0) |
|
591 |
model: fontSizeSelectionHolder |
|
592 |
comboList: fontSizeListLabels |
|
593 |
useIndex: true |
|
594 |
) |
|
14205 | 595 |
(ActionButtonSpec |
596 |
label: 'High Contrast' |
|
15932 | 597 |
name: 'Button13' |
598 |
layout: (LayoutFrame 256 0.0 77 0 386 0 99 0) |
|
14205 | 599 |
activeHelpKey: changeToHighContrast |
600 |
translateLabel: true |
|
601 |
tabable: true |
|
602 |
model: changeToHighContrast |
|
603 |
) |
|
15932 | 604 |
(LabelSpec |
605 |
label: 'Look:' |
|
606 |
name: 'Label10' |
|
15887 | 607 |
layout: (LayoutFrame 148 0.0 45 0 298 0 67 0) |
14205 | 608 |
translateLabel: true |
15932 | 609 |
adjust: left |
14205 | 610 |
) |
15932 | 611 |
(ComboListSpec |
612 |
name: 'ComboList2' |
|
613 |
layout: (LayoutFrame 256 0 45 0 0 1 67 0) |
|
614 |
model: lookSelectionHolder |
|
615 |
comboList: lookListLabels |
|
616 |
useIndex: true |
|
14205 | 617 |
) |
618 |
(ActionButtonSpec |
|
15932 | 619 |
label: 'Use Xft Fonts' |
14205 | 620 |
name: 'Button10' |
15932 | 621 |
layout: (LayoutFrame 0 0.0 77 0 130 0 99 0) |
14205 | 622 |
activeHelpKey: changeToSTXLookXft |
623 |
translateLabel: true |
|
624 |
tabable: true |
|
15932 | 625 |
model: changeToUseXft |
14205 | 626 |
enableChannel: hasXftFonts |
627 |
) |
|
15932 | 628 |
(ActionButtonSpec |
629 |
label: 'Normal Contrast' |
|
630 |
name: 'Button14' |
|
631 |
layout: (LayoutFrame 400 0.0 77 0 530 0 99 0) |
|
632 |
activeHelpKey: changeToNormalContrast |
|
633 |
translateLabel: true |
|
634 |
tabable: true |
|
635 |
model: changeToNormalContrast |
|
636 |
) |
|
14205 | 637 |
) |
638 |
||
639 |
) |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
640 |
extent: (Point 637 124) |
14205 | 641 |
) |
642 |
) |
|
643 |
||
644 |
) |
|
645 |
) |
|
646 |
) |
|
647 |
||
648 |
) |
|
649 |
) |
|
650 |
! ! |
|
651 |
||
652 |
!FontSettingsApplication methodsFor:'accessing'! |
|
653 |
||
654 |
encodingMatch:aEncodingMatch |
|
655 |
||
656 |
aEncodingMatch notNil ifTrue:[ |
|
657 |
filter := [:f | f encoding notNil |
|
658 |
and:[aEncodingMatch match:f encoding]]. |
|
659 |
]. |
|
660 |
! ! |
|
661 |
||
662 |
!FontSettingsApplication methodsFor:'actions'! |
|
663 |
||
664 |
basicReadFontSettings |
|
16320 | 665 |
|prefs readFont sz lookIdx idx defaultTextFont| |
15887 | 666 |
|
667 |
self useXftFontsOnly value:(UserPreferences current useXftFontsOnly). |
|
16460 | 668 |
self useXFontsOnly value:(UserPreferences current useXFontsOnly). |
15887 | 669 |
|
670 |
prefs := UserPreferences current fontPreferences. |
|
671 |
prefs isNil ifTrue:[ |
|
672 |
prefs := Dictionary new. |
|
673 |
]. |
|
674 |
||
675 |
readFont := |
|
676 |
[:key :default | |
|
677 |
|s fn| |
|
678 |
||
679 |
s := prefs at:key ifAbsent:nil. |
|
680 |
s notNil ifTrue:[ |
|
15892 | 681 |
fn := Object readFrom:s. |
15887 | 682 |
self useXftFontsOnly value ifTrue:[ |
683 |
fn := XftFontDescription for:fn |
|
684 |
]. |
|
685 |
]. |
|
686 |
fn isNil ifTrue:[ |
|
687 |
fn := default. |
|
688 |
]. |
|
689 |
fn |
|
690 |
]. |
|
691 |
||
15933 | 692 |
self allOfThem value:View defaultFont. |
693 |
self otherDef value:(readFont value:#Other value:View defaultFont). |
|
15887 | 694 |
self labelDef value:(readFont value:#Label value:Label defaultFont). |
695 |
self buttonDef value:(readFont value:#Button value:Button defaultFont). |
|
696 |
self listDef value:(readFont value:#List value:SelectionInListView defaultFont). |
|
697 |
self menuDef value:(readFont value:#Menu value:MenuView defaultFont). |
|
698 |
self textDef value:(readFont value:#Text value:TextView defaultFont). |
|
699 |
self inputFieldDef value:(readFont value:#InputField value:EditField defaultFont). |
|
700 |
self tooltipDef value:(readFont value:#Tooltip value:ActiveHelpView defaultFont). |
|
14205 | 701 |
|
15932 | 702 |
sz := TextView defaultFont size. |
703 |
idx := self fontSizeListValues indexOf:sz. |
|
704 |
idx ~~ 0 ifTrue:[ |
|
15933 | 705 |
self fontSizeSelectionHolder value:idx withoutNotifying:self. |
15932 | 706 |
]. |
707 |
||
708 |
lookIdx := nil. |
|
16320 | 709 |
defaultTextFont := TextView defaultFont. |
710 |
(defaultTextFont face = #bold) ifTrue:[ |
|
711 |
lookIdx := self lookListValues indexOf:#vage. |
|
15932 | 712 |
] ifFalse:[ |
16320 | 713 |
"XFT fonts always return false for #isFixedWidth" |
714 |
(defaultTextFont isXftFont or:[(defaultTextFont onDevice:self device) isFixedWidth]) ifTrue:[ |
|
715 |
lookIdx := self lookListValues indexOf:#stx. |
|
15932 | 716 |
] ifFalse:[ |
16320 | 717 |
lookIdx := self lookListValues indexOf:#squeak. |
15932 | 718 |
]. |
719 |
]. |
|
15933 | 720 |
self lookSelectionHolder value:lookIdx withoutNotifying:self |
15932 | 721 |
|
14205 | 722 |
"Modified: / 10-10-2011 / 12:15:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
723 |
"Created: / 06-02-2012 / 12:22:39 / cg" |
|
724 |
! |
|
725 |
||
726 |
basicReadSettings |
|
727 |
self basicReadFontSettings. |
|
728 |
||
729 |
self readAspects: #(linuxFontWorkaround) from: currentUserPrefs |
|
730 |
||
731 |
"Modified: / 10-10-2011 / 12:15:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
732 |
"Modified: / 06-02-2012 / 12:22:51 / cg" |
|
733 |
! |
|
734 |
||
735 |
basicSaveSettings |
|
16460 | 736 |
"/ |fn| |
14205 | 737 |
|
16460 | 738 |
self writeAspects: #(linuxFontWorkaround useXftFontsOnly useXFontsOnly) to: currentUserPrefs. |
14205 | 739 |
|
15887 | 740 |
UserPreferences current fontPreferences: |
741 |
( |
|
742 |
Dictionary new |
|
743 |
at:#Other put:(self otherDef value storeString); |
|
744 |
at:#Label put:(self labelDef value storeString); |
|
745 |
at:#Button put:(self buttonDef value storeString); |
|
746 |
at:#Text put:(self textDef value storeString); |
|
747 |
at:#InputField put:(self inputFieldDef value storeString); |
|
748 |
at:#List put:(self listDef value storeString); |
|
749 |
at:#Tooltip put:(self tooltipDef value storeString); |
|
750 |
at:#Menu put:(self menuDef value storeString); |
|
751 |
yourself |
|
752 |
). |
|
753 |
||
754 |
"/ fn := self otherDef value. |
|
755 |
"/ SimpleView withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
756 |
"/ |
|
757 |
"/ fn := self labelDef value. |
|
758 |
"/ Label defaultFont:fn. |
|
759 |
"/ CheckBox defaultFont:fn. |
|
760 |
"/ |
|
761 |
"/ fn := self buttonDef value. |
|
762 |
"/ Button defaultFont:fn. |
|
763 |
"/ Toggle defaultFont:fn. |
|
764 |
"/ |
|
765 |
"/ fn := self textDef value. |
|
766 |
"/ TextView withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
767 |
"/ |
|
768 |
"/ fn := self inputFieldDef value. |
|
769 |
"/ EditField withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
770 |
"/ |
|
771 |
"/ fn := self listDef value. |
|
772 |
"/ SelectionInListView withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
773 |
"/ |
|
774 |
"/ fn := self tooltipDef value. |
|
775 |
"/ ActiveHelpView withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
776 |
"/ |
|
777 |
"/ fn := self menuDef value. |
|
778 |
"/ ListView defaultFont:fn. |
|
779 |
"/ MenuView defaultFont:fn. |
|
780 |
"/ MenuPanel defaultFont:fn. |
|
781 |
"/ NoteBookView defaultFont:fn. |
|
782 |
"/ PullDownMenu defaultFont:fn. |
|
14494
680379a3dbef
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14491
diff
changeset
|
783 |
|
680379a3dbef
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14491
diff
changeset
|
784 |
DebugView newDebugger. |
14205 | 785 |
|
786 |
"Modified: / 10-10-2011 / 12:15:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
787 |
! |
|
788 |
||
789 |
changeAllFont |
|
790 |
|f| |
|
791 |
||
792 |
self withWaitCursorDo:[ |
|
793 |
f := FontPanel |
|
794 |
fontFromUserInitial:(self allOfThem value) |
|
795 |
title:(resources string:'Font for %1' with:'All') |
|
796 |
filter:filter. |
|
797 |
]. |
|
798 |
f notNil ifTrue:[ |
|
799 |
"/ self allOfThem value:(f onDevice:allLabel device). |
|
800 |
self otherDef value:(f onDevice:otherLabel device). |
|
801 |
self labelDef value:(f onDevice:labelLabel device). |
|
802 |
self buttonDef value:(f onDevice:buttonsLabel device). |
|
803 |
self listDef value:(f onDevice:listsLabel device). |
|
804 |
self menuDef value:(f onDevice:menuLabel device). |
|
805 |
self textDef value:(f onDevice:textLabel device). |
|
806 |
self inputFieldDef value:(f onDevice:inputFieldLabel device). |
|
16080 | 807 |
self tooltipDef value:(f onDevice:tooltipLabel device). |
14205 | 808 |
] |
809 |
! |
|
810 |
||
811 |
changeButtonsFont |
|
812 |
self changeFontFor:self buttonDef labelTitle:'Buttons'. |
|
813 |
! |
|
814 |
||
815 |
changeFontFor:aHolder labelTitle:labelTitle |
|
816 |
|f | |
|
817 |
||
818 |
self withWaitCursorDo:[ |
|
819 |
f := FontPanel |
|
820 |
fontFromUserInitial:(aHolder value) |
|
821 |
title:(resources string:'Font for %1' with:labelTitle) |
|
822 |
filter:filter. |
|
823 |
]. |
|
824 |
f notNil ifTrue:[ |
|
825 |
aHolder value:(f onDevice:self graphicsDevice). |
|
826 |
]. |
|
827 |
! |
|
828 |
||
829 |
changeInputFieldFont |
|
830 |
self changeFontFor:self inputFieldDef labelTitle:'Input Fields'. |
|
831 |
! |
|
832 |
||
833 |
changeLabelsFont |
|
834 |
self changeFontFor:self labelDef labelTitle:'Labels'. |
|
835 |
! |
|
836 |
||
837 |
changeListsFont |
|
838 |
self changeFontFor:self listDef labelTitle:'Lists'. |
|
839 |
! |
|
840 |
||
841 |
changeMenusFont |
|
842 |
self changeFontFor:self menuDef labelTitle:'Menus'. |
|
843 |
! |
|
844 |
||
845 |
changeOtherFont |
|
846 |
self changeFontFor:self otherDef labelTitle:'All Others'. |
|
847 |
! |
|
848 |
||
849 |
changeTextFont |
|
850 |
self changeFontFor:self textDef labelTitle:'Edited Text'. |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
851 |
! |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
852 |
|
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
853 |
changeTooltipFont |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
854 |
self changeFontFor:self tooltipDef labelTitle:'Tooltops'. |
15932 | 855 |
! |
856 |
||
857 |
fontSizeSelectionChanged |
|
858 |
|idx sz| |
|
859 |
||
860 |
idx := self fontSizeSelectionHolder value. |
|
861 |
sz := self fontSizeListValues at:idx ifAbsent:nil. |
|
862 |
sz notNil ifTrue:[ |
|
863 |
self changeToFontsWithSize:sz |
|
864 |
]. |
|
865 |
! |
|
866 |
||
867 |
lookSelectionChanged |
|
868 |
|idx look| |
|
869 |
||
870 |
idx := self lookSelectionHolder value. |
|
871 |
look := self lookListValues at:idx ifAbsent:nil. |
|
872 |
look notNil ifTrue:[ |
|
873 |
look == #stx ifTrue:[ |
|
874 |
self changeToSTXLook |
|
875 |
] ifFalse:[ |
|
876 |
look == #squeak ifTrue:[ |
|
877 |
self changeToSqueakLook |
|
878 |
] ifFalse:[ |
|
879 |
look == #vage ifTrue:[ |
|
880 |
self changeToVisualAgeLook |
|
881 |
] |
|
882 |
] |
|
883 |
]. |
|
884 |
]. |
|
14205 | 885 |
! ! |
886 |
||
887 |
!FontSettingsApplication methodsFor:'actions-common looks'! |
|
888 |
||
889 |
changeToBigFonts |
|
15932 | 890 |
self changeToFontsWithSize:16 |
14205 | 891 |
! |
892 |
||
893 |
changeToDefault |
|
894 |
"/View readStyleSheetAndUpdateAllStyleCaches. |
|
895 |
View updateAllStyleCaches. |
|
896 |
self basicReadFontSettings. |
|
897 |
||
898 |
"Created: / 06-02-2012 / 12:06:00 / cg" |
|
899 |
! |
|
900 |
||
901 |
changeToFix:fixFont variable:variableFont |
|
902 |
self textDef value:fixFont. |
|
903 |
self inputFieldDef value:fixFont. |
|
904 |
||
905 |
self menuDef value:variableFont. |
|
906 |
self listDef value:variableFont. |
|
907 |
self labelDef value:variableFont. |
|
908 |
self buttonDef value:variableFont. |
|
909 |
self otherDef value:variableFont. |
|
16080 | 910 |
self tooltipDef value:variableFont. |
14205 | 911 |
|
912 |
self allOfThem value:variableFont. |
|
913 |
||
914 |
"Created: / 06-02-2012 / 12:18:34 / cg" |
|
915 |
! |
|
916 |
||
15932 | 917 |
changeToFontsWithSize:points |
918 |
|f fixFont variableFont| |
|
919 |
||
920 |
f := TextView defaultFont. |
|
921 |
f := f asSize:points. |
|
922 |
TextView defaultFont:f. |
|
923 |
||
924 |
fixFont := (self textDef value "TextView defaultFont" asSize:points). |
|
925 |
variableFont := (self labelDef value "Label defaultFont" asSize:points). |
|
926 |
self changeToFix:fixFont variable:variableFont. |
|
927 |
! |
|
928 |
||
14205 | 929 |
changeToHighContrast |
930 |
|fixFont variableFont| |
|
931 |
||
15932 | 932 |
fixFont := (self textDef value "TextView defaultFont") asFace:'bold'. |
933 |
variableFont := (self labelDef value "Label defaultFont") asFace:'bold'. |
|
14205 | 934 |
self changeToFix:fixFont variable:variableFont. |
935 |
||
936 |
"Created: / 06-02-2012 / 12:12:47 / cg" |
|
937 |
! |
|
938 |
||
939 |
changeToHugeFonts |
|
15932 | 940 |
self changeToFontsWithSize:18 |
941 |
! |
|
942 |
||
943 |
changeToNormalContrast |
|
14205 | 944 |
|fixFont variableFont| |
945 |
||
15932 | 946 |
fixFont := (self textDef value "TextView defaultFont") asFace:'medium'. |
947 |
variableFont := (self labelDef value "Label defaultFont") asFace:'medium'. |
|
14205 | 948 |
self changeToFix:fixFont variable:variableFont. |
949 |
||
15932 | 950 |
"Created: / 06-02-2012 / 12:12:47 / cg" |
14205 | 951 |
! |
952 |
||
953 |
changeToSTXLook |
|
15932 | 954 |
self changeToSTXLookWithSize:(TextView defaultFont size) |
955 |
! |
|
956 |
||
957 |
changeToSTXLookSmall |
|
958 |
|f| |
|
959 |
||
960 |
f := TextView defaultFont. |
|
961 |
f := f asSize:10. |
|
962 |
TextView defaultFont:f. |
|
963 |
||
964 |
self changeToSTXLook. |
|
965 |
! |
|
966 |
||
967 |
changeToSTXLookSmallXft |
|
968 |
|f| |
|
969 |
||
970 |
f := TextView defaultFont. |
|
971 |
f := f asSize:10. |
|
972 |
TextView defaultFont:f. |
|
973 |
||
974 |
self changeToSTXLookXft |
|
975 |
! |
|
976 |
||
977 |
changeToSTXLookWithSize:points |
|
14205 | 978 |
|fixFont variableFont| |
979 |
||
15932 | 980 |
fixFont := (Font family:'courier new' face:'medium' style:'roman' size:points). |
981 |
variableFont := (Font family:'arial' face:'medium' style:'roman' size:points). |
|
14205 | 982 |
self changeToFix:fixFont variable:variableFont. |
983 |
||
984 |
"Created: / 17-03-2012 / 11:23:16 / cg" |
|
985 |
! |
|
986 |
||
987 |
changeToSTXLookXft |
|
988 |
|fixFont variableFont| |
|
989 |
||
16094 | 990 |
self hasXftFonts ifFalse:[ |
14205 | 991 |
self changeToSTXLook. |
992 |
^ self. |
|
993 |
]. |
|
994 |
||
16094 | 995 |
fixFont := XftFontDescription family:'Courier' face:'regular' style:'roman' size:(TextView defaultFont size). |
996 |
variableFont := XftFontDescription family:'Arial' face:'regular' style:'roman' size:(TextView defaultFont size). |
|
14205 | 997 |
self changeToFix:fixFont variable:variableFont. |
998 |
! |
|
999 |
||
15932 | 1000 |
changeToSmallFonts |
1001 |
self changeToFontsWithSize:10 |
|
1002 |
! |
|
1003 |
||
14205 | 1004 |
changeToSqueakLook |
1005 |
|variableFont| |
|
1006 |
||
1007 |
variableFont := (Font family:'arial' face:'medium' style:'roman' size:(TextView defaultFont size)). |
|
1008 |
self changeToFix:variableFont variable:variableFont. |
|
1009 |
||
1010 |
"Created: / 17-03-2012 / 11:22:59 / cg" |
|
1011 |
! |
|
1012 |
||
15932 | 1013 |
changeToUseXft |
1014 |
||
1015 |
|fixFont variableFont| |
|
1016 |
||
16094 | 1017 |
self hasXftFonts ifFalse:[ |
15932 | 1018 |
^ self. |
1019 |
]. |
|
1020 |
||
1021 |
TextView defaultFont:(XftFontDescription family:'Courier' face:'regular' style:'roman' size:(TextView defaultFont size)). |
|
1022 |
Label defaultFont:(XftFontDescription family:'Arial' face:'regular' style:'roman' size:(Label defaultFont size)). |
|
1023 |
||
16094 | 1024 |
fixFont := XftFontDescription family:'Courier' face:'regular' style:'roman' size:(TextView defaultFont size). |
1025 |
variableFont := XftFontDescription family:'Arial' face:'regular' style:'roman' size:(TextView defaultFont size). |
|
15932 | 1026 |
self changeToFix:fixFont variable:variableFont. |
1027 |
! |
|
1028 |
||
14205 | 1029 |
changeToVisualAgeLook |
1030 |
|variableFont variableBoldFont| |
|
1031 |
||
1032 |
variableBoldFont := (Font family:'arial' face:'bold' style:'roman' size:(TextView defaultFont size)). |
|
1033 |
variableFont := (Font family:'arial' face:'medium' style:'roman' size:(TextView defaultFont size)). |
|
1034 |
self changeToFix:variableBoldFont variable:variableBoldFont. |
|
1035 |
||
1036 |
self menuDef value:variableFont. |
|
1037 |
||
1038 |
"Created: / 17-03-2012 / 11:22:18 / cg" |
|
1039 |
! ! |
|
1040 |
||
1041 |
!FontSettingsApplication methodsFor:'aspects'! |
|
1042 |
||
1043 |
allFontLabelHolder |
|
1044 |
||
1045 |
allFontLabelHolder isNil ifTrue:[ |
|
1046 |
allFontLabelHolder := '' asValue. |
|
1047 |
]. |
|
1048 |
^ allFontLabelHolder. |
|
1049 |
! |
|
1050 |
||
1051 |
allOfThem |
|
1052 |
"return/create the 'allOfThem' value holder (automatically generated)" |
|
1053 |
||
1054 |
allOfThem isNil ifTrue:[ |
|
1055 |
allOfThem := ValueHolder new. |
|
1056 |
allOfThem addDependent:self. |
|
1057 |
]. |
|
1058 |
^ allOfThem |
|
1059 |
! |
|
1060 |
||
1061 |
buttonDef |
|
1062 |
"return/create the 'buttonDef' value holder (automatically generated)" |
|
1063 |
||
1064 |
buttonDef isNil ifTrue:[ |
|
1065 |
buttonDef := ValueHolder new. |
|
1066 |
buttonDef addDependent:self. |
|
1067 |
]. |
|
1068 |
^ buttonDef |
|
1069 |
! |
|
1070 |
||
1071 |
buttonsFontLabelHolder |
|
1072 |
||
1073 |
buttonsFontLabelHolder isNil ifTrue:[ |
|
1074 |
buttonsFontLabelHolder := '' asValue. |
|
1075 |
]. |
|
1076 |
^ buttonsFontLabelHolder. |
|
1077 |
! |
|
1078 |
||
15932 | 1079 |
fontSizeLabelsAndValues |
1080 |
^ #( |
|
1081 |
('Default (12)' 12) |
|
1082 |
(nil nil) |
|
1083 |
('Tiny (8)' 8) |
|
1084 |
('Small (10)' 10) |
|
1085 |
('Big (16)' 16) |
|
1086 |
('Huge (18)' 18) |
|
1087 |
('<keep as is>' nil) |
|
1088 |
) |
|
1089 |
! |
|
1090 |
||
1091 |
fontSizeListLabels |
|
1092 |
^ self fontSizeLabelsAndValues collect:[:each | each first]. |
|
1093 |
! |
|
1094 |
||
1095 |
fontSizeListValues |
|
1096 |
^ self fontSizeLabelsAndValues collect:[:each | each second]. |
|
1097 |
! |
|
1098 |
||
1099 |
fontSizeSelectionHolder |
|
1100 |
fontSizeSelectionHolder isNil ifTrue:[ |
|
1101 |
fontSizeSelectionHolder := nil asValue. |
|
1102 |
fontSizeSelectionHolder onChangeSend:#fontSizeSelectionChanged to:self. |
|
1103 |
]. |
|
1104 |
^ fontSizeSelectionHolder |
|
1105 |
! |
|
1106 |
||
14205 | 1107 |
infoText |
1108 |
^ (self resources |
|
1109 |
string:'FONT_SETTINGS_INFO' |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1110 |
default:'Please notice that changes only affect new windows. |
14205 | 1111 |
Existing windows usually remember their initial font as created. |
1112 |
If required, reopen some of the views, including the Launcher itself. |
|
1113 |
||
1114 |
Also notice: |
|
1115 |
unless you save your new settings, |
|
1116 |
only the current session is affected by changes here.') withCRs |
|
1117 |
||
1118 |
"Created: / 17-08-2010 / 10:52:00 / cg" |
|
1119 |
! |
|
1120 |
||
1121 |
inputFieldDef |
|
1122 |
inputFieldDef isNil ifTrue:[ |
|
1123 |
inputFieldDef := ValueHolder new. |
|
1124 |
inputFieldDef addDependent:self. |
|
1125 |
]. |
|
1126 |
^ inputFieldDef |
|
1127 |
! |
|
1128 |
||
1129 |
inputFieldFontLabelHolder |
|
1130 |
||
1131 |
inputFieldFontLabelHolder isNil ifTrue:[ |
|
1132 |
inputFieldFontLabelHolder := '' asValue. |
|
1133 |
]. |
|
1134 |
^ inputFieldFontLabelHolder. |
|
1135 |
! |
|
1136 |
||
1137 |
labelDef |
|
1138 |
"return/create the 'labelDef' value holder (automatically generated)" |
|
1139 |
||
1140 |
labelDef isNil ifTrue:[ |
|
1141 |
labelDef := ValueHolder new. |
|
1142 |
labelDef addDependent:self. |
|
1143 |
]. |
|
1144 |
^ labelDef |
|
1145 |
! |
|
1146 |
||
1147 |
labelsFontLabelHolder |
|
1148 |
labelsFontLabelHolder isNil ifTrue:[ |
|
1149 |
labelsFontLabelHolder := '' asValue. |
|
1150 |
]. |
|
1151 |
^ labelsFontLabelHolder. |
|
1152 |
! |
|
1153 |
||
1154 |
linuxFontWorkaround |
|
1155 |
linuxFontWorkaround isNil ifTrue:[ |
|
1156 |
linuxFontWorkaround := false asValue. |
|
1157 |
linuxFontWorkaround onChangeSend:#updateModifiedChannel to:self |
|
1158 |
]. |
|
1159 |
^ linuxFontWorkaround. |
|
1160 |
||
1161 |
"Created: / 10-10-2011 / 12:14:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1162 |
! |
|
1163 |
||
1164 |
linuxFontWorkaroundVisible |
|
1165 |
^OperatingSystem getOSType == #linux |
|
1166 |
||
1167 |
"Created: / 10-10-2011 / 12:57:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1168 |
! |
|
1169 |
||
1170 |
listDef |
|
1171 |
"return/create the 'listDef' value holder (automatically generated)" |
|
1172 |
||
1173 |
listDef isNil ifTrue:[ |
|
1174 |
listDef := ValueHolder new. |
|
1175 |
listDef addDependent:self. |
|
1176 |
]. |
|
1177 |
^ listDef |
|
1178 |
! |
|
1179 |
||
1180 |
listsFontLabelHolder |
|
1181 |
||
1182 |
listsFontLabelHolder isNil ifTrue:[ |
|
1183 |
listsFontLabelHolder := '' asValue. |
|
1184 |
]. |
|
1185 |
^ listsFontLabelHolder. |
|
1186 |
! |
|
1187 |
||
15932 | 1188 |
lookLabelsAndValues |
1189 |
^ #( |
|
1190 |
('ST/X Look (monospace font for code)' #stx) |
|
1191 |
('Squeak Look (variable font for code)' #squeak) |
|
1192 |
('V''Age Look (variable bold font for code)' #vage) |
|
1193 |
('<keep as is>' nil) |
|
1194 |
) |
|
1195 |
! |
|
1196 |
||
1197 |
lookListLabels |
|
1198 |
^ self lookLabelsAndValues collect:[:each | each first]. |
|
1199 |
! |
|
1200 |
||
1201 |
lookListValues |
|
1202 |
^ self lookLabelsAndValues collect:[:each | each second]. |
|
1203 |
! |
|
1204 |
||
1205 |
lookSelectionHolder |
|
1206 |
lookSelectionHolder isNil ifTrue:[ |
|
1207 |
lookSelectionHolder := nil asValue. |
|
1208 |
lookSelectionHolder onChangeSend:#lookSelectionChanged to:self. |
|
1209 |
]. |
|
1210 |
^ lookSelectionHolder |
|
1211 |
! |
|
1212 |
||
14205 | 1213 |
menuDef |
1214 |
"return/create the 'menuDef' value holder (automatically generated)" |
|
1215 |
||
1216 |
menuDef isNil ifTrue:[ |
|
1217 |
menuDef := ValueHolder new. |
|
1218 |
menuDef addDependent:self. |
|
1219 |
]. |
|
1220 |
^ menuDef |
|
1221 |
! |
|
1222 |
||
1223 |
menusFontLabelHolder |
|
1224 |
||
1225 |
menusFontLabelHolder isNil ifTrue:[ |
|
1226 |
menusFontLabelHolder := '' asValue. |
|
1227 |
]. |
|
1228 |
^ menusFontLabelHolder. |
|
1229 |
! |
|
1230 |
||
1231 |
otherDef |
|
1232 |
otherDef isNil ifTrue:[ |
|
1233 |
otherDef := ValueHolder new. |
|
1234 |
otherDef addDependent:self. |
|
1235 |
]. |
|
1236 |
^ otherDef |
|
1237 |
! |
|
1238 |
||
1239 |
otherFontLabelHolder |
|
1240 |
||
1241 |
otherFontLabelHolder isNil ifTrue:[ |
|
1242 |
otherFontLabelHolder := '' asValue. |
|
1243 |
]. |
|
1244 |
^ otherFontLabelHolder. |
|
1245 |
! |
|
1246 |
||
1247 |
textDef |
|
1248 |
"return/create the 'textDef' value holder (automatically generated)" |
|
1249 |
||
1250 |
textDef isNil ifTrue:[ |
|
1251 |
textDef := ValueHolder new. |
|
1252 |
textDef addDependent:self. |
|
1253 |
]. |
|
1254 |
^ textDef |
|
1255 |
! |
|
1256 |
||
1257 |
textFontLabelHolder |
|
1258 |
||
1259 |
textFontLabelHolder isNil ifTrue:[ |
|
1260 |
textFontLabelHolder := '' asValue. |
|
1261 |
]. |
|
1262 |
^ textFontLabelHolder. |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1263 |
! |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1264 |
|
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1265 |
tooltipDef |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1266 |
tooltipDef isNil ifTrue:[ |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1267 |
tooltipDef := ValueHolder new. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1268 |
tooltipDef addDependent:self. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1269 |
]. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1270 |
^ tooltipDef |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1271 |
! |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1272 |
|
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1273 |
tooltipFontLabelHolder |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1274 |
tooltipFontLabelHolder isNil ifTrue:[ |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1275 |
tooltipFontLabelHolder := '' asValue. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1276 |
]. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1277 |
^ tooltipFontLabelHolder. |
15887 | 1278 |
! |
1279 |
||
16460 | 1280 |
useXFontsOnly |
1281 |
useXFontsOnly isNil ifTrue:[ |
|
1282 |
useXFontsOnly := false asValue. |
|
1283 |
useXFontsOnly onChangeSend:#useXftSettingsChanged to:self |
|
1284 |
]. |
|
1285 |
^ useXFontsOnly. |
|
1286 |
! |
|
1287 |
||
1288 |
useXFontsOnlyEnabled |
|
1289 |
^ builder valueAspectFor:#useXFontsOnlyEnabled initialValue:true |
|
1290 |
! |
|
1291 |
||
1292 |
useXFontsOnlyVisible |
|
1293 |
||
1294 |
^ Screen platformName == #X11 |
|
1295 |
! |
|
1296 |
||
15887 | 1297 |
useXftFontsOnly |
1298 |
useXftFontsOnly isNil ifTrue:[ |
|
1299 |
useXftFontsOnly := false asValue. |
|
16460 | 1300 |
useXftFontsOnly onChangeSend:#useXftSettingsChanged to:self |
15887 | 1301 |
]. |
1302 |
^ useXftFontsOnly. |
|
1303 |
! |
|
1304 |
||
16460 | 1305 |
useXftFontsOnlyEnabled |
1306 |
^ builder valueAspectFor:#useXftFontsOnlyEnabled initialValue:true |
|
1307 |
! |
|
1308 |
||
15887 | 1309 |
useXftFontsOnlyVisible |
1310 |
||
16289 | 1311 |
^ Screen platformName == #X11 |
16460 | 1312 |
! |
1313 |
||
1314 |
useXftSettingsChanged |
|
1315 |
|enableUseXft enableUseX| |
|
1316 |
||
1317 |
self updateModifiedChannel. |
|
1318 |
||
1319 |
enableUseXft := enableUseX := true. |
|
1320 |
||
1321 |
self useXftFontsOnly value ifTrue:[ |
|
1322 |
enableUseX := false |
|
1323 |
]. |
|
1324 |
self useXFontsOnly value ifTrue:[ |
|
1325 |
enableUseXft := false |
|
1326 |
]. |
|
1327 |
||
1328 |
self useXFontsOnlyEnabled value:enableUseX. |
|
1329 |
self useXftFontsOnlyEnabled value:enableUseXft |
|
14205 | 1330 |
! ! |
1331 |
||
1332 |
!FontSettingsApplication methodsFor:'change & update'! |
|
1333 |
||
1334 |
update:something with:aParameter from:changedObject |
|
1335 |
|whichLabel whichFontLabelHolder| |
|
1336 |
||
1337 |
builder notNil ifTrue:[ |
|
1338 |
changedObject == self allOfThem ifTrue:[ |
|
1339 |
whichLabel := allLabel. |
|
1340 |
whichFontLabelHolder := self allFontLabelHolder. |
|
1341 |
]. |
|
1342 |
changedObject == self otherDef ifTrue:[ |
|
1343 |
whichLabel := otherLabel. |
|
1344 |
whichFontLabelHolder := self otherFontLabelHolder. |
|
1345 |
]. |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1346 |
changedObject == self tooltipDef ifTrue:[ |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1347 |
whichLabel := tooltipLabel. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1348 |
whichFontLabelHolder := self tooltipFontLabelHolder. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1349 |
]. |
14205 | 1350 |
changedObject == self labelDef ifTrue:[ |
1351 |
whichLabel := labelLabel. |
|
1352 |
whichFontLabelHolder := self labelsFontLabelHolder. |
|
1353 |
]. |
|
1354 |
changedObject == self buttonDef ifTrue:[ |
|
1355 |
whichLabel := buttonsLabel. |
|
1356 |
whichFontLabelHolder := self buttonsFontLabelHolder. |
|
1357 |
]. |
|
1358 |
changedObject == self listDef ifTrue:[ |
|
1359 |
whichLabel := listsLabel. |
|
1360 |
whichFontLabelHolder := self listsFontLabelHolder. |
|
1361 |
]. |
|
1362 |
changedObject == self menuDef ifTrue:[ |
|
1363 |
whichLabel := menuLabel. |
|
1364 |
whichFontLabelHolder := self menusFontLabelHolder. |
|
1365 |
]. |
|
1366 |
changedObject == self textDef ifTrue:[ |
|
1367 |
whichLabel := textLabel. |
|
1368 |
whichFontLabelHolder := self textFontLabelHolder. |
|
1369 |
]. |
|
1370 |
changedObject == self inputFieldDef ifTrue:[ |
|
1371 |
whichLabel := inputFieldLabel. |
|
1372 |
whichFontLabelHolder := self inputFieldFontLabelHolder. |
|
1373 |
]. |
|
1374 |
whichLabel notNil ifTrue:[ |
|
1375 |
self updateFontOfLabel:whichLabel andFontNameHolder:whichFontLabelHolder from:changedObject. |
|
1376 |
^ self. |
|
1377 |
] |
|
1378 |
]. |
|
1379 |
super update:something with:aParameter from:changedObject |
|
1380 |
! |
|
1381 |
||
1382 |
updateAllFontLabels |
|
1383 |
self update:#value with:nil from:self allOfThem. |
|
1384 |
self update:#value with:nil from:self otherDef. |
|
1385 |
self update:#value with:nil from:self labelDef. |
|
1386 |
self update:#value with:nil from:self buttonDef. |
|
1387 |
self update:#value with:nil from:self listDef. |
|
1388 |
self update:#value with:nil from:self menuDef. |
|
1389 |
self update:#value with:nil from:self textDef. |
|
1390 |
self update:#value with:nil from:self inputFieldDef. |
|
16080 | 1391 |
self update:#value with:nil from:self tooltipDef. |
14205 | 1392 |
! |
1393 |
||
1394 |
updateFontOfLabel:labelWidget andFontNameHolder:fontNameHolder from:changedObject |
|
1395 |
|f label| |
|
1396 |
||
1397 |
f := changedObject value. |
|
1398 |
labelWidget font:f. |
|
1399 |
label := f isNil ifTrue:[ |
|
1400 |
'' |
|
1401 |
] ifFalse:[ |
|
1402 |
f userFriendlyName |
|
1403 |
]. |
|
1404 |
fontNameHolder value:label. |
|
1405 |
self updateModifiedChannel |
|
1406 |
! ! |
|
1407 |
||
1408 |
!FontSettingsApplication methodsFor:'help'! |
|
1409 |
||
1410 |
helpFilename |
|
1411 |
^ 'Launcher/fontSettings.html' |
|
1412 |
! ! |
|
1413 |
||
1414 |
!FontSettingsApplication methodsFor:'initialization & release'! |
|
1415 |
||
1416 |
postBuildAllFontLabel:aWidget |
|
1417 |
||
1418 |
allLabel := aWidget. |
|
1419 |
! |
|
1420 |
||
1421 |
postBuildButtonsFontLabel:aWidget |
|
1422 |
||
1423 |
buttonsLabel := aWidget. |
|
1424 |
! |
|
1425 |
||
14569
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1426 |
postBuildHelpLabel:aWidget |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1427 |
aWidget level:0. |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1428 |
aWidget scrolledView backgroundColor:self window viewBackground. |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1429 |
aWidget font:(Label defaultFont). |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1430 |
! |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1431 |
|
14205 | 1432 |
postBuildInputFieldFontLabel:aWidget |
1433 |
||
1434 |
inputFieldLabel := aWidget. |
|
1435 |
! |
|
1436 |
||
1437 |
postBuildLabelsFontLabel:aWidget |
|
1438 |
||
1439 |
labelLabel := aWidget. |
|
1440 |
! |
|
1441 |
||
1442 |
postBuildListsFontLabel:aWidget |
|
1443 |
||
1444 |
listsLabel := aWidget. |
|
1445 |
! |
|
1446 |
||
1447 |
postBuildMenuesFontLabel:aWidget |
|
1448 |
||
1449 |
menuLabel := aWidget. |
|
1450 |
! |
|
1451 |
||
1452 |
postBuildOtherFontLabel:aWidget |
|
1453 |
||
1454 |
otherLabel := aWidget. |
|
1455 |
! |
|
1456 |
||
1457 |
postBuildTextFontLabel:aWidget |
|
1458 |
||
1459 |
textLabel := aWidget. |
|
1460 |
! |
|
1461 |
||
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1462 |
postBuildTooltipFontLabel:aWidget |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1463 |
|
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1464 |
tooltipLabel := aWidget. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1465 |
! |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1466 |
|
14205 | 1467 |
postBuildWith:aBuilder |
1468 |
"/ self readSettings. |
|
1469 |
self updateAllFontLabels. |
|
1470 |
super postBuildWith:aBuilder |
|
1471 |
! ! |
|
1472 |
||
1473 |
!FontSettingsApplication methodsFor:'queries'! |
|
1474 |
||
1475 |
hasUnsavedChanges |
|
1476 |
self otherDef value ~= View defaultFont ifTrue:[^ true]. |
|
1477 |
self labelDef value ~= Label defaultFont ifTrue:[^ true]. |
|
1478 |
self buttonDef value ~= Button defaultFont ifTrue:[^ true]. |
|
1479 |
self listDef value ~= SelectionInListView defaultFont ifTrue:[^ true]. |
|
1480 |
self menuDef value ~= MenuView defaultFont ifTrue:[^ true]. |
|
1481 |
self textDef value ~= TextView defaultFont ifTrue:[^ true]. |
|
1482 |
self inputFieldDef value ~= EditField defaultFont ifTrue:[^ true]. |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1483 |
self tooltipDef value ~= ActiveHelpView defaultFont ifTrue:[^ true]. |
14205 | 1484 |
|
15887 | 1485 |
(self hasChangedAspectIn: #(linuxFontWorkaround useXftFontsOnly) asComparedTo:currentUserPrefs) ifTrue:[^ true]. |
14205 | 1486 |
|
1487 |
^ false |
|
1488 |
||
1489 |
"Modified: / 10-10-2011 / 12:14:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1490 |
! |
|
1491 |
||
1492 |
hasXftFonts |
|
16094 | 1493 |
^ self graphicsDevice supportsXftFonts |
14205 | 1494 |
! ! |
1495 |
||
1496 |
!FontSettingsApplication class methodsFor:'documentation'! |
|
1497 |
||
1498 |
version |
|
15887 | 1499 |
^ '$Header$' |
14205 | 1500 |
! |
1501 |
||
1502 |
version_CVS |
|
15887 | 1503 |
^ '$Header$' |
14205 | 1504 |
! ! |
1505 |