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