--- a/Tools__FontSettingsApplication.st Thu Nov 24 22:03:16 2016 +0000
+++ b/Tools__FontSettingsApplication.st Thu Nov 24 22:14:31 2016 +0000
@@ -681,11 +681,10 @@
basicReadFontSettings
|prefs readFont sz lookIdx idx defaultTextFont|
-
- self useXftFontsOnly value:(UserPreferences current useXftFontsOnly).
- self useXFontsOnly value:(UserPreferences current useXFontsOnly).
+
+ self readAspects:#(useXftFontsOnly useXFontsOnly) from:currentUserPrefs.
- prefs := UserPreferences current fontPreferences.
+ prefs := currentUserPrefs fontPreferences.
prefs isNil ifTrue:[
prefs := Dictionary new.
].
@@ -728,8 +727,7 @@
(defaultTextFont face = #bold) ifTrue:[
lookIdx := self lookListValues indexOf:#vage.
] ifFalse:[
- "XFT fonts always return false for #isFixedWidth"
- (defaultTextFont isXftFont or:[(defaultTextFont onDevice:self device) isFixedWidth]) ifTrue:[
+ (defaultTextFont onDevice:self device) isFixedWidth ifTrue:[
lookIdx := self lookListValues indexOf:#stx.
] ifFalse:[
lookIdx := self lookListValues indexOf:#squeak.
@@ -752,19 +750,7 @@
"/ |fn|
self writeAspects: #( useXftFontsOnly useXFontsOnly) to: currentUserPrefs.
- UserPreferences current fontPreferences:
- (
- Dictionary new
- at:#Other put:(self otherDef value storeString);
- at:#Label put:(self labelDef value storeString);
- at:#Button put:(self buttonDef value storeString);
- at:#Text put:(self textDef value storeString);
- at:#InputField put:(self inputFieldDef value storeString);
- at:#List put:(self listDef value storeString);
- at:#Tooltip put:(self tooltipDef value storeString);
- at:#Menu put:(self menuDef value storeString);
- yourself
- ).
+ currentUserPrefs fontPreferences:self fontSpecDictionary.
"/ fn := self otherDef value.
"/ SimpleView withAllSubclasses do:[:cls | cls defaultFont:fn].
@@ -869,6 +855,19 @@
self changeFontFor:self tooltipDef labelTitle:'Tooltops'.
!
+defaultFontSpecDictionary
+ ^ Dictionary new
+ at:#Other put:View defaultFont storeString;
+ at:#Label put:View defaultFont storeString;
+ at:#Button put:Button defaultFont storeString;
+ at:#Text put:TextView defaultFont storeString;
+ at:#InputField put:EditField defaultFont storeString;
+ at:#List put:SelectionInListView defaultFont storeString;
+ at:#Tooltip put:ActiveHelpView defaultFont storeString;
+ at:#Menu put:MenuView defaultFont storeString;
+ yourself
+!
+
fontSizeSelectionChanged
|idx sz|
@@ -879,6 +878,19 @@
].
!
+fontSpecDictionary
+ ^ Dictionary new
+ at:#Other put:(self otherDef value storeString);
+ at:#Label put:(self labelDef value storeString);
+ at:#Button put:(self buttonDef value storeString);
+ at:#Text put:(self textDef value storeString);
+ at:#InputField put:(self inputFieldDef value storeString);
+ at:#List put:(self listDef value storeString);
+ at:#Tooltip put:(self tooltipDef value storeString);
+ at:#Menu put:(self menuDef value storeString);
+ yourself
+!
+
lookSelectionChanged
|idx look|
@@ -1472,15 +1484,7 @@
!FontSettingsApplication methodsFor:'queries'!
hasUnsavedChanges
- self otherDef value ~= View defaultFont ifTrue:[^ true].
- self labelDef value ~= Label defaultFont ifTrue:[^ true].
- self buttonDef value ~= Button defaultFont ifTrue:[^ true].
- self listDef value ~= SelectionInListView defaultFont ifTrue:[^ true].
- self menuDef value ~= MenuView defaultFont ifTrue:[^ true].
- self textDef value ~= TextView defaultFont ifTrue:[^ true].
- self inputFieldDef value ~= EditField defaultFont ifTrue:[^ true].
- self tooltipDef value ~= ActiveHelpView defaultFont ifTrue:[^ true].
-
+ (currentUserPrefs fontPreferences ? self defaultFontSpecDictionary) ~= self fontSpecDictionary ifTrue:[^ true].
(self hasChangedAspectIn: #(useXftFontsOnly) asComparedTo:currentUserPrefs) ifTrue:[^ true].
^ false