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