author | Patrik Svestka <patrik.svestka@gmail.com> |
Fri, 19 Nov 2021 14:35:04 +0100 | |
branch | jv |
changeset 19620 | 8d670b9a4937 |
parent 18226 | 346376844040 |
permissions | -rw-r--r-- |
17249 | 1 |
" |
2 |
COPYRIGHT (c) 2014 by eXept Software AG |
|
18226 | 3 |
COPYRIGHT (c) 2016 Jan Vrany |
17249 | 4 |
All Rights Reserved |
5 |
||
6 |
This software is furnished under a license and may be used |
|
7 |
only in accordance with the terms of that license and with the |
|
8 |
inclusion of the above copyright notice. This software may not |
|
9 |
be provided or otherwise made available to, or used by, any |
|
10 |
other person. No title to or ownership of the software is |
|
11 |
hereby transferred. |
|
12 |
" |
|
14205 | 13 |
"{ Package: 'stx:libtool' }" |
14 |
||
14213
ebed72d87fe8
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14205
diff
changeset
|
15 |
"{ NameSpace: Tools }" |
ebed72d87fe8
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14205
diff
changeset
|
16 |
|
14205 | 17 |
AbstractSettingsApplication subclass:#FontSettingsApplication |
18 |
instanceVariableNames:'filter allOfThem labelDef buttonDef listDef menuDef textDef |
|
19 |
othersDef allFontLabelHolder buttonsFontLabelHolder |
|
20 |
textFontLabelHolder labelsFontLabelHolder listsFontLabelHolder |
|
21 |
menusFontLabelHolder otherFontLabelHolder allLabel buttonsLabel |
|
22 |
textLabel labelLabel listsLabel menuLabel inputFieldLabel |
|
23 |
inputFieldDef inputFieldFontLabelHolder otherLabel |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
24 |
linuxFontWorkaround otherDef tooltipDef tooltipFontLabelHolder |
15932 | 25 |
tooltipLabel useXftFontsOnly fontSizeSelectionHolder |
16460 | 26 |
lookSelectionHolder useXFontsOnly' |
14205 | 27 |
classVariableNames:'' |
28 |
poolDictionaries:'' |
|
29 |
category:'Interface-Smalltalk' |
|
30 |
! |
|
31 |
||
17249 | 32 |
!FontSettingsApplication class methodsFor:'documentation'! |
33 |
||
34 |
copyright |
|
35 |
" |
|
36 |
COPYRIGHT (c) 2014 by eXept Software AG |
|
18226 | 37 |
COPYRIGHT (c) 2016 Jan Vrany |
17249 | 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 |
||
64 |
flyByHelpSpec |
|
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 |
||
77 |
^ super flyByHelpSpec addPairsFrom:#( |
|
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 |
|
16460 | 564 |
label: 'Only Use Xft Fonts / Suppress Ugly X-Fonts (Unix Only)' |
15887 | 565 |
name: 'CheckBox1' |
15932 | 566 |
activeHelpKey: useXftFontsOnly |
15887 | 567 |
visibilityChannel: useXftFontsOnlyVisible |
16460 | 568 |
enableChannel: useXftFontsOnlyEnabled |
15887 | 569 |
model: useXftFontsOnly |
570 |
translateLabel: true |
|
571 |
extent: (Point 637 30) |
|
572 |
) |
|
16460 | 573 |
(CheckBoxSpec |
574 |
label: 'Only Use X Fonts / Suppress Slow Xft-Fonts (Unix Only)' |
|
575 |
name: 'CheckBox2' |
|
16482 | 576 |
activeHelpKey: useXFontsOnly |
16460 | 577 |
visibilityChannel: useXFontsOnlyVisible |
578 |
enableChannel: useXFontsOnlyEnabled |
|
579 |
model: useXFontsOnly |
|
580 |
translateLabel: true |
|
581 |
extent: (Point 637 30) |
|
582 |
) |
|
14205 | 583 |
(DividerSpec |
584 |
name: 'Separator12' |
|
585 |
visibilityChannel: linuxFontWorkaroundVisible |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
586 |
extent: (Point 637 3) |
14205 | 587 |
) |
588 |
(ViewSpec |
|
589 |
name: 'SpecialsBox' |
|
590 |
component: |
|
591 |
(SpecCollection |
|
592 |
collection: ( |
|
593 |
(ActionButtonSpec |
|
594 |
label: 'Default' |
|
595 |
name: 'Button2' |
|
15887 | 596 |
layout: (LayoutFrame 0 0.0 13 0 130 0 35 0) |
14205 | 597 |
activeHelpKey: resetToDefault |
598 |
translateLabel: true |
|
599 |
tabable: true |
|
600 |
model: changeToDefault |
|
601 |
) |
|
15932 | 602 |
(LabelSpec |
603 |
label: 'Font Size:' |
|
604 |
name: 'Label9' |
|
605 |
layout: (LayoutFrame 148 0.0 13 0 298 0 35 0) |
|
606 |
translateLabel: true |
|
607 |
adjust: left |
|
608 |
) |
|
609 |
(ComboListSpec |
|
610 |
name: 'ComboList1' |
|
611 |
layout: (LayoutFrame 256 0 13 0 0 1 35 0) |
|
612 |
model: fontSizeSelectionHolder |
|
613 |
comboList: fontSizeListLabels |
|
614 |
useIndex: true |
|
615 |
) |
|
14205 | 616 |
(ActionButtonSpec |
617 |
label: 'High Contrast' |
|
15932 | 618 |
name: 'Button13' |
619 |
layout: (LayoutFrame 256 0.0 77 0 386 0 99 0) |
|
14205 | 620 |
activeHelpKey: changeToHighContrast |
621 |
translateLabel: true |
|
622 |
tabable: true |
|
623 |
model: changeToHighContrast |
|
624 |
) |
|
15932 | 625 |
(LabelSpec |
626 |
label: 'Look:' |
|
627 |
name: 'Label10' |
|
15887 | 628 |
layout: (LayoutFrame 148 0.0 45 0 298 0 67 0) |
14205 | 629 |
translateLabel: true |
15932 | 630 |
adjust: left |
14205 | 631 |
) |
15932 | 632 |
(ComboListSpec |
633 |
name: 'ComboList2' |
|
634 |
layout: (LayoutFrame 256 0 45 0 0 1 67 0) |
|
635 |
model: lookSelectionHolder |
|
636 |
comboList: lookListLabels |
|
637 |
useIndex: true |
|
14205 | 638 |
) |
639 |
(ActionButtonSpec |
|
15932 | 640 |
label: 'Use Xft Fonts' |
14205 | 641 |
name: 'Button10' |
15932 | 642 |
layout: (LayoutFrame 0 0.0 77 0 130 0 99 0) |
14205 | 643 |
activeHelpKey: changeToSTXLookXft |
644 |
translateLabel: true |
|
645 |
tabable: true |
|
15932 | 646 |
model: changeToUseXft |
14205 | 647 |
enableChannel: hasXftFonts |
648 |
) |
|
15932 | 649 |
(ActionButtonSpec |
650 |
label: 'Normal Contrast' |
|
651 |
name: 'Button14' |
|
652 |
layout: (LayoutFrame 400 0.0 77 0 530 0 99 0) |
|
653 |
activeHelpKey: changeToNormalContrast |
|
654 |
translateLabel: true |
|
655 |
tabable: true |
|
656 |
model: changeToNormalContrast |
|
657 |
) |
|
14205 | 658 |
) |
659 |
||
660 |
) |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
661 |
extent: (Point 637 124) |
14205 | 662 |
) |
663 |
) |
|
664 |
||
665 |
) |
|
666 |
) |
|
667 |
) |
|
668 |
||
669 |
) |
|
670 |
) |
|
671 |
! ! |
|
672 |
||
673 |
!FontSettingsApplication methodsFor:'accessing'! |
|
674 |
||
675 |
encodingMatch:aEncodingMatch |
|
676 |
||
677 |
aEncodingMatch notNil ifTrue:[ |
|
678 |
filter := [:f | f encoding notNil |
|
679 |
and:[aEncodingMatch match:f encoding]]. |
|
680 |
]. |
|
681 |
! ! |
|
682 |
||
683 |
!FontSettingsApplication methodsFor:'actions'! |
|
684 |
||
685 |
basicReadFontSettings |
|
16320 | 686 |
|prefs readFont sz lookIdx idx defaultTextFont| |
16981 | 687 |
|
688 |
self readAspects:#(useXftFontsOnly useXFontsOnly) from:currentUserPrefs. |
|
15887 | 689 |
|
16981 | 690 |
prefs := currentUserPrefs fontPreferences. |
15887 | 691 |
prefs isNil ifTrue:[ |
692 |
prefs := Dictionary new. |
|
693 |
]. |
|
694 |
||
695 |
readFont := |
|
696 |
[:key :default | |
|
697 |
|s fn| |
|
698 |
||
699 |
s := prefs at:key ifAbsent:nil. |
|
700 |
s notNil ifTrue:[ |
|
15892 | 701 |
fn := Object readFrom:s. |
15887 | 702 |
self useXftFontsOnly value ifTrue:[ |
703 |
fn := XftFontDescription for:fn |
|
704 |
]. |
|
705 |
]. |
|
706 |
fn isNil ifTrue:[ |
|
707 |
fn := default. |
|
708 |
]. |
|
709 |
fn |
|
710 |
]. |
|
711 |
||
15933 | 712 |
self allOfThem value:View defaultFont. |
713 |
self otherDef value:(readFont value:#Other value:View defaultFont). |
|
15887 | 714 |
self labelDef value:(readFont value:#Label value:Label defaultFont). |
715 |
self buttonDef value:(readFont value:#Button value:Button defaultFont). |
|
716 |
self listDef value:(readFont value:#List value:SelectionInListView defaultFont). |
|
717 |
self menuDef value:(readFont value:#Menu value:MenuView defaultFont). |
|
718 |
self textDef value:(readFont value:#Text value:TextView defaultFont). |
|
719 |
self inputFieldDef value:(readFont value:#InputField value:EditField defaultFont). |
|
720 |
self tooltipDef value:(readFont value:#Tooltip value:ActiveHelpView defaultFont). |
|
14205 | 721 |
|
15932 | 722 |
sz := TextView defaultFont size. |
723 |
idx := self fontSizeListValues indexOf:sz. |
|
724 |
idx ~~ 0 ifTrue:[ |
|
15933 | 725 |
self fontSizeSelectionHolder value:idx withoutNotifying:self. |
15932 | 726 |
]. |
727 |
||
728 |
lookIdx := nil. |
|
16320 | 729 |
defaultTextFont := TextView defaultFont. |
730 |
(defaultTextFont face = #bold) ifTrue:[ |
|
731 |
lookIdx := self lookListValues indexOf:#vage. |
|
15932 | 732 |
] ifFalse:[ |
16981 | 733 |
(defaultTextFont onDevice:self device) isFixedWidth ifTrue:[ |
16320 | 734 |
lookIdx := self lookListValues indexOf:#stx. |
15932 | 735 |
] ifFalse:[ |
16320 | 736 |
lookIdx := self lookListValues indexOf:#squeak. |
15932 | 737 |
]. |
738 |
]. |
|
15933 | 739 |
self lookSelectionHolder value:lookIdx withoutNotifying:self |
15932 | 740 |
|
14205 | 741 |
"Modified: / 10-10-2011 / 12:15:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
742 |
"Created: / 06-02-2012 / 12:22:39 / cg" |
|
743 |
! |
|
744 |
||
745 |
basicReadSettings |
|
746 |
self basicReadFontSettings. |
|
747 |
||
748 |
"Modified: / 06-02-2012 / 12:22:51 / cg" |
|
16301
5b709afd8d92
Remove obsolete setting for #linuxFontWorkaround.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16293
diff
changeset
|
749 |
"Modified: / 20-04-2016 / 20:16:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14205 | 750 |
! |
751 |
||
752 |
basicSaveSettings |
|
16460 | 753 |
"/ |fn| |
14205 | 754 |
|
16570 | 755 |
self writeAspects: #( useXftFontsOnly useXFontsOnly) to: currentUserPrefs. |
16981 | 756 |
currentUserPrefs fontPreferences:self fontSpecDictionary. |
15887 | 757 |
|
758 |
"/ fn := self otherDef value. |
|
759 |
"/ SimpleView withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
760 |
"/ |
|
761 |
"/ fn := self labelDef value. |
|
762 |
"/ Label defaultFont:fn. |
|
763 |
"/ CheckBox defaultFont:fn. |
|
764 |
"/ |
|
765 |
"/ fn := self buttonDef value. |
|
766 |
"/ Button defaultFont:fn. |
|
767 |
"/ Toggle defaultFont:fn. |
|
768 |
"/ |
|
769 |
"/ fn := self textDef value. |
|
770 |
"/ TextView withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
771 |
"/ |
|
772 |
"/ fn := self inputFieldDef value. |
|
773 |
"/ EditField withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
774 |
"/ |
|
775 |
"/ fn := self listDef value. |
|
776 |
"/ SelectionInListView withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
777 |
"/ |
|
778 |
"/ fn := self tooltipDef value. |
|
779 |
"/ ActiveHelpView withAllSubclasses do:[:cls | cls defaultFont:fn]. |
|
780 |
"/ |
|
781 |
"/ fn := self menuDef value. |
|
782 |
"/ ListView defaultFont:fn. |
|
783 |
"/ MenuView defaultFont:fn. |
|
784 |
"/ MenuPanel defaultFont:fn. |
|
785 |
"/ NoteBookView defaultFont:fn. |
|
786 |
"/ PullDownMenu defaultFont:fn. |
|
14494
680379a3dbef
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14491
diff
changeset
|
787 |
|
680379a3dbef
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14491
diff
changeset
|
788 |
DebugView newDebugger. |
14205 | 789 |
|
16301
5b709afd8d92
Remove obsolete setting for #linuxFontWorkaround.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16293
diff
changeset
|
790 |
"Modified: / 20-04-2016 / 20:16:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14205 | 791 |
! |
792 |
||
793 |
changeAllFont |
|
794 |
|f| |
|
795 |
||
796 |
self withWaitCursorDo:[ |
|
797 |
f := FontPanel |
|
798 |
fontFromUserInitial:(self allOfThem value) |
|
799 |
title:(resources string:'Font for %1' with:'All') |
|
800 |
filter:filter. |
|
801 |
]. |
|
802 |
f notNil ifTrue:[ |
|
803 |
"/ self allOfThem value:(f onDevice:allLabel device). |
|
804 |
self otherDef value:(f onDevice:otherLabel device). |
|
805 |
self labelDef value:(f onDevice:labelLabel device). |
|
806 |
self buttonDef value:(f onDevice:buttonsLabel device). |
|
807 |
self listDef value:(f onDevice:listsLabel device). |
|
808 |
self menuDef value:(f onDevice:menuLabel device). |
|
809 |
self textDef value:(f onDevice:textLabel device). |
|
810 |
self inputFieldDef value:(f onDevice:inputFieldLabel device). |
|
16080 | 811 |
self tooltipDef value:(f onDevice:tooltipLabel device). |
14205 | 812 |
] |
813 |
! |
|
814 |
||
815 |
changeButtonsFont |
|
816 |
self changeFontFor:self buttonDef labelTitle:'Buttons'. |
|
817 |
! |
|
818 |
||
819 |
changeFontFor:aHolder labelTitle:labelTitle |
|
820 |
|f | |
|
821 |
||
822 |
self withWaitCursorDo:[ |
|
823 |
f := FontPanel |
|
824 |
fontFromUserInitial:(aHolder value) |
|
825 |
title:(resources string:'Font for %1' with:labelTitle) |
|
826 |
filter:filter. |
|
827 |
]. |
|
828 |
f notNil ifTrue:[ |
|
829 |
aHolder value:(f onDevice:self graphicsDevice). |
|
830 |
]. |
|
831 |
! |
|
832 |
||
833 |
changeInputFieldFont |
|
834 |
self changeFontFor:self inputFieldDef labelTitle:'Input Fields'. |
|
835 |
! |
|
836 |
||
837 |
changeLabelsFont |
|
838 |
self changeFontFor:self labelDef labelTitle:'Labels'. |
|
839 |
! |
|
840 |
||
841 |
changeListsFont |
|
842 |
self changeFontFor:self listDef labelTitle:'Lists'. |
|
843 |
! |
|
844 |
||
845 |
changeMenusFont |
|
846 |
self changeFontFor:self menuDef labelTitle:'Menus'. |
|
847 |
! |
|
848 |
||
849 |
changeOtherFont |
|
850 |
self changeFontFor:self otherDef labelTitle:'All Others'. |
|
851 |
! |
|
852 |
||
853 |
changeTextFont |
|
854 |
self changeFontFor:self textDef labelTitle:'Edited Text'. |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
855 |
! |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
856 |
|
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
857 |
changeTooltipFont |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
858 |
self changeFontFor:self tooltipDef labelTitle:'Tooltops'. |
15932 | 859 |
! |
860 |
||
16981 | 861 |
defaultFontSpecDictionary |
862 |
^ Dictionary new |
|
863 |
at:#Other put:View defaultFont storeString; |
|
864 |
at:#Label put:View defaultFont storeString; |
|
865 |
at:#Button put:Button defaultFont storeString; |
|
866 |
at:#Text put:TextView defaultFont storeString; |
|
867 |
at:#InputField put:EditField defaultFont storeString; |
|
868 |
at:#List put:SelectionInListView defaultFont storeString; |
|
869 |
at:#Tooltip put:ActiveHelpView defaultFont storeString; |
|
870 |
at:#Menu put:MenuView defaultFont storeString; |
|
871 |
yourself |
|
872 |
! |
|
873 |
||
15932 | 874 |
fontSizeSelectionChanged |
875 |
|idx sz| |
|
876 |
||
877 |
idx := self fontSizeSelectionHolder value. |
|
878 |
sz := self fontSizeListValues at:idx ifAbsent:nil. |
|
879 |
sz notNil ifTrue:[ |
|
880 |
self changeToFontsWithSize:sz |
|
881 |
]. |
|
882 |
! |
|
883 |
||
16978 | 884 |
fontSpecDictionary |
885 |
^ Dictionary new |
|
886 |
at:#Other put:(self otherDef value storeString); |
|
887 |
at:#Label put:(self labelDef value storeString); |
|
888 |
at:#Button put:(self buttonDef value storeString); |
|
889 |
at:#Text put:(self textDef value storeString); |
|
890 |
at:#InputField put:(self inputFieldDef value storeString); |
|
891 |
at:#List put:(self listDef value storeString); |
|
892 |
at:#Tooltip put:(self tooltipDef value storeString); |
|
893 |
at:#Menu put:(self menuDef value storeString); |
|
894 |
yourself |
|
895 |
! |
|
896 |
||
15932 | 897 |
lookSelectionChanged |
898 |
|idx look| |
|
899 |
||
900 |
idx := self lookSelectionHolder value. |
|
901 |
look := self lookListValues at:idx ifAbsent:nil. |
|
902 |
look notNil ifTrue:[ |
|
903 |
look == #stx ifTrue:[ |
|
904 |
self changeToSTXLook |
|
905 |
] ifFalse:[ |
|
906 |
look == #squeak ifTrue:[ |
|
907 |
self changeToSqueakLook |
|
908 |
] ifFalse:[ |
|
909 |
look == #vage ifTrue:[ |
|
910 |
self changeToVisualAgeLook |
|
911 |
] |
|
912 |
] |
|
913 |
]. |
|
914 |
]. |
|
17152 | 915 |
! |
916 |
||
917 |
readFontsFromWidgetDefaults |
|
918 |
|sz idx| |
|
919 |
||
920 |
self allOfThem value:View defaultFont. |
|
921 |
self otherDef value:(View defaultFont). |
|
922 |
self labelDef value:(Label defaultFont). |
|
923 |
self buttonDef value:(Button defaultFont). |
|
924 |
self listDef value:(SelectionInListView defaultFont). |
|
925 |
self menuDef value:(MenuView defaultFont). |
|
926 |
self textDef value:(TextView defaultFont). |
|
927 |
self inputFieldDef value:(EditField defaultFont). |
|
928 |
self tooltipDef value:(ActiveHelpView defaultFont). |
|
929 |
||
930 |
sz := TextView defaultFont size. |
|
931 |
idx := self fontSizeListValues indexOf:sz. |
|
932 |
idx ~~ 0 ifTrue:[ |
|
933 |
self fontSizeSelectionHolder value:idx withoutNotifying:self. |
|
934 |
]. |
|
14205 | 935 |
! ! |
936 |
||
937 |
!FontSettingsApplication methodsFor:'actions-common looks'! |
|
938 |
||
939 |
changeToBigFonts |
|
15932 | 940 |
self changeToFontsWithSize:16 |
14205 | 941 |
! |
942 |
||
943 |
changeToDefault |
|
944 |
"/View readStyleSheetAndUpdateAllStyleCaches. |
|
17152 | 945 |
SimpleView readStyleSheet. |
14205 | 946 |
View updateAllStyleCaches. |
17152 | 947 |
self readFontsFromWidgetDefaults. |
14205 | 948 |
|
949 |
"Created: / 06-02-2012 / 12:06:00 / cg" |
|
950 |
! |
|
951 |
||
952 |
changeToFix:fixFont variable:variableFont |
|
953 |
self textDef value:fixFont. |
|
954 |
self inputFieldDef value:fixFont. |
|
955 |
||
956 |
self menuDef value:variableFont. |
|
957 |
self listDef value:variableFont. |
|
958 |
self labelDef value:variableFont. |
|
959 |
self buttonDef value:variableFont. |
|
960 |
self otherDef value:variableFont. |
|
16080 | 961 |
self tooltipDef value:variableFont. |
14205 | 962 |
|
963 |
self allOfThem value:variableFont. |
|
964 |
||
965 |
"Created: / 06-02-2012 / 12:18:34 / cg" |
|
966 |
! |
|
967 |
||
15932 | 968 |
changeToFontsWithSize:points |
969 |
|f fixFont variableFont| |
|
970 |
||
971 |
f := TextView defaultFont. |
|
972 |
f := f asSize:points. |
|
973 |
TextView defaultFont:f. |
|
974 |
||
975 |
fixFont := (self textDef value "TextView defaultFont" asSize:points). |
|
976 |
variableFont := (self labelDef value "Label defaultFont" asSize:points). |
|
977 |
self changeToFix:fixFont variable:variableFont. |
|
978 |
! |
|
979 |
||
14205 | 980 |
changeToHighContrast |
981 |
|fixFont variableFont| |
|
982 |
||
15932 | 983 |
fixFont := (self textDef value "TextView defaultFont") asFace:'bold'. |
984 |
variableFont := (self labelDef value "Label defaultFont") asFace:'bold'. |
|
14205 | 985 |
self changeToFix:fixFont variable:variableFont. |
986 |
||
987 |
"Created: / 06-02-2012 / 12:12:47 / cg" |
|
988 |
! |
|
989 |
||
990 |
changeToHugeFonts |
|
15932 | 991 |
self changeToFontsWithSize:18 |
992 |
! |
|
993 |
||
994 |
changeToNormalContrast |
|
14205 | 995 |
|fixFont variableFont| |
996 |
||
15932 | 997 |
fixFont := (self textDef value "TextView defaultFont") asFace:'medium'. |
998 |
variableFont := (self labelDef value "Label defaultFont") asFace:'medium'. |
|
14205 | 999 |
self changeToFix:fixFont variable:variableFont. |
1000 |
||
15932 | 1001 |
"Created: / 06-02-2012 / 12:12:47 / cg" |
14205 | 1002 |
! |
1003 |
||
1004 |
changeToSTXLook |
|
15932 | 1005 |
self changeToSTXLookWithSize:(TextView defaultFont size) |
1006 |
! |
|
1007 |
||
1008 |
changeToSTXLookSmall |
|
1009 |
|f| |
|
1010 |
||
1011 |
f := TextView defaultFont. |
|
1012 |
f := f asSize:10. |
|
1013 |
TextView defaultFont:f. |
|
1014 |
||
1015 |
self changeToSTXLook. |
|
1016 |
! |
|
1017 |
||
1018 |
changeToSTXLookSmallXft |
|
1019 |
|f| |
|
1020 |
||
1021 |
f := TextView defaultFont. |
|
1022 |
f := f asSize:10. |
|
1023 |
TextView defaultFont:f. |
|
1024 |
||
1025 |
self changeToSTXLookXft |
|
1026 |
! |
|
1027 |
||
1028 |
changeToSTXLookWithSize:points |
|
14205 | 1029 |
|fixFont variableFont| |
1030 |
||
15932 | 1031 |
fixFont := (Font family:'courier new' face:'medium' style:'roman' size:points). |
1032 |
variableFont := (Font family:'arial' face:'medium' style:'roman' size:points). |
|
14205 | 1033 |
self changeToFix:fixFont variable:variableFont. |
1034 |
||
1035 |
"Created: / 17-03-2012 / 11:23:16 / cg" |
|
1036 |
! |
|
1037 |
||
1038 |
changeToSTXLookXft |
|
1039 |
|fixFont variableFont| |
|
1040 |
||
16094 | 1041 |
self hasXftFonts ifFalse:[ |
14205 | 1042 |
self changeToSTXLook. |
1043 |
^ self. |
|
1044 |
]. |
|
1045 |
||
16094 | 1046 |
fixFont := XftFontDescription family:'Courier' face:'regular' style:'roman' size:(TextView defaultFont size). |
1047 |
variableFont := XftFontDescription family:'Arial' face:'regular' style:'roman' size:(TextView defaultFont size). |
|
14205 | 1048 |
self changeToFix:fixFont variable:variableFont. |
1049 |
! |
|
1050 |
||
15932 | 1051 |
changeToSmallFonts |
1052 |
self changeToFontsWithSize:10 |
|
1053 |
! |
|
1054 |
||
14205 | 1055 |
changeToSqueakLook |
1056 |
|variableFont| |
|
1057 |
||
1058 |
variableFont := (Font family:'arial' face:'medium' style:'roman' size:(TextView defaultFont size)). |
|
1059 |
self changeToFix:variableFont variable:variableFont. |
|
1060 |
||
1061 |
"Created: / 17-03-2012 / 11:22:59 / cg" |
|
1062 |
! |
|
1063 |
||
15932 | 1064 |
changeToUseXft |
1065 |
||
1066 |
|fixFont variableFont| |
|
1067 |
||
16094 | 1068 |
self hasXftFonts ifFalse:[ |
15932 | 1069 |
^ self. |
1070 |
]. |
|
1071 |
||
1072 |
TextView defaultFont:(XftFontDescription family:'Courier' face:'regular' style:'roman' size:(TextView defaultFont size)). |
|
1073 |
Label defaultFont:(XftFontDescription family:'Arial' face:'regular' style:'roman' size:(Label defaultFont size)). |
|
1074 |
||
16094 | 1075 |
fixFont := XftFontDescription family:'Courier' face:'regular' style:'roman' size:(TextView defaultFont size). |
1076 |
variableFont := XftFontDescription family:'Arial' face:'regular' style:'roman' size:(TextView defaultFont size). |
|
15932 | 1077 |
self changeToFix:fixFont variable:variableFont. |
1078 |
! |
|
1079 |
||
14205 | 1080 |
changeToVisualAgeLook |
1081 |
|variableFont variableBoldFont| |
|
1082 |
||
1083 |
variableBoldFont := (Font family:'arial' face:'bold' style:'roman' size:(TextView defaultFont size)). |
|
1084 |
variableFont := (Font family:'arial' face:'medium' style:'roman' size:(TextView defaultFont size)). |
|
1085 |
self changeToFix:variableBoldFont variable:variableBoldFont. |
|
1086 |
||
1087 |
self menuDef value:variableFont. |
|
1088 |
||
1089 |
"Created: / 17-03-2012 / 11:22:18 / cg" |
|
1090 |
! ! |
|
1091 |
||
1092 |
!FontSettingsApplication methodsFor:'aspects'! |
|
1093 |
||
1094 |
allFontLabelHolder |
|
1095 |
||
1096 |
allFontLabelHolder isNil ifTrue:[ |
|
1097 |
allFontLabelHolder := '' asValue. |
|
1098 |
]. |
|
1099 |
^ allFontLabelHolder. |
|
1100 |
! |
|
1101 |
||
1102 |
allOfThem |
|
1103 |
"return/create the 'allOfThem' value holder (automatically generated)" |
|
1104 |
||
1105 |
allOfThem isNil ifTrue:[ |
|
1106 |
allOfThem := ValueHolder new. |
|
1107 |
allOfThem addDependent:self. |
|
1108 |
]. |
|
1109 |
^ allOfThem |
|
1110 |
! |
|
1111 |
||
1112 |
buttonDef |
|
1113 |
"return/create the 'buttonDef' value holder (automatically generated)" |
|
1114 |
||
1115 |
buttonDef isNil ifTrue:[ |
|
1116 |
buttonDef := ValueHolder new. |
|
1117 |
buttonDef addDependent:self. |
|
1118 |
]. |
|
1119 |
^ buttonDef |
|
1120 |
! |
|
1121 |
||
1122 |
buttonsFontLabelHolder |
|
1123 |
||
1124 |
buttonsFontLabelHolder isNil ifTrue:[ |
|
1125 |
buttonsFontLabelHolder := '' asValue. |
|
1126 |
]. |
|
1127 |
^ buttonsFontLabelHolder. |
|
1128 |
! |
|
1129 |
||
15932 | 1130 |
fontSizeLabelsAndValues |
1131 |
^ #( |
|
1132 |
('Default (12)' 12) |
|
1133 |
(nil nil) |
|
1134 |
('Tiny (8)' 8) |
|
1135 |
('Small (10)' 10) |
|
1136 |
('Big (16)' 16) |
|
1137 |
('Huge (18)' 18) |
|
1138 |
('<keep as is>' nil) |
|
1139 |
) |
|
1140 |
! |
|
1141 |
||
1142 |
fontSizeListLabels |
|
1143 |
^ self fontSizeLabelsAndValues collect:[:each | each first]. |
|
1144 |
! |
|
1145 |
||
1146 |
fontSizeListValues |
|
1147 |
^ self fontSizeLabelsAndValues collect:[:each | each second]. |
|
1148 |
! |
|
1149 |
||
1150 |
fontSizeSelectionHolder |
|
1151 |
fontSizeSelectionHolder isNil ifTrue:[ |
|
1152 |
fontSizeSelectionHolder := nil asValue. |
|
1153 |
fontSizeSelectionHolder onChangeSend:#fontSizeSelectionChanged to:self. |
|
1154 |
]. |
|
1155 |
^ fontSizeSelectionHolder |
|
1156 |
! |
|
1157 |
||
14205 | 1158 |
infoText |
1159 |
^ (self resources |
|
1160 |
string:'FONT_SETTINGS_INFO' |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1161 |
default:'Please notice that changes only affect new windows. |
14205 | 1162 |
Existing windows usually remember their initial font as created. |
1163 |
If required, reopen some of the views, including the Launcher itself. |
|
1164 |
||
1165 |
Also notice: |
|
1166 |
unless you save your new settings, |
|
1167 |
only the current session is affected by changes here.') withCRs |
|
1168 |
||
1169 |
"Created: / 17-08-2010 / 10:52:00 / cg" |
|
1170 |
! |
|
1171 |
||
1172 |
inputFieldDef |
|
1173 |
inputFieldDef isNil ifTrue:[ |
|
1174 |
inputFieldDef := ValueHolder new. |
|
1175 |
inputFieldDef addDependent:self. |
|
1176 |
]. |
|
1177 |
^ inputFieldDef |
|
1178 |
! |
|
1179 |
||
1180 |
inputFieldFontLabelHolder |
|
1181 |
||
1182 |
inputFieldFontLabelHolder isNil ifTrue:[ |
|
1183 |
inputFieldFontLabelHolder := '' asValue. |
|
1184 |
]. |
|
1185 |
^ inputFieldFontLabelHolder. |
|
1186 |
! |
|
1187 |
||
1188 |
labelDef |
|
1189 |
"return/create the 'labelDef' value holder (automatically generated)" |
|
1190 |
||
1191 |
labelDef isNil ifTrue:[ |
|
1192 |
labelDef := ValueHolder new. |
|
1193 |
labelDef addDependent:self. |
|
1194 |
]. |
|
1195 |
^ labelDef |
|
1196 |
! |
|
1197 |
||
1198 |
labelsFontLabelHolder |
|
1199 |
labelsFontLabelHolder isNil ifTrue:[ |
|
1200 |
labelsFontLabelHolder := '' asValue. |
|
1201 |
]. |
|
1202 |
^ labelsFontLabelHolder. |
|
1203 |
! |
|
1204 |
||
1205 |
listDef |
|
1206 |
"return/create the 'listDef' value holder (automatically generated)" |
|
1207 |
||
1208 |
listDef isNil ifTrue:[ |
|
1209 |
listDef := ValueHolder new. |
|
1210 |
listDef addDependent:self. |
|
1211 |
]. |
|
1212 |
^ listDef |
|
1213 |
! |
|
1214 |
||
1215 |
listsFontLabelHolder |
|
1216 |
||
1217 |
listsFontLabelHolder isNil ifTrue:[ |
|
1218 |
listsFontLabelHolder := '' asValue. |
|
1219 |
]. |
|
1220 |
^ listsFontLabelHolder. |
|
1221 |
! |
|
1222 |
||
15932 | 1223 |
lookLabelsAndValues |
1224 |
^ #( |
|
1225 |
('ST/X Look (monospace font for code)' #stx) |
|
1226 |
('Squeak Look (variable font for code)' #squeak) |
|
1227 |
('V''Age Look (variable bold font for code)' #vage) |
|
1228 |
('<keep as is>' nil) |
|
1229 |
) |
|
1230 |
! |
|
1231 |
||
1232 |
lookListLabels |
|
1233 |
^ self lookLabelsAndValues collect:[:each | each first]. |
|
1234 |
! |
|
1235 |
||
1236 |
lookListValues |
|
1237 |
^ self lookLabelsAndValues collect:[:each | each second]. |
|
1238 |
! |
|
1239 |
||
1240 |
lookSelectionHolder |
|
1241 |
lookSelectionHolder isNil ifTrue:[ |
|
1242 |
lookSelectionHolder := nil asValue. |
|
1243 |
lookSelectionHolder onChangeSend:#lookSelectionChanged to:self. |
|
1244 |
]. |
|
1245 |
^ lookSelectionHolder |
|
1246 |
! |
|
1247 |
||
14205 | 1248 |
menuDef |
1249 |
"return/create the 'menuDef' value holder (automatically generated)" |
|
1250 |
||
1251 |
menuDef isNil ifTrue:[ |
|
1252 |
menuDef := ValueHolder new. |
|
1253 |
menuDef addDependent:self. |
|
1254 |
]. |
|
1255 |
^ menuDef |
|
1256 |
! |
|
1257 |
||
1258 |
menusFontLabelHolder |
|
1259 |
||
1260 |
menusFontLabelHolder isNil ifTrue:[ |
|
1261 |
menusFontLabelHolder := '' asValue. |
|
1262 |
]. |
|
1263 |
^ menusFontLabelHolder. |
|
1264 |
! |
|
1265 |
||
1266 |
otherDef |
|
1267 |
otherDef isNil ifTrue:[ |
|
1268 |
otherDef := ValueHolder new. |
|
1269 |
otherDef addDependent:self. |
|
1270 |
]. |
|
1271 |
^ otherDef |
|
1272 |
! |
|
1273 |
||
1274 |
otherFontLabelHolder |
|
1275 |
||
1276 |
otherFontLabelHolder isNil ifTrue:[ |
|
1277 |
otherFontLabelHolder := '' asValue. |
|
1278 |
]. |
|
1279 |
^ otherFontLabelHolder. |
|
1280 |
! |
|
1281 |
||
1282 |
textDef |
|
1283 |
"return/create the 'textDef' value holder (automatically generated)" |
|
1284 |
||
1285 |
textDef isNil ifTrue:[ |
|
1286 |
textDef := ValueHolder new. |
|
1287 |
textDef addDependent:self. |
|
1288 |
]. |
|
1289 |
^ textDef |
|
1290 |
! |
|
1291 |
||
1292 |
textFontLabelHolder |
|
1293 |
||
1294 |
textFontLabelHolder isNil ifTrue:[ |
|
1295 |
textFontLabelHolder := '' asValue. |
|
1296 |
]. |
|
1297 |
^ textFontLabelHolder. |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1298 |
! |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1299 |
|
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1300 |
tooltipDef |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1301 |
tooltipDef isNil ifTrue:[ |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1302 |
tooltipDef := ValueHolder new. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1303 |
tooltipDef addDependent:self. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1304 |
]. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1305 |
^ tooltipDef |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1306 |
! |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1307 |
|
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1308 |
tooltipFontLabelHolder |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1309 |
tooltipFontLabelHolder isNil ifTrue:[ |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1310 |
tooltipFontLabelHolder := '' asValue. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1311 |
]. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1312 |
^ tooltipFontLabelHolder. |
15887 | 1313 |
! |
1314 |
||
16460 | 1315 |
useXFontsOnly |
1316 |
useXFontsOnly isNil ifTrue:[ |
|
1317 |
useXFontsOnly := false asValue. |
|
1318 |
useXFontsOnly onChangeSend:#useXftSettingsChanged to:self |
|
1319 |
]. |
|
1320 |
^ useXFontsOnly. |
|
1321 |
! |
|
1322 |
||
1323 |
useXFontsOnlyEnabled |
|
1324 |
^ builder valueAspectFor:#useXFontsOnlyEnabled initialValue:true |
|
1325 |
! |
|
1326 |
||
1327 |
useXFontsOnlyVisible |
|
1328 |
||
1329 |
^ Screen platformName == #X11 |
|
1330 |
! |
|
1331 |
||
15887 | 1332 |
useXftFontsOnly |
1333 |
useXftFontsOnly isNil ifTrue:[ |
|
1334 |
useXftFontsOnly := false asValue. |
|
16460 | 1335 |
useXftFontsOnly onChangeSend:#useXftSettingsChanged to:self |
15887 | 1336 |
]. |
1337 |
^ useXftFontsOnly. |
|
1338 |
! |
|
1339 |
||
16460 | 1340 |
useXftFontsOnlyEnabled |
1341 |
^ builder valueAspectFor:#useXftFontsOnlyEnabled initialValue:true |
|
1342 |
! |
|
1343 |
||
15887 | 1344 |
useXftFontsOnlyVisible |
1345 |
||
16289 | 1346 |
^ Screen platformName == #X11 |
16460 | 1347 |
! |
1348 |
||
1349 |
useXftSettingsChanged |
|
1350 |
|enableUseXft enableUseX| |
|
1351 |
||
1352 |
self updateModifiedChannel. |
|
1353 |
||
1354 |
enableUseXft := enableUseX := true. |
|
1355 |
||
1356 |
self useXftFontsOnly value ifTrue:[ |
|
1357 |
enableUseX := false |
|
1358 |
]. |
|
1359 |
self useXFontsOnly value ifTrue:[ |
|
1360 |
enableUseXft := false |
|
1361 |
]. |
|
1362 |
||
1363 |
self useXFontsOnlyEnabled value:enableUseX. |
|
1364 |
self useXftFontsOnlyEnabled value:enableUseXft |
|
14205 | 1365 |
! ! |
1366 |
||
1367 |
!FontSettingsApplication methodsFor:'change & update'! |
|
1368 |
||
1369 |
update:something with:aParameter from:changedObject |
|
1370 |
|whichLabel whichFontLabelHolder| |
|
1371 |
||
1372 |
builder notNil ifTrue:[ |
|
1373 |
changedObject == self allOfThem ifTrue:[ |
|
1374 |
whichLabel := allLabel. |
|
1375 |
whichFontLabelHolder := self allFontLabelHolder. |
|
1376 |
]. |
|
1377 |
changedObject == self otherDef ifTrue:[ |
|
1378 |
whichLabel := otherLabel. |
|
1379 |
whichFontLabelHolder := self otherFontLabelHolder. |
|
1380 |
]. |
|
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1381 |
changedObject == self tooltipDef ifTrue:[ |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1382 |
whichLabel := tooltipLabel. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1383 |
whichFontLabelHolder := self tooltipFontLabelHolder. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1384 |
]. |
14205 | 1385 |
changedObject == self labelDef ifTrue:[ |
1386 |
whichLabel := labelLabel. |
|
1387 |
whichFontLabelHolder := self labelsFontLabelHolder. |
|
1388 |
]. |
|
1389 |
changedObject == self buttonDef ifTrue:[ |
|
1390 |
whichLabel := buttonsLabel. |
|
1391 |
whichFontLabelHolder := self buttonsFontLabelHolder. |
|
1392 |
]. |
|
1393 |
changedObject == self listDef ifTrue:[ |
|
1394 |
whichLabel := listsLabel. |
|
1395 |
whichFontLabelHolder := self listsFontLabelHolder. |
|
1396 |
]. |
|
1397 |
changedObject == self menuDef ifTrue:[ |
|
1398 |
whichLabel := menuLabel. |
|
1399 |
whichFontLabelHolder := self menusFontLabelHolder. |
|
1400 |
]. |
|
1401 |
changedObject == self textDef ifTrue:[ |
|
1402 |
whichLabel := textLabel. |
|
1403 |
whichFontLabelHolder := self textFontLabelHolder. |
|
1404 |
]. |
|
1405 |
changedObject == self inputFieldDef ifTrue:[ |
|
1406 |
whichLabel := inputFieldLabel. |
|
1407 |
whichFontLabelHolder := self inputFieldFontLabelHolder. |
|
1408 |
]. |
|
1409 |
whichLabel notNil ifTrue:[ |
|
1410 |
self updateFontOfLabel:whichLabel andFontNameHolder:whichFontLabelHolder from:changedObject. |
|
1411 |
^ self. |
|
1412 |
] |
|
1413 |
]. |
|
1414 |
super update:something with:aParameter from:changedObject |
|
1415 |
! |
|
1416 |
||
1417 |
updateAllFontLabels |
|
1418 |
self update:#value with:nil from:self allOfThem. |
|
1419 |
self update:#value with:nil from:self otherDef. |
|
1420 |
self update:#value with:nil from:self labelDef. |
|
1421 |
self update:#value with:nil from:self buttonDef. |
|
1422 |
self update:#value with:nil from:self listDef. |
|
1423 |
self update:#value with:nil from:self menuDef. |
|
1424 |
self update:#value with:nil from:self textDef. |
|
1425 |
self update:#value with:nil from:self inputFieldDef. |
|
16080 | 1426 |
self update:#value with:nil from:self tooltipDef. |
14205 | 1427 |
! |
1428 |
||
1429 |
updateFontOfLabel:labelWidget andFontNameHolder:fontNameHolder from:changedObject |
|
1430 |
|f label| |
|
1431 |
||
1432 |
f := changedObject value. |
|
1433 |
labelWidget font:f. |
|
1434 |
label := f isNil ifTrue:[ |
|
1435 |
'' |
|
1436 |
] ifFalse:[ |
|
1437 |
f userFriendlyName |
|
1438 |
]. |
|
1439 |
fontNameHolder value:label. |
|
1440 |
self updateModifiedChannel |
|
1441 |
! ! |
|
1442 |
||
1443 |
!FontSettingsApplication methodsFor:'help'! |
|
1444 |
||
1445 |
helpFilename |
|
1446 |
^ 'Launcher/fontSettings.html' |
|
1447 |
! ! |
|
1448 |
||
1449 |
!FontSettingsApplication methodsFor:'initialization & release'! |
|
1450 |
||
1451 |
postBuildAllFontLabel:aWidget |
|
1452 |
||
1453 |
allLabel := aWidget. |
|
1454 |
! |
|
1455 |
||
1456 |
postBuildButtonsFontLabel:aWidget |
|
1457 |
||
1458 |
buttonsLabel := aWidget. |
|
1459 |
! |
|
1460 |
||
14569
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1461 |
postBuildHelpLabel:aWidget |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1462 |
aWidget level:0. |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1463 |
aWidget scrolledView backgroundColor:self window viewBackground. |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1464 |
aWidget font:(Label defaultFont). |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1465 |
! |
9de61339e34d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14494
diff
changeset
|
1466 |
|
14205 | 1467 |
postBuildInputFieldFontLabel:aWidget |
1468 |
||
1469 |
inputFieldLabel := aWidget. |
|
1470 |
! |
|
1471 |
||
1472 |
postBuildLabelsFontLabel:aWidget |
|
1473 |
||
1474 |
labelLabel := aWidget. |
|
1475 |
! |
|
1476 |
||
1477 |
postBuildListsFontLabel:aWidget |
|
1478 |
||
1479 |
listsLabel := aWidget. |
|
1480 |
! |
|
1481 |
||
1482 |
postBuildMenuesFontLabel:aWidget |
|
1483 |
||
1484 |
menuLabel := aWidget. |
|
1485 |
! |
|
1486 |
||
1487 |
postBuildOtherFontLabel:aWidget |
|
1488 |
||
1489 |
otherLabel := aWidget. |
|
1490 |
! |
|
1491 |
||
1492 |
postBuildTextFontLabel:aWidget |
|
1493 |
||
1494 |
textLabel := aWidget. |
|
1495 |
! |
|
1496 |
||
14658
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1497 |
postBuildTooltipFontLabel:aWidget |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1498 |
|
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1499 |
tooltipLabel := aWidget. |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1500 |
! |
755e0402b60d
class: Tools::FontSettingsApplication
Claus Gittinger <cg@exept.de>
parents:
14618
diff
changeset
|
1501 |
|
14205 | 1502 |
postBuildWith:aBuilder |
1503 |
"/ self readSettings. |
|
1504 |
self updateAllFontLabels. |
|
1505 |
super postBuildWith:aBuilder |
|
1506 |
! ! |
|
1507 |
||
1508 |
!FontSettingsApplication methodsFor:'queries'! |
|
1509 |
||
1510 |
hasUnsavedChanges |
|
16981 | 1511 |
(currentUserPrefs fontPreferences ? self defaultFontSpecDictionary) ~= self fontSpecDictionary ifTrue:[^ true]. |
16301
5b709afd8d92
Remove obsolete setting for #linuxFontWorkaround.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16293
diff
changeset
|
1512 |
(self hasChangedAspectIn: #(useXftFontsOnly) asComparedTo:currentUserPrefs) ifTrue:[^ true]. |
14205 | 1513 |
|
1514 |
^ false |
|
1515 |
||
16301
5b709afd8d92
Remove obsolete setting for #linuxFontWorkaround.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16293
diff
changeset
|
1516 |
"Modified: / 20-04-2016 / 20:14:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14205 | 1517 |
! |
1518 |
||
1519 |
hasXftFonts |
|
16094 | 1520 |
^ self graphicsDevice supportsXftFonts |
14205 | 1521 |
! ! |
1522 |
||
1523 |
!FontSettingsApplication class methodsFor:'documentation'! |
|
1524 |
||
1525 |
version |
|
15887 | 1526 |
^ '$Header$' |
14205 | 1527 |
! |
1528 |
||
1529 |
version_CVS |
|
15887 | 1530 |
^ '$Header$' |
16301
5b709afd8d92
Remove obsolete setting for #linuxFontWorkaround.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16293
diff
changeset
|
1531 |
! |
5b709afd8d92
Remove obsolete setting for #linuxFontWorkaround.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16293
diff
changeset
|
1532 |
|
5b709afd8d92
Remove obsolete setting for #linuxFontWorkaround.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16293
diff
changeset
|
1533 |
version_HG |
5b709afd8d92
Remove obsolete setting for #linuxFontWorkaround.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16293
diff
changeset
|
1534 |
|
5b709afd8d92
Remove obsolete setting for #linuxFontWorkaround.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16293
diff
changeset
|
1535 |
^ '$Changeset: <not expanded> $' |
14205 | 1536 |
! ! |
1537 |