Tools__FontSettingsApplication.st
branchjv
changeset 16570 dc5e958a20dc
parent 16321 e6a4ab0da993
parent 16482 5b57eef90d30
child 17136 cb908d2ba02e
--- a/Tools__FontSettingsApplication.st	Fri May 06 06:55:08 2016 +0200
+++ b/Tools__FontSettingsApplication.st	Mon May 09 21:47:57 2016 +0200
@@ -22,7 +22,7 @@
 		inputFieldDef inputFieldFontLabelHolder otherLabel
 		linuxFontWorkaround otherDef tooltipDef tooltipFontLabelHolder
 		tooltipLabel useXftFontsOnly fontSizeSelectionHolder
-		lookSelectionHolder'
+		lookSelectionHolder useXFontsOnly'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Interface-Smalltalk'
@@ -131,7 +131,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"
@@ -554,14 +558,25 @@
                    extent: (Point 637 45)
                  )
                 (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: useXFontsOnly
+                   visibilityChannel: useXFontsOnlyVisible
+                   enableChannel: useXFontsOnlyEnabled
+                   model: useXFontsOnly
+                   translateLabel: true
+                   extent: (Point 637 30)
+                 )
                 (DividerSpec
                    name: 'Separator12'
                    visibilityChannel: linuxFontWorkaroundVisible
@@ -668,6 +683,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:[
@@ -733,8 +749,9 @@
 !
 
 basicSaveSettings
-    self writeAspects: #(useXftFontsOnly) to: currentUserPrefs.
+    "/ |fn|
 
+    self writeAspects: #( useXftFontsOnly useXFontsOnly) to: currentUserPrefs.
     UserPreferences current fontPreferences:
         (
             Dictionary new
@@ -1259,17 +1276,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'!