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