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