Tools__FontSettingsApplication.st
changeset 16460 c8ec3e7fb2e1
parent 16320 cd9e227fdeec
child 16482 5b57eef90d30
--- a/Tools__FontSettingsApplication.st	Fri May 06 05:00:39 2016 +0200
+++ b/Tools__FontSettingsApplication.st	Fri May 06 11:52:41 2016 +0200
@@ -11,7 +11,7 @@
 		inputFieldDef inputFieldFontLabelHolder otherLabel
 		linuxFontWorkaround otherDef tooltipDef tooltipFontLabelHolder
 		tooltipLabel useXftFontsOnly fontSizeSelectionHolder
-		lookSelectionHolder'
+		lookSelectionHolder useXFontsOnly'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Interface-Smalltalk'
@@ -105,7 +105,11 @@
 'Change settings for a VisualAge-like look with bold variable code fonts'
 
 #useXftFontsOnly
-'Don''t try to use and don''t offer non-Xft fonts in font selection dialogs (XWindow only)'
+'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.'
+
+#useXFontsOnly
+'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.)'
+
 )
 
     "Created: / 17-03-2012 / 11:37:51 / cg"
@@ -229,10 +233,10 @@
                          label: 'Change...'
                          name: 'Button1'
                          layout: (LayoutFrame 100 0.0 15 0 205 0 37 0)
+                         activeHelpKey: changeCodeFont
                          translateLabel: true
                          tabable: true
                          model: changeTextFont
-                         activeHelpKey: changeCodeFont
                        )
                       (LabelSpec
                          label: 'Text Font'
@@ -264,10 +268,10 @@
                          label: 'Change...'
                          name: 'ChangeText'
                          layout: (LayoutFrame 100 0.0 15 0 205 0 37 0)
+                         activeHelpKey: changeInputFieldFont
                          translateLabel: true
                          tabable: true
                          model: changeInputFieldFont
-                         activeHelpKey: changeInputFieldFont
                        )
                       (LabelSpec
                          label: 'InputFields Font'
@@ -299,10 +303,10 @@
                          label: 'Change...'
                          name: 'ChangeLists'
                          layout: (LayoutFrame 100 0.0 15 0 205 0 37 0)
+                         activeHelpKey: changeListFont
                          translateLabel: true
                          tabable: true
                          model: changeListsFont
-                         activeHelpKey: changeListFont
                        )
                       (LabelSpec
                          label: 'Lists Font'
@@ -334,9 +338,9 @@
                          label: 'Change...'
                          name: 'ChangeMenus'
                          layout: (LayoutFrame 100 0.0 15 0 205 0 37 0)
+                         activeHelpKey: changeMenuFont
                          translateLabel: true
                          tabable: true
-                         activeHelpKey: changeMenuFont
                          model: changeMenusFont
                        )
                       (LabelSpec
@@ -369,9 +373,9 @@
                          label: 'Change...'
                          name: 'ChangeLabels'
                          layout: (LayoutFrame 100 0.0 15 0 205 0 37 0)
+                         activeHelpKey: changeLabelFont
                          translateLabel: true
                          tabable: true
-                         activeHelpKey: changeLabelFont
                          model: changeLabelsFont
                        )
                       (LabelSpec
@@ -404,9 +408,9 @@
                          label: 'Change...'
                          name: 'Change Buttons'
                          layout: (LayoutFrame 100 0.0 15 0 205 0 37 0)
+                         activeHelpKey: changeButtonFont
                          translateLabel: true
                          tabable: true
-                         activeHelpKey: changeButtonFont
                          model: changeButtonsFont
                        )
                       (LabelSpec
@@ -439,9 +443,9 @@
                          label: 'Change...'
                          name: 'Button11'
                          layout: (LayoutFrame 100 0.0 15 0 205 0 37 0)
+                         activeHelpKey: changeTooltipFont
                          translateLabel: true
                          tabable: true
-                         activeHelpKey: changeTooltipFont
                          model: changeTooltipFont
                        )
                       (LabelSpec
@@ -482,11 +486,11 @@
                          label: 'Label'
                          name: 'Label6'
                          layout: (LayoutFrame 210 0 15 0 -2 1 37 0)
+                         activeHelpKey: changeOtherFont
                          translateLabel: true
                          labelChannel: otherFontLabelHolder
                          adjust: left
                          postBuildCallback: postBuildOtherFontLabel:
-                         activeHelpKey: changeOtherFont
                        )
                       (DividerSpec
                          name: 'Separator13'
@@ -513,9 +517,9 @@
                          label: 'Change...'
                          name: 'ChangeAll'
                          layout: (LayoutFrame 100 0.0 11 0 205 0 33 0)
+                         activeHelpKey: changeAllFont
                          translateLabel: true
                          tabable: true
-                         activeHelpKey: changeAllFont
                          model: changeAllFont
                        )
                       (DividerSpec
@@ -536,14 +540,25 @@
                    extent: (Point 637 30)
                  )
                 (CheckBoxSpec
-                   label: 'Only Use Xft Fonts (Unix Only)'
+                   label: 'Only Use Xft Fonts / Suppress Ugly X-Fonts (Unix Only)'
                    name: 'CheckBox1'
                    activeHelpKey: useXftFontsOnly
                    visibilityChannel: useXftFontsOnlyVisible
+                   enableChannel: useXftFontsOnlyEnabled
                    model: useXftFontsOnly
                    translateLabel: true
                    extent: (Point 637 30)
                  )
+                (CheckBoxSpec
+                   label: 'Only Use X Fonts / Suppress Slow Xft-Fonts (Unix Only)'
+                   name: 'CheckBox2'
+                   activeHelpKey: useXFontsOnlyVisible
+                   visibilityChannel: useXFontsOnlyVisible
+                   enableChannel: useXFontsOnlyEnabled
+                   model: useXFontsOnly
+                   translateLabel: true
+                   extent: (Point 637 30)
+                 )
                 (DividerSpec
                    name: 'Separator12'
                    visibilityChannel: linuxFontWorkaroundVisible
@@ -650,6 +665,7 @@
     |prefs readFont sz lookIdx idx defaultTextFont|
   
     self useXftFontsOnly value:(UserPreferences current useXftFontsOnly).
+    self useXFontsOnly value:(UserPreferences current useXFontsOnly).
     
     prefs := UserPreferences current fontPreferences.
     prefs isNil ifTrue:[
@@ -717,9 +733,9 @@
 !
 
 basicSaveSettings
-    |fn|
+    "/ |fn|
 
-    self writeAspects: #(linuxFontWorkaround useXftFontsOnly) to: currentUserPrefs.
+    self writeAspects: #(linuxFontWorkaround useXftFontsOnly useXFontsOnly) to: currentUserPrefs.
 
     UserPreferences current fontPreferences:
         (
@@ -1261,17 +1277,56 @@
     ^ tooltipFontLabelHolder.
 !
 
+useXFontsOnly
+    useXFontsOnly isNil ifTrue:[
+        useXFontsOnly := false asValue.
+        useXFontsOnly onChangeSend:#useXftSettingsChanged to:self
+    ].
+    ^ useXFontsOnly.
+!
+
+useXFontsOnlyEnabled
+    ^ builder valueAspectFor:#useXFontsOnlyEnabled initialValue:true
+!
+
+useXFontsOnlyVisible
+
+    ^ Screen platformName == #X11
+!
+
 useXftFontsOnly
     useXftFontsOnly isNil ifTrue:[
         useXftFontsOnly := false asValue.
-        useXftFontsOnly onChangeSend:#updateModifiedChannel to:self
+        useXftFontsOnly onChangeSend:#useXftSettingsChanged to:self
     ].
     ^ useXftFontsOnly.
 !
 
+useXftFontsOnlyEnabled
+    ^ builder valueAspectFor:#useXftFontsOnlyEnabled initialValue:true
+!
+
 useXftFontsOnlyVisible
 
     ^ Screen platformName == #X11
+!
+
+useXftSettingsChanged
+    |enableUseXft enableUseX|
+    
+    self updateModifiedChannel.
+
+    enableUseXft := enableUseX := true.
+    
+    self useXftFontsOnly value ifTrue:[
+        enableUseX := false
+    ].    
+    self useXFontsOnly value ifTrue:[
+        enableUseXft := false
+    ].
+    
+    self useXFontsOnlyEnabled value:enableUseX.
+    self useXftFontsOnlyEnabled value:enableUseXft
 ! !
 
 !FontSettingsApplication methodsFor:'change & update'!