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