author | Claus Gittinger <cg@exept.de> |
Thu, 03 Jul 2014 14:01:06 +0200 | |
changeset 14569 | 9de61339e34d |
parent 14494 | 680379a3dbef |
child 14618 | b04034550c3c |
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 |
|
12 |
linuxFontWorkaround otherDef' |
|
13 |
classVariableNames:'' |
|
14 |
poolDictionaries:'' |
|
15 |
category:'Interface-Smalltalk' |
|
16 |
! |
|
17 |
||
18 |
||
19 |
!FontSettingsApplication class methodsFor:'instance creation'! |
|
20 |
||
21 |
fontForEncoding:encodingMatch |
|
22 |
||
23 |
| inst | |
|
24 |
||
25 |
inst := self new. |
|
26 |
inst encodingMatch:encodingMatch. |
|
27 |
self initialize. |
|
28 |
self open. |
|
29 |
! ! |
|
30 |
||
31 |
!FontSettingsApplication class methodsFor:'defaults'! |
|
32 |
||
33 |
widgetList |
|
34 |
||
35 |
^ #( |
|
36 |
'All' |
|
37 |
'Labels' |
|
38 |
'Buttons' |
|
39 |
'Lists' |
|
40 |
'Menus' |
|
41 |
'Edited Text' |
|
42 |
'Others' |
|
43 |
) |
|
44 |
! ! |
|
45 |
||
46 |
!FontSettingsApplication class methodsFor:'help specs'! |
|
47 |
||
48 |
flyByHelpSpec |
|
49 |
"This resource specification was automatically generated |
|
50 |
by the UIHelpTool of ST/X." |
|
51 |
||
52 |
"Do not manually edit this!! If it is corrupted, |
|
53 |
the UIHelpTool may not be able to read the specification." |
|
54 |
||
55 |
" |
|
56 |
UIHelpTool openOnClass:FontSettingsAppl |
|
57 |
" |
|
58 |
||
59 |
<resource: #help> |
|
60 |
||
61 |
^ super flyByHelpSpec addPairsFrom:#( |
|
62 |
||
63 |
#resetToDefault |
|
64 |
'Reset fonts back to original default values (as specified in the window style-file and OS settings)' |
|
65 |
||
66 |
#changeToHighContrast |
|
67 |
'Change settings for higher contrast.\Useful for presentations and outdor operation' |
|
68 |
||
69 |
#changeToBigFonts |
|
70 |
'Change settings for bigger fonts.\Useful for presentations' |
|
71 |
||
72 |
#changeToHugeFonts |
|
73 |
'Change settings for huge fonts.\Useful for presentations' |
|
74 |
||
75 |
#changeToSTXLook |
|
76 |
'Change settings for an ST/X-like look with fixed-width code fonts' |
|
77 |
||
78 |
#changeToSTXLookXft |
|
79 |
'Change settings for an ST/X-like look with fixed-width code fonts).\Uses better looking Xft fonts if avaiable (XWindow only)' |
|
80 |
||
81 |
#changeToSqueakLook |
|
82 |
'Change settings for a Squeak-like look with variable code fonts' |
|
83 |
||
84 |
#changeToVisualAgeLook |
|
85 |
'Change settings for a VisualAge-like look with bold variable code fonts' |
|
86 |
) |
|
87 |
||
88 |
"Created: / 17-03-2012 / 11:37:51 / cg" |
|
89 |
! ! |
|
90 |
||
91 |
!FontSettingsApplication class methodsFor:'image specs'! |
|
92 |
||
93 |
defaultIcon |
|
94 |
<resource: #programImage> |
|
95 |
||
96 |
^ ToolbarIconLibrary fontIcon |
|
97 |
! |
|
98 |
||
99 |
defaultIcon2 |
|
14417
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
100 |
<resource: #image> |
14205 | 101 |
"This resource specification was automatically generated |
102 |
by the ImageEditor of ST/X." |
|
103 |
"Do not manually edit this!! If it is corrupted, |
|
104 |
the ImageEditor may not be able to read the specification." |
|
105 |
" |
|
106 |
self defaultIcon2 inspect |
|
107 |
ImageEditor openOnClass:self andSelector:#defaultIcon2 |
|
14417
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
108 |
Icon flushCachedIcons" |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
109 |
|
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
110 |
^ Icon constantNamed:#'FontSettingsAppl class defaultIcon2' |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
111 |
ifAbsentPut:[ |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
112 |
(Depth4Image new) |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
113 |
width:22; |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
114 |
height:22; |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
115 |
photometric:(#palette); |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
116 |
bitsPerSample:(#( 4 )); |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
117 |
samplesPerPixel:(1); |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
118 |
bits:(ByteArray |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
119 |
fromPackedString:' |
14205 | 120 |
@@@@@@@@@@@@@@@@@@@@@!!X @@@@@@@!!X @@@6H@@@@@@DP6H@@@Y!!H@@@@@QDY"@@@BY"@@@@ADQBY"@@@FX @@@@@DQCX @@@6H@@@@@QEP6H@@@@ @@@@ |
121 |
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
|
122 |
P @@@@@@@@@@@DQ@@@@@@@@@@@@@@D@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b'); |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
123 |
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
|
124 |
mask:((ImageMask new) |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
125 |
width:22; |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
126 |
height:22; |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
127 |
bits:(ByteArray |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
128 |
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
|
129 |
yourself); |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
130 |
yourself |
2e0d40de0740
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14319
diff
changeset
|
131 |
] |
14205 | 132 |
! ! |
133 |
||
134 |
!FontSettingsApplication class methodsFor:'interface specs'! |
|
135 |
||
136 |
windowSpec |
|
137 |
"This resource specification was automatically generated |
|
138 |
by the UIPainter of ST/X." |
|
139 |
||
140 |
"Do not manually edit this!! If it is corrupted, |
|
141 |
the UIPainter may not be able to read the specification." |
|
142 |
||
143 |
" |
|
14319
a84b4a0c15ca
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14213
diff
changeset
|
144 |
UIPainter new openOnClass:Tools::FontSettingsApplication andSelector:#windowSpec |
a84b4a0c15ca
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14213
diff
changeset
|
145 |
Tools::FontSettingsApplication new openInterface:#windowSpec |
a84b4a0c15ca
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14213
diff
changeset
|
146 |
Tools::FontSettingsApplication open |
14205 | 147 |
" |
148 |
||
149 |
<resource: #canvas> |
|
150 |
||
151 |
^ |
|
152 |
#(FullSpec |
|
153 |
name: windowSpec |
|
154 |
window: |
|
155 |
(WindowSpec |
|
156 |
label: 'Font Settings' |
|
157 |
name: 'Font Settings' |
|
14319
a84b4a0c15ca
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14213
diff
changeset
|
158 |
flags: 1 |
14205 | 159 |
min: (Point 10 10) |
160 |
bounds: (Rectangle 0 0 641 753) |
|
161 |
) |
|
162 |
component: |
|
163 |
(SpecCollection |
|
164 |
collection: ( |
|
165 |
(VerticalPanelViewSpec |
|
166 |
name: 'VerticalPanel1' |
|
167 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
168 |
horizontalLayout: fitSpace |
|
169 |
verticalLayout: topSpace |
|
170 |
horizontalSpace: 3 |
|
171 |
verticalSpace: 3 |
|
172 |
component: |
|
173 |
(SpecCollection |
|
174 |
collection: ( |
|
175 |
(TextEditorSpec |
|
176 |
name: 'TextEditor1' |
|
177 |
style: labelFont |
|
178 |
model: infoText |
|
179 |
hasHorizontalScrollBar: true |
|
180 |
hasVerticalScrollBar: true |
|
181 |
miniScrollerHorizontal: true |
|
182 |
miniScrollerVertical: true |
|
183 |
isReadOnly: true |
|
184 |
hasKeyboardFocusInitially: false |
|
185 |
extent: (Point 635 132) |
|
186 |
viewClassName: 'ListView' |
|
14569
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
187 |
postBuildCallback: postBuildHelpLabel: |
14205 | 188 |
) |
189 |
(ViewSpec |
|
190 |
name: 'CodeBox' |
|
191 |
component: |
|
192 |
(SpecCollection |
|
193 |
collection: ( |
|
194 |
(LabelSpec |
|
195 |
label: 'Code' |
|
196 |
name: 'Label1' |
|
197 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
198 |
translateLabel: true |
|
199 |
adjust: left |
|
200 |
) |
|
201 |
(LabelSpec |
|
202 |
label: 'Text Font' |
|
203 |
name: 'Label2' |
|
204 |
layout: (LayoutFrame 110 0 22 0 -5 1 44 0) |
|
205 |
translateLabel: true |
|
206 |
labelChannel: textFontLabelHolder |
|
207 |
adjust: left |
|
208 |
postBuildCallback: postBuildTextFontLabel: |
|
209 |
) |
|
210 |
(ActionButtonSpec |
|
211 |
label: 'Change...' |
|
212 |
name: 'Button1' |
|
213 |
layout: (LayoutFrame 0 0.0 22 0 105 0 44 0) |
|
214 |
translateLabel: true |
|
215 |
tabable: true |
|
216 |
model: changeTextFont |
|
217 |
) |
|
218 |
(DividerSpec |
|
219 |
name: 'Separator11' |
|
220 |
layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1) |
|
221 |
) |
|
222 |
) |
|
223 |
||
224 |
) |
|
225 |
extent: (Point 635 50) |
|
226 |
) |
|
227 |
(ViewSpec |
|
228 |
name: 'InputFieldsBox' |
|
229 |
component: |
|
230 |
(SpecCollection |
|
231 |
collection: ( |
|
232 |
(LabelSpec |
|
233 |
label: 'Input Fields' |
|
234 |
name: 'Input Fields' |
|
235 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
236 |
translateLabel: true |
|
237 |
adjust: left |
|
238 |
) |
|
239 |
(LabelSpec |
|
240 |
label: 'InputFields Font' |
|
241 |
name: 'InputFieldsFont' |
|
242 |
layout: (LayoutFrame 110 0 22 0 -5 1 44 0) |
|
243 |
translateLabel: true |
|
244 |
labelChannel: inputFieldFontLabelHolder |
|
245 |
adjust: left |
|
246 |
postBuildCallback: postBuildInputFieldFontLabel: |
|
247 |
) |
|
248 |
(ActionButtonSpec |
|
249 |
label: 'Change...' |
|
250 |
name: 'ChangeText' |
|
251 |
layout: (LayoutFrame 0 0.0 22 0 105 0 44 0) |
|
252 |
translateLabel: true |
|
253 |
tabable: true |
|
254 |
model: changeInputFieldFont |
|
255 |
) |
|
256 |
(DividerSpec |
|
257 |
name: 'Separator10' |
|
258 |
layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1) |
|
259 |
) |
|
260 |
) |
|
261 |
||
262 |
) |
|
263 |
extent: (Point 635 50) |
|
264 |
) |
|
265 |
(ViewSpec |
|
266 |
name: 'ListsBox' |
|
267 |
component: |
|
268 |
(SpecCollection |
|
269 |
collection: ( |
|
270 |
(LabelSpec |
|
271 |
label: 'Lists' |
|
272 |
name: 'Lists' |
|
273 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
274 |
translateLabel: true |
|
275 |
adjust: left |
|
276 |
) |
|
277 |
(LabelSpec |
|
278 |
label: 'Lists Font' |
|
279 |
name: 'ListsFont' |
|
280 |
layout: (LayoutFrame 110 0 22 0 -5 1 44 0) |
|
281 |
translateLabel: true |
|
282 |
labelChannel: listsFontLabelHolder |
|
283 |
adjust: left |
|
284 |
postBuildCallback: postBuildListsFontLabel: |
|
285 |
) |
|
286 |
(ActionButtonSpec |
|
287 |
label: 'Change...' |
|
288 |
name: 'ChangeLists' |
|
289 |
layout: (LayoutFrame 0 0.0 22 0 105 0 44 0) |
|
290 |
translateLabel: true |
|
291 |
tabable: true |
|
292 |
model: changeListsFont |
|
293 |
) |
|
294 |
(DividerSpec |
|
295 |
name: 'Separator8' |
|
296 |
layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1) |
|
297 |
) |
|
298 |
) |
|
299 |
||
300 |
) |
|
301 |
extent: (Point 635 50) |
|
302 |
) |
|
303 |
(ViewSpec |
|
304 |
name: 'MenusBox' |
|
305 |
component: |
|
306 |
(SpecCollection |
|
307 |
collection: ( |
|
308 |
(LabelSpec |
|
309 |
label: 'Menus' |
|
310 |
name: 'Menus' |
|
311 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
312 |
translateLabel: true |
|
313 |
adjust: left |
|
314 |
) |
|
315 |
(LabelSpec |
|
316 |
label: 'Menus Font' |
|
317 |
name: 'MenusFont' |
|
318 |
layout: (LayoutFrame 110 0 22 0 -5 1 44 0) |
|
319 |
translateLabel: true |
|
320 |
labelChannel: menusFontLabelHolder |
|
321 |
adjust: left |
|
322 |
postBuildCallback: postBuildMenuesFontLabel: |
|
323 |
) |
|
324 |
(ActionButtonSpec |
|
325 |
label: 'Change...' |
|
326 |
name: 'ChangeMenus' |
|
327 |
layout: (LayoutFrame 0 0.0 22 0 105 0 44 0) |
|
328 |
translateLabel: true |
|
329 |
tabable: true |
|
330 |
model: changeMenusFont |
|
331 |
) |
|
332 |
(DividerSpec |
|
333 |
name: 'Separator9' |
|
334 |
layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1) |
|
335 |
) |
|
336 |
) |
|
337 |
||
338 |
) |
|
339 |
extent: (Point 635 50) |
|
340 |
) |
|
341 |
(ViewSpec |
|
342 |
name: 'LabelsBox' |
|
343 |
component: |
|
344 |
(SpecCollection |
|
345 |
collection: ( |
|
346 |
(LabelSpec |
|
347 |
label: 'Labels' |
|
348 |
name: 'Labels' |
|
349 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
350 |
translateLabel: true |
|
351 |
adjust: left |
|
352 |
) |
|
353 |
(LabelSpec |
|
354 |
label: 'Labels' |
|
355 |
name: 'LabelsFont' |
|
356 |
layout: (LayoutFrame 110 0 22 0 -5 1 44 0) |
|
357 |
translateLabel: true |
|
358 |
labelChannel: labelsFontLabelHolder |
|
359 |
adjust: left |
|
360 |
postBuildCallback: postBuildLabelsFontLabel: |
|
361 |
) |
|
362 |
(ActionButtonSpec |
|
363 |
label: 'Change...' |
|
364 |
name: 'ChangeLabels' |
|
365 |
layout: (LayoutFrame 0 0.0 22 0 105 0 44 0) |
|
366 |
translateLabel: true |
|
367 |
tabable: true |
|
368 |
model: changeLabelsFont |
|
369 |
) |
|
370 |
(DividerSpec |
|
371 |
name: 'Separator6' |
|
372 |
layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1) |
|
373 |
) |
|
374 |
) |
|
375 |
||
376 |
) |
|
377 |
extent: (Point 635 50) |
|
378 |
) |
|
379 |
(ViewSpec |
|
380 |
name: 'ButtonsBox' |
|
381 |
component: |
|
382 |
(SpecCollection |
|
383 |
collection: ( |
|
384 |
(LabelSpec |
|
385 |
label: 'Buttons' |
|
386 |
name: 'Buttons' |
|
387 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
388 |
translateLabel: true |
|
389 |
adjust: left |
|
390 |
) |
|
391 |
(LabelSpec |
|
392 |
label: 'Buttons Font' |
|
393 |
name: 'ButtonsFont' |
|
394 |
layout: (LayoutFrame 110 0 22 0 -5 1 44 0) |
|
395 |
translateLabel: true |
|
396 |
labelChannel: buttonsFontLabelHolder |
|
397 |
adjust: left |
|
398 |
postBuildCallback: postBuildButtonsFontLabel: |
|
399 |
) |
|
400 |
(ActionButtonSpec |
|
401 |
label: 'Change...' |
|
402 |
name: 'Change Buttons' |
|
403 |
layout: (LayoutFrame 0 0.0 22 0 105 0 44 0) |
|
404 |
translateLabel: true |
|
405 |
tabable: true |
|
406 |
model: changeButtonsFont |
|
407 |
) |
|
408 |
(DividerSpec |
|
409 |
name: 'Separator7' |
|
410 |
layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1) |
|
411 |
) |
|
412 |
) |
|
413 |
||
414 |
) |
|
415 |
extent: (Point 635 50) |
|
416 |
) |
|
417 |
(ViewSpec |
|
418 |
name: 'OtherBox' |
|
419 |
component: |
|
420 |
(SpecCollection |
|
421 |
collection: ( |
|
422 |
(LabelSpec |
|
423 |
label: 'All Others' |
|
424 |
name: 'Label5' |
|
425 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
426 |
translateLabel: true |
|
427 |
adjust: left |
|
428 |
) |
|
429 |
(LabelSpec |
|
430 |
label: 'Label' |
|
431 |
name: 'Label6' |
|
432 |
layout: (LayoutFrame 110 0 22 0 -5 1 44 0) |
|
433 |
translateLabel: true |
|
434 |
labelChannel: otherFontLabelHolder |
|
435 |
adjust: left |
|
436 |
postBuildCallback: postBuildOtherFontLabel: |
|
437 |
) |
|
438 |
(ActionButtonSpec |
|
439 |
label: 'Change...' |
|
440 |
name: 'Button9' |
|
441 |
layout: (LayoutFrame 0 0.0 22 0 105 0 44 0) |
|
442 |
translateLabel: true |
|
443 |
tabable: true |
|
444 |
model: changeOtherFont |
|
445 |
) |
|
446 |
(DividerSpec |
|
447 |
name: 'Separator13' |
|
448 |
layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1) |
|
449 |
) |
|
450 |
) |
|
451 |
||
452 |
) |
|
453 |
extent: (Point 635 50) |
|
454 |
) |
|
455 |
(ViewSpec |
|
456 |
name: 'AllBox' |
|
457 |
component: |
|
458 |
(SpecCollection |
|
459 |
collection: ( |
|
460 |
(LabelSpec |
|
461 |
label: 'All' |
|
462 |
name: 'All' |
|
463 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0) |
|
464 |
translateLabel: true |
|
465 |
adjust: left |
|
466 |
) |
|
467 |
(ActionButtonSpec |
|
468 |
label: 'Change...' |
|
469 |
name: 'ChangeAll' |
|
470 |
layout: (LayoutFrame 0 0.0 22 0 105 0 44 0) |
|
471 |
translateLabel: true |
|
472 |
tabable: true |
|
473 |
model: changeAllFont |
|
474 |
) |
|
475 |
(DividerSpec |
|
476 |
name: 'Separator1' |
|
477 |
layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1) |
|
478 |
) |
|
479 |
) |
|
480 |
||
481 |
) |
|
482 |
extent: (Point 635 50) |
|
483 |
) |
|
484 |
(CheckBoxSpec |
|
485 |
label: 'Linux font workaround: do not reset fonts on snapshot restart' |
|
486 |
name: 'LinuxFontWorkaroundBox' |
|
487 |
visibilityChannel: linuxFontWorkaroundVisible |
|
488 |
model: linuxFontWorkaround |
|
489 |
translateLabel: true |
|
490 |
extent: (Point 635 30) |
|
491 |
) |
|
492 |
(DividerSpec |
|
493 |
name: 'Separator12' |
|
494 |
visibilityChannel: linuxFontWorkaroundVisible |
|
495 |
extent: (Point 635 3) |
|
496 |
) |
|
497 |
(ViewSpec |
|
498 |
name: 'SpecialsBox' |
|
499 |
component: |
|
500 |
(SpecCollection |
|
501 |
collection: ( |
|
502 |
(LabelSpec |
|
503 |
label: 'Common Settings:' |
|
504 |
name: 'Label4' |
|
505 |
layout: (LayoutFrame 0 0.0 11 0 0 1.0 33 0) |
|
506 |
translateLabel: true |
|
507 |
adjust: left |
|
508 |
) |
|
509 |
(ActionButtonSpec |
|
510 |
label: 'Default' |
|
511 |
name: 'Button2' |
|
512 |
layout: (LayoutFrame 0 0.0 35 0 130 0 57 0) |
|
513 |
activeHelpKey: resetToDefault |
|
514 |
translateLabel: true |
|
515 |
tabable: true |
|
516 |
model: changeToDefault |
|
517 |
) |
|
518 |
(ActionButtonSpec |
|
519 |
label: 'High Contrast' |
|
520 |
name: 'Button3' |
|
521 |
layout: (LayoutFrame 148 0.0 35 0 298 0 57 0) |
|
522 |
activeHelpKey: changeToHighContrast |
|
523 |
translateLabel: true |
|
524 |
tabable: true |
|
525 |
model: changeToHighContrast |
|
526 |
) |
|
527 |
(ActionButtonSpec |
|
528 |
label: 'Big Fonts' |
|
529 |
name: 'Button4' |
|
530 |
layout: (LayoutFrame 309 0.0 35 0 459 0 57 0) |
|
531 |
activeHelpKey: changeToBigFonts |
|
532 |
translateLabel: true |
|
533 |
tabable: true |
|
534 |
model: changeToBigFonts |
|
535 |
) |
|
536 |
(ActionButtonSpec |
|
537 |
label: 'Huge Fonts' |
|
538 |
name: 'Button5' |
|
539 |
layout: (LayoutFrame 470 0.0 35 0 620 0 57 0) |
|
540 |
activeHelpKey: changeToHugeFonts |
|
541 |
translateLabel: true |
|
542 |
tabable: true |
|
543 |
model: changeToHugeFonts |
|
544 |
) |
|
545 |
(ActionButtonSpec |
|
546 |
label: 'ST/X Look' |
|
547 |
name: 'Button8' |
|
548 |
layout: (LayoutFrame 148 0.0 67 0 298 0 89 0) |
|
549 |
activeHelpKey: changeToSTXLook |
|
550 |
translateLabel: true |
|
551 |
tabable: true |
|
552 |
model: changeToSTXLook |
|
553 |
) |
|
554 |
(ActionButtonSpec |
|
555 |
label: 'Squeak Look' |
|
556 |
name: 'Button6' |
|
557 |
layout: (LayoutFrame 309 0.0 67 0 459 0 89 0) |
|
558 |
activeHelpKey: changeToSqueakLook |
|
559 |
translateLabel: true |
|
560 |
tabable: true |
|
561 |
model: changeToSqueakLook |
|
562 |
) |
|
563 |
(ActionButtonSpec |
|
564 |
label: 'V''Age Look' |
|
565 |
name: 'Button7' |
|
566 |
layout: (LayoutFrame 470 0.0 67 0 620 0 89 0) |
|
567 |
activeHelpKey: changeToVisualAgeLook |
|
568 |
translateLabel: true |
|
569 |
tabable: true |
|
570 |
model: changeToVisualAgeLook |
|
571 |
) |
|
572 |
(ActionButtonSpec |
|
573 |
label: 'ST/X Look (Xft)' |
|
574 |
name: 'Button10' |
|
575 |
layout: (LayoutFrame 148 0.0 99 0 298 0 121 0) |
|
576 |
activeHelpKey: changeToSTXLookXft |
|
577 |
translateLabel: true |
|
578 |
tabable: true |
|
579 |
model: changeToSTXLookXft |
|
580 |
enableChannel: hasXftFonts |
|
581 |
) |
|
582 |
) |
|
583 |
||
584 |
) |
|
585 |
extent: (Point 635 124) |
|
586 |
) |
|
587 |
) |
|
588 |
||
589 |
) |
|
590 |
) |
|
591 |
) |
|
592 |
||
593 |
) |
|
594 |
) |
|
595 |
! ! |
|
596 |
||
597 |
!FontSettingsApplication methodsFor:'accessing'! |
|
598 |
||
599 |
encodingMatch:aEncodingMatch |
|
600 |
||
601 |
aEncodingMatch notNil ifTrue:[ |
|
602 |
filter := [:f | f encoding notNil |
|
603 |
and:[aEncodingMatch match:f encoding]]. |
|
604 |
]. |
|
605 |
! ! |
|
606 |
||
607 |
!FontSettingsApplication methodsFor:'actions'! |
|
608 |
||
609 |
basicReadFontSettings |
|
610 |
"/ View readStyleSheetAndUpdateAllStyleCaches. |
|
611 |
self allOfThem value:SimpleView defaultFont. |
|
612 |
self otherDef value:SimpleView defaultFont. |
|
613 |
self labelDef value:Label defaultFont. |
|
614 |
self buttonDef value:Button defaultFont. |
|
615 |
self listDef value:SelectionInListView defaultFont. |
|
616 |
self menuDef value:MenuView defaultFont. |
|
617 |
self textDef value:TextView defaultFont. |
|
618 |
self inputFieldDef value:EditField defaultFont. |
|
619 |
||
620 |
"Modified: / 10-10-2011 / 12:15:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
621 |
"Created: / 06-02-2012 / 12:22:39 / cg" |
|
622 |
! |
|
623 |
||
624 |
basicReadSettings |
|
625 |
self basicReadFontSettings. |
|
626 |
||
627 |
self readAspects: #(linuxFontWorkaround) from: currentUserPrefs |
|
628 |
||
629 |
"Modified: / 10-10-2011 / 12:15:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
630 |
"Modified: / 06-02-2012 / 12:22:51 / cg" |
|
631 |
! |
|
632 |
||
633 |
basicSaveSettings |
|
634 |
|fn| |
|
635 |
||
636 |
fn := self otherDef value. |
|
637 |
SimpleView withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
638 |
||
639 |
fn := self labelDef value. |
|
640 |
Label defaultFont:fn. |
|
641 |
CheckBox defaultFont:fn. |
|
642 |
||
643 |
fn := self buttonDef value. |
|
644 |
Button defaultFont:fn. |
|
645 |
Toggle defaultFont:fn. |
|
646 |
||
647 |
fn := self textDef value. |
|
648 |
TextView withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
649 |
||
650 |
fn := self inputFieldDef value. |
|
651 |
EditField withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
652 |
||
653 |
fn := self listDef value. |
|
654 |
SelectionInListView withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
655 |
||
656 |
fn := self menuDef value. |
|
657 |
ListView defaultFont:fn. |
|
658 |
MenuView defaultFont:fn. |
|
659 |
MenuPanel defaultFont:fn. |
|
660 |
NoteBookView defaultFont:fn. |
|
661 |
PullDownMenu defaultFont:fn. |
|
662 |
||
14494
680379a3dbef
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14491
diff
changeset
|
663 |
self writeAspects: #(linuxFontWorkaround) to: currentUserPrefs. |
680379a3dbef
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14491
diff
changeset
|
664 |
|
680379a3dbef
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14491
diff
changeset
|
665 |
DebugView newDebugger. |
14205 | 666 |
|
667 |
"Modified: / 10-10-2011 / 12:15:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
668 |
! |
|
669 |
||
670 |
changeAllFont |
|
671 |
|f| |
|
672 |
||
673 |
self withWaitCursorDo:[ |
|
674 |
f := FontPanel |
|
675 |
fontFromUserInitial:(self allOfThem value) |
|
676 |
title:(resources string:'Font for %1' with:'All') |
|
677 |
filter:filter. |
|
678 |
]. |
|
679 |
f notNil ifTrue:[ |
|
680 |
"/ self allOfThem value:(f onDevice:allLabel device). |
|
681 |
self otherDef value:(f onDevice:otherLabel device). |
|
682 |
self labelDef value:(f onDevice:labelLabel device). |
|
683 |
self buttonDef value:(f onDevice:buttonsLabel device). |
|
684 |
self listDef value:(f onDevice:listsLabel device). |
|
685 |
self menuDef value:(f onDevice:menuLabel device). |
|
686 |
self textDef value:(f onDevice:textLabel device). |
|
687 |
self inputFieldDef value:(f onDevice:inputFieldLabel device). |
|
688 |
] |
|
689 |
! |
|
690 |
||
691 |
changeButtonsFont |
|
692 |
self changeFontFor:self buttonDef labelTitle:'Buttons'. |
|
693 |
"/ |
|
694 |
"/ |f| |
|
695 |
"/ |
|
696 |
"/ f := FontPanel |
|
697 |
"/ fontFromUserInitial:(self buttonDef value) |
|
698 |
"/ title:(resources string:'Font for %1' with:'All') |
|
699 |
"/ filter:filter. |
|
700 |
"/ f notNil ifTrue:[ |
|
701 |
"/ self buttonDef value:(f onDevice:buttonsLabel device). |
|
702 |
"/ ] |
|
703 |
! |
|
704 |
||
705 |
changeFontFor:aHolder labelTitle:labelTitle |
|
706 |
|f | |
|
707 |
||
708 |
self withWaitCursorDo:[ |
|
709 |
f := FontPanel |
|
710 |
fontFromUserInitial:(aHolder value) |
|
711 |
title:(resources string:'Font for %1' with:labelTitle) |
|
712 |
filter:filter. |
|
713 |
]. |
|
714 |
f notNil ifTrue:[ |
|
715 |
aHolder value:(f onDevice:self graphicsDevice). |
|
716 |
]. |
|
717 |
! |
|
718 |
||
719 |
changeInputFieldFont |
|
720 |
self changeFontFor:self inputFieldDef labelTitle:'Input Fields'. |
|
721 |
"/ |f| |
|
722 |
"/ |
|
723 |
"/ f := FontPanel |
|
724 |
"/ fontFromUserInitial:(self inputFieldDef value) |
|
725 |
"/ title:(resources string:'Font for %1' with:'Input Fields') |
|
726 |
"/ filter:filter. |
|
727 |
"/ f notNil ifTrue:[ |
|
728 |
"/ self inputFieldDef value:(f onDevice:inputFieldLabel device). |
|
729 |
"/ ] |
|
730 |
! |
|
731 |
||
732 |
changeLabelsFont |
|
733 |
self changeFontFor:self labelDef labelTitle:'Labels'. |
|
734 |
"/ |f | |
|
735 |
"/ |
|
736 |
"/ f := FontPanel |
|
737 |
"/ fontFromUserInitial:(self labelDef value) |
|
738 |
"/ title:(resources string:'Font for %1' with:'Labels') |
|
739 |
"/ filter:filter. |
|
740 |
"/ f notNil ifTrue:[ |
|
741 |
"/ self labelDef value:(f onDevice:labelLabel device). |
|
742 |
"/ ]. |
|
743 |
! |
|
744 |
||
745 |
changeListsFont |
|
746 |
self changeFontFor:self listDef labelTitle:'Lists'. |
|
747 |
"/ |f| |
|
748 |
"/ |
|
749 |
"/ f := FontPanel |
|
750 |
"/ fontFromUserInitial:(self listDef value) |
|
751 |
"/ title:(resources string:'Font for %1' with:'Lists') |
|
752 |
"/ filter:filter. |
|
753 |
"/ f notNil ifTrue:[ |
|
754 |
"/ self listDef value:(f onDevice:listsLabel device). |
|
755 |
"/ ] |
|
756 |
! |
|
757 |
||
758 |
changeMenusFont |
|
759 |
self changeFontFor:self menuDef labelTitle:'Menus'. |
|
760 |
"/ |f| |
|
761 |
"/ |
|
762 |
"/ f := FontPanel |
|
763 |
"/ fontFromUserInitial:(self menuDef value) |
|
764 |
"/ title:(resources string:'Font for %1' with:'Menus') |
|
765 |
"/ filter:filter. |
|
766 |
"/ f notNil ifTrue:[ |
|
767 |
"/ self menuDef value:(f onDevice:menuLabel device). |
|
768 |
"/ ] |
|
769 |
! |
|
770 |
||
771 |
changeOtherFont |
|
772 |
self changeFontFor:self otherDef labelTitle:'All Others'. |
|
773 |
"/ |f| |
|
774 |
"/ |
|
775 |
"/ f := FontPanel |
|
776 |
"/ fontFromUserInitial:(self otherDef value) |
|
777 |
"/ title:(resources string:'Font for %1' with:'All Others') |
|
778 |
"/ filter:filter. |
|
779 |
"/ f notNil ifTrue:[ |
|
780 |
"/ self otherDef value:(f onDevice:otherLabel device). |
|
781 |
"/ ] |
|
782 |
! |
|
783 |
||
784 |
changeTextFont |
|
785 |
self changeFontFor:self textDef labelTitle:'Edited Text'. |
|
786 |
"/ |f| |
|
787 |
"/ |
|
788 |
"/ f := FontPanel |
|
789 |
"/ fontFromUserInitial:(self textDef value) |
|
790 |
"/ title:(resources string:'Font for %1' with:'Edited Text') |
|
791 |
"/ filter:filter. |
|
792 |
"/ f notNil ifTrue:[ |
|
793 |
"/ self textDef value:(f onDevice:textLabel device). |
|
794 |
"/ ] |
|
795 |
! ! |
|
796 |
||
797 |
!FontSettingsApplication methodsFor:'actions-common looks'! |
|
798 |
||
799 |
changeToBigFonts |
|
800 |
|fixFont variableFont| |
|
801 |
||
802 |
"/ fixFont := (Font family:'courier cew' face:'bold' style:'roman' size:14). |
|
803 |
"/ variableFont := (Font family:'arial' face:'bold' style:'roman' size:14). |
|
14494
680379a3dbef
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14491
diff
changeset
|
804 |
fixFont := (TextView defaultFont asSize:16). |
680379a3dbef
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14491
diff
changeset
|
805 |
variableFont := (Label defaultFont asSize:16). |
14205 | 806 |
self changeToFix:fixFont variable:variableFont. |
807 |
||
808 |
"Created: / 06-02-2012 / 12:12:55 / cg" |
|
809 |
! |
|
810 |
||
811 |
changeToDefault |
|
812 |
"/View readStyleSheetAndUpdateAllStyleCaches. |
|
813 |
View updateAllStyleCaches. |
|
814 |
self basicReadFontSettings. |
|
815 |
||
816 |
"Created: / 06-02-2012 / 12:06:00 / cg" |
|
817 |
! |
|
818 |
||
819 |
changeToFix:fixFont variable:variableFont |
|
820 |
self textDef value:fixFont. |
|
821 |
self inputFieldDef value:fixFont. |
|
822 |
||
823 |
self menuDef value:variableFont. |
|
824 |
self listDef value:variableFont. |
|
825 |
self labelDef value:variableFont. |
|
826 |
self buttonDef value:variableFont. |
|
827 |
self otherDef value:variableFont. |
|
828 |
||
829 |
self allOfThem value:variableFont. |
|
830 |
||
831 |
"Created: / 06-02-2012 / 12:18:34 / cg" |
|
832 |
! |
|
833 |
||
834 |
changeToHighContrast |
|
835 |
|fixFont variableFont| |
|
836 |
||
837 |
"/ fixFont := (Font family:'courier New' face:'bold' style:'roman' size:12). |
|
838 |
"/ variableFont := (Font family:'arial' face:'bold' style:'roman' size:12). |
|
839 |
fixFont := (TextView defaultFont asSize:12) asFace:'bold'. |
|
840 |
variableFont := (Label defaultFont asSize:12) asFace:'bold'. |
|
841 |
self changeToFix:fixFont variable:variableFont. |
|
842 |
||
843 |
"Created: / 06-02-2012 / 12:12:47 / cg" |
|
844 |
! |
|
845 |
||
846 |
changeToHugeFonts |
|
847 |
|fixFont variableFont| |
|
848 |
||
849 |
"/ fixFont := (Font family:'courier New' face:'bold' style:'roman' size:16). |
|
850 |
"/ variableFont := (Font family:'arial' face:'bold' style:'roman' size:16). |
|
14494
680379a3dbef
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14491
diff
changeset
|
851 |
fixFont := (TextView defaultFont asSize:18). |
680379a3dbef
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14491
diff
changeset
|
852 |
variableFont := (Label defaultFont asSize:18). |
14205 | 853 |
self changeToFix:fixFont variable:variableFont. |
854 |
||
855 |
"Created: / 17-03-2012 / 09:06:18 / cg" |
|
856 |
! |
|
857 |
||
858 |
changeToSTXLook |
|
859 |
|fixFont variableFont| |
|
860 |
||
861 |
fixFont := (Font family:'courier new' face:'medium' style:'roman' size:(TextView defaultFont size)). |
|
862 |
variableFont := (Font family:'arial' face:'medium' style:'roman' size:(TextView defaultFont size)). |
|
863 |
self changeToFix:fixFont variable:variableFont. |
|
864 |
||
865 |
"Created: / 17-03-2012 / 11:23:16 / cg" |
|
866 |
! |
|
867 |
||
868 |
changeToSTXLookXft |
|
869 |
|fixFont variableFont| |
|
870 |
||
871 |
XftFontDescription isNil ifTrue:[ |
|
872 |
self changeToSTXLook. |
|
873 |
^ self. |
|
874 |
]. |
|
875 |
||
14491
272ee29d4494
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14417
diff
changeset
|
876 |
fixFont := (XftFontDescription family:'Courier' face:'regular' style:'roman' size:(TextView defaultFont size)). |
272ee29d4494
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14417
diff
changeset
|
877 |
variableFont := (XftFontDescription family:'Arial' face:'regular' style:'roman' size:(TextView defaultFont size)). |
14205 | 878 |
self changeToFix:fixFont variable:variableFont. |
879 |
! |
|
880 |
||
881 |
changeToSqueakLook |
|
882 |
|variableFont| |
|
883 |
||
884 |
variableFont := (Font family:'arial' face:'medium' style:'roman' size:(TextView defaultFont size)). |
|
885 |
self changeToFix:variableFont variable:variableFont. |
|
886 |
||
887 |
"Created: / 17-03-2012 / 11:22:59 / cg" |
|
888 |
! |
|
889 |
||
890 |
changeToVisualAgeLook |
|
891 |
|variableFont variableBoldFont| |
|
892 |
||
893 |
variableBoldFont := (Font family:'arial' face:'bold' style:'roman' size:(TextView defaultFont size)). |
|
894 |
variableFont := (Font family:'arial' face:'medium' style:'roman' size:(TextView defaultFont size)). |
|
895 |
self changeToFix:variableBoldFont variable:variableBoldFont. |
|
896 |
||
897 |
self menuDef value:variableFont. |
|
898 |
||
899 |
"Created: / 17-03-2012 / 11:22:18 / cg" |
|
900 |
! ! |
|
901 |
||
902 |
!FontSettingsApplication methodsFor:'aspects'! |
|
903 |
||
904 |
allFontLabelHolder |
|
905 |
||
906 |
allFontLabelHolder isNil ifTrue:[ |
|
907 |
allFontLabelHolder := '' asValue. |
|
908 |
]. |
|
909 |
^ allFontLabelHolder. |
|
910 |
! |
|
911 |
||
912 |
allOfThem |
|
913 |
"return/create the 'allOfThem' value holder (automatically generated)" |
|
914 |
||
915 |
allOfThem isNil ifTrue:[ |
|
916 |
allOfThem := ValueHolder new. |
|
917 |
allOfThem addDependent:self. |
|
918 |
]. |
|
919 |
^ allOfThem |
|
920 |
! |
|
921 |
||
922 |
buttonDef |
|
923 |
"return/create the 'buttonDef' value holder (automatically generated)" |
|
924 |
||
925 |
buttonDef isNil ifTrue:[ |
|
926 |
buttonDef := ValueHolder new. |
|
927 |
buttonDef addDependent:self. |
|
928 |
]. |
|
929 |
^ buttonDef |
|
930 |
! |
|
931 |
||
932 |
buttonsFontLabelHolder |
|
933 |
||
934 |
buttonsFontLabelHolder isNil ifTrue:[ |
|
935 |
buttonsFontLabelHolder := '' asValue. |
|
936 |
]. |
|
937 |
^ buttonsFontLabelHolder. |
|
938 |
! |
|
939 |
||
940 |
infoText |
|
941 |
^ (self resources |
|
942 |
string:'FONT_SETTINGS_INFO' |
|
943 |
default:'Please notice that any changes usually only affect new windows. |
|
944 |
Existing windows usually remember their initial font as created. |
|
945 |
If required, reopen some of the views, including the Launcher itself. |
|
946 |
||
947 |
Also notice: |
|
948 |
unless you save your new settings, |
|
949 |
only the current session is affected by changes here.') withCRs |
|
950 |
||
951 |
"Created: / 17-08-2010 / 10:52:00 / cg" |
|
952 |
! |
|
953 |
||
954 |
inputFieldDef |
|
955 |
inputFieldDef isNil ifTrue:[ |
|
956 |
inputFieldDef := ValueHolder new. |
|
957 |
inputFieldDef addDependent:self. |
|
958 |
]. |
|
959 |
^ inputFieldDef |
|
960 |
! |
|
961 |
||
962 |
inputFieldFontLabelHolder |
|
963 |
||
964 |
inputFieldFontLabelHolder isNil ifTrue:[ |
|
965 |
inputFieldFontLabelHolder := '' asValue. |
|
966 |
]. |
|
967 |
^ inputFieldFontLabelHolder. |
|
968 |
! |
|
969 |
||
970 |
labelDef |
|
971 |
"return/create the 'labelDef' value holder (automatically generated)" |
|
972 |
||
973 |
labelDef isNil ifTrue:[ |
|
974 |
labelDef := ValueHolder new. |
|
975 |
labelDef addDependent:self. |
|
976 |
]. |
|
977 |
^ labelDef |
|
978 |
! |
|
979 |
||
980 |
labelsFontLabelHolder |
|
981 |
||
982 |
labelsFontLabelHolder isNil ifTrue:[ |
|
983 |
labelsFontLabelHolder := '' asValue. |
|
984 |
]. |
|
985 |
^ labelsFontLabelHolder. |
|
986 |
! |
|
987 |
||
988 |
linuxFontWorkaround |
|
989 |
||
990 |
linuxFontWorkaround isNil ifTrue:[ |
|
991 |
linuxFontWorkaround := false asValue. |
|
992 |
linuxFontWorkaround onChangeSend:#updateModifiedChannel to:self |
|
993 |
||
994 |
]. |
|
995 |
^ linuxFontWorkaround. |
|
996 |
||
997 |
"Created: / 10-10-2011 / 12:14:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
998 |
! |
|
999 |
||
1000 |
linuxFontWorkaroundVisible |
|
1001 |
||
1002 |
^OperatingSystem getOSType == #linux |
|
1003 |
||
1004 |
"Created: / 10-10-2011 / 12:57:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1005 |
! |
|
1006 |
||
1007 |
listDef |
|
1008 |
"return/create the 'listDef' value holder (automatically generated)" |
|
1009 |
||
1010 |
listDef isNil ifTrue:[ |
|
1011 |
listDef := ValueHolder new. |
|
1012 |
listDef addDependent:self. |
|
1013 |
]. |
|
1014 |
^ listDef |
|
1015 |
! |
|
1016 |
||
1017 |
listsFontLabelHolder |
|
1018 |
||
1019 |
listsFontLabelHolder isNil ifTrue:[ |
|
1020 |
listsFontLabelHolder := '' asValue. |
|
1021 |
]. |
|
1022 |
^ listsFontLabelHolder. |
|
1023 |
! |
|
1024 |
||
1025 |
menuDef |
|
1026 |
"return/create the 'menuDef' value holder (automatically generated)" |
|
1027 |
||
1028 |
menuDef isNil ifTrue:[ |
|
1029 |
menuDef := ValueHolder new. |
|
1030 |
menuDef addDependent:self. |
|
1031 |
]. |
|
1032 |
^ menuDef |
|
1033 |
! |
|
1034 |
||
1035 |
menusFontLabelHolder |
|
1036 |
||
1037 |
menusFontLabelHolder isNil ifTrue:[ |
|
1038 |
menusFontLabelHolder := '' asValue. |
|
1039 |
]. |
|
1040 |
^ menusFontLabelHolder. |
|
1041 |
! |
|
1042 |
||
1043 |
otherDef |
|
1044 |
otherDef isNil ifTrue:[ |
|
1045 |
otherDef := ValueHolder new. |
|
1046 |
otherDef addDependent:self. |
|
1047 |
]. |
|
1048 |
^ otherDef |
|
1049 |
! |
|
1050 |
||
1051 |
otherFontLabelHolder |
|
1052 |
||
1053 |
otherFontLabelHolder isNil ifTrue:[ |
|
1054 |
otherFontLabelHolder := '' asValue. |
|
1055 |
]. |
|
1056 |
^ otherFontLabelHolder. |
|
1057 |
! |
|
1058 |
||
1059 |
textDef |
|
1060 |
"return/create the 'textDef' value holder (automatically generated)" |
|
1061 |
||
1062 |
textDef isNil ifTrue:[ |
|
1063 |
textDef := ValueHolder new. |
|
1064 |
textDef addDependent:self. |
|
1065 |
]. |
|
1066 |
^ textDef |
|
1067 |
! |
|
1068 |
||
1069 |
textFontLabelHolder |
|
1070 |
||
1071 |
textFontLabelHolder isNil ifTrue:[ |
|
1072 |
textFontLabelHolder := '' asValue. |
|
1073 |
]. |
|
1074 |
^ textFontLabelHolder. |
|
1075 |
! ! |
|
1076 |
||
1077 |
!FontSettingsApplication methodsFor:'change & update'! |
|
1078 |
||
1079 |
update:something with:aParameter from:changedObject |
|
1080 |
|whichLabel whichFontLabelHolder| |
|
1081 |
||
1082 |
builder notNil ifTrue:[ |
|
1083 |
changedObject == self allOfThem ifTrue:[ |
|
1084 |
whichLabel := allLabel. |
|
1085 |
whichFontLabelHolder := self allFontLabelHolder. |
|
1086 |
]. |
|
1087 |
changedObject == self otherDef ifTrue:[ |
|
1088 |
whichLabel := otherLabel. |
|
1089 |
whichFontLabelHolder := self otherFontLabelHolder. |
|
1090 |
]. |
|
1091 |
changedObject == self labelDef ifTrue:[ |
|
1092 |
whichLabel := labelLabel. |
|
1093 |
whichFontLabelHolder := self labelsFontLabelHolder. |
|
1094 |
]. |
|
1095 |
changedObject == self buttonDef ifTrue:[ |
|
1096 |
whichLabel := buttonsLabel. |
|
1097 |
whichFontLabelHolder := self buttonsFontLabelHolder. |
|
1098 |
]. |
|
1099 |
changedObject == self listDef ifTrue:[ |
|
1100 |
whichLabel := listsLabel. |
|
1101 |
whichFontLabelHolder := self listsFontLabelHolder. |
|
1102 |
]. |
|
1103 |
changedObject == self menuDef ifTrue:[ |
|
1104 |
whichLabel := menuLabel. |
|
1105 |
whichFontLabelHolder := self menusFontLabelHolder. |
|
1106 |
]. |
|
1107 |
changedObject == self textDef ifTrue:[ |
|
1108 |
whichLabel := textLabel. |
|
1109 |
whichFontLabelHolder := self textFontLabelHolder. |
|
1110 |
]. |
|
1111 |
changedObject == self inputFieldDef ifTrue:[ |
|
1112 |
whichLabel := inputFieldLabel. |
|
1113 |
whichFontLabelHolder := self inputFieldFontLabelHolder. |
|
1114 |
]. |
|
1115 |
whichLabel notNil ifTrue:[ |
|
1116 |
self updateFontOfLabel:whichLabel andFontNameHolder:whichFontLabelHolder from:changedObject. |
|
1117 |
^ self. |
|
1118 |
] |
|
1119 |
]. |
|
1120 |
super update:something with:aParameter from:changedObject |
|
1121 |
! |
|
1122 |
||
1123 |
updateAllFontLabels |
|
1124 |
self update:#value with:nil from:self allOfThem. |
|
1125 |
self update:#value with:nil from:self otherDef. |
|
1126 |
self update:#value with:nil from:self labelDef. |
|
1127 |
self update:#value with:nil from:self buttonDef. |
|
1128 |
self update:#value with:nil from:self listDef. |
|
1129 |
self update:#value with:nil from:self menuDef. |
|
1130 |
self update:#value with:nil from:self textDef. |
|
1131 |
self update:#value with:nil from:self inputFieldDef. |
|
1132 |
! |
|
1133 |
||
1134 |
updateFontOfLabel:labelWidget andFontNameHolder:fontNameHolder from:changedObject |
|
1135 |
|f label| |
|
1136 |
||
1137 |
f := changedObject value. |
|
1138 |
labelWidget font:f. |
|
1139 |
label := f isNil ifTrue:[ |
|
1140 |
'' |
|
1141 |
] ifFalse:[ |
|
1142 |
f userFriendlyName |
|
1143 |
]. |
|
1144 |
fontNameHolder value:label. |
|
1145 |
self updateModifiedChannel |
|
1146 |
! ! |
|
1147 |
||
1148 |
!FontSettingsApplication methodsFor:'help'! |
|
1149 |
||
1150 |
helpFilename |
|
1151 |
^ 'Launcher/fontSettings.html' |
|
1152 |
! ! |
|
1153 |
||
1154 |
!FontSettingsApplication methodsFor:'initialization & release'! |
|
1155 |
||
1156 |
postBuildAllFontLabel:aWidget |
|
1157 |
||
1158 |
allLabel := aWidget. |
|
1159 |
! |
|
1160 |
||
1161 |
postBuildButtonsFontLabel:aWidget |
|
1162 |
||
1163 |
buttonsLabel := aWidget. |
|
1164 |
! |
|
1165 |
||
14569
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1166 |
postBuildHelpLabel:aWidget |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1167 |
aWidget level:0. |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1168 |
aWidget scrolledView backgroundColor:self window viewBackground. |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1169 |
aWidget font:(Label defaultFont). |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1170 |
! |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1171 |
|
14205 | 1172 |
postBuildInputFieldFontLabel:aWidget |
1173 |
||
1174 |
inputFieldLabel := aWidget. |
|
1175 |
! |
|
1176 |
||
1177 |
postBuildLabelsFontLabel:aWidget |
|
1178 |
||
1179 |
labelLabel := aWidget. |
|
1180 |
! |
|
1181 |
||
1182 |
postBuildListsFontLabel:aWidget |
|
1183 |
||
1184 |
listsLabel := aWidget. |
|
1185 |
! |
|
1186 |
||
1187 |
postBuildMenuesFontLabel:aWidget |
|
1188 |
||
1189 |
menuLabel := aWidget. |
|
1190 |
! |
|
1191 |
||
1192 |
postBuildOtherFontLabel:aWidget |
|
1193 |
||
1194 |
otherLabel := aWidget. |
|
1195 |
! |
|
1196 |
||
1197 |
postBuildTextFontLabel:aWidget |
|
1198 |
||
1199 |
textLabel := aWidget. |
|
1200 |
! |
|
1201 |
||
1202 |
postBuildWith:aBuilder |
|
1203 |
"/ self readSettings. |
|
1204 |
self updateAllFontLabels. |
|
1205 |
super postBuildWith:aBuilder |
|
1206 |
! ! |
|
1207 |
||
1208 |
!FontSettingsApplication methodsFor:'queries'! |
|
1209 |
||
1210 |
hasUnsavedChanges |
|
1211 |
self otherDef value ~= View defaultFont ifTrue:[^ true]. |
|
1212 |
self labelDef value ~= Label defaultFont ifTrue:[^ true]. |
|
1213 |
self buttonDef value ~= Button defaultFont ifTrue:[^ true]. |
|
1214 |
self listDef value ~= SelectionInListView defaultFont ifTrue:[^ true]. |
|
1215 |
self menuDef value ~= MenuView defaultFont ifTrue:[^ true]. |
|
1216 |
self textDef value ~= TextView defaultFont ifTrue:[^ true]. |
|
1217 |
self inputFieldDef value ~= EditField defaultFont ifTrue:[^ true]. |
|
1218 |
||
1219 |
(self hasChangedAspectIn: #(linuxFontWorkaround) asComparedTo:currentUserPrefs) ifTrue:[^ true]. |
|
1220 |
||
1221 |
^ false |
|
1222 |
||
1223 |
"Modified: / 10-10-2011 / 12:14:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1224 |
! |
|
1225 |
||
1226 |
hasXftFonts |
|
1227 |
^ (Display platformName = 'X11') and:[ XftFontDescription notNil ] |
|
1228 |
! ! |
|
1229 |
||
1230 |
!FontSettingsApplication class methodsFor:'documentation'! |
|
1231 |
||
1232 |
version |
|
14569
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1233 |
^ '$Header: /cvs/stx/stx/libtool/Tools__FontSettingsApplication.st,v 1.7 2014-07-03 12:01:06 cg Exp $' |
14205 | 1234 |
! |
1235 |
||
1236 |
version_CVS |
|
14569
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1237 |
^ '$Header: /cvs/stx/stx/libtool/Tools__FontSettingsApplication.st,v 1.7 2014-07-03 12:01:06 cg Exp $' |
14205 | 1238 |
! ! |
1239 |