class: Tools::FontSettingsApplication
authorClaus Gittinger <cg@exept.de>
Fri, 11 Jul 2014 15:40:00 +0200
changeset 14658 755e0402b60d
parent 14657 c13b1d3e1de9
child 14659 05926fa61d08
class: Tools::FontSettingsApplication class definition added: #changeTooltipFont #postBuildTooltipFontLabel: #tooltipDef #tooltipFontLabelHolder removed: #widgetList comment/format in:7 methods changed:6 methods
Tools__FontSettingsApplication.st
--- a/Tools__FontSettingsApplication.st	Fri Jul 11 14:16:28 2014 +0200
+++ b/Tools__FontSettingsApplication.st	Fri Jul 11 15:40:00 2014 +0200
@@ -9,7 +9,8 @@
 		menusFontLabelHolder otherFontLabelHolder allLabel buttonsLabel
 		textLabel labelLabel listsLabel menuLabel inputFieldLabel
 		inputFieldDef inputFieldFontLabelHolder otherLabel
-		linuxFontWorkaround otherDef'
+		linuxFontWorkaround otherDef tooltipDef tooltipFontLabelHolder
+		tooltipLabel'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Interface-Smalltalk'
@@ -28,21 +29,6 @@
     self open.
 ! !
 
-!FontSettingsApplication class methodsFor:'defaults'!
-
-widgetList
-
-    ^  #(
-        'All' 
-        'Labels' 
-        'Buttons' 
-        'Lists' 
-        'Menus' 
-        'Edited Text'
-        'Others'
-       )
-! !
-
 !FontSettingsApplication class methodsFor:'help specs'!
 
 flyByHelpSpec
@@ -157,7 +143,7 @@
          name: 'Font Settings'
          flags: 1
          min: (Point 10 10)
-         bounds: (Rectangle 0 0 641 753)
+         bounds: (Rectangle 0 0 643 810)
        )
        component: 
       (SpecCollection
@@ -182,7 +168,7 @@
                    miniScrollerVertical: true
                    isReadOnly: true
                    hasKeyboardFocusInitially: false
-                   extent: (Point 635 132)
+                   extent: (Point 637 132)
                    viewClassName: 'ListView'
                    postBuildCallback: postBuildHelpLabel:
                  )
@@ -201,7 +187,7 @@
                       (LabelSpec
                          label: 'Text Font'
                          name: 'Label2'
-                         layout: (LayoutFrame 110 0 22 0 -5 1 44 0)
+                         layout: (LayoutFrame 110 0 22 0 -2 1 44 0)
                          translateLabel: true
                          labelChannel: textFontLabelHolder
                          adjust: left
@@ -215,14 +201,10 @@
                          tabable: true
                          model: changeTextFont
                        )
-                      (DividerSpec
-                         name: 'Separator11'
-                         layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1)
-                       )
                       )
                     
                    )
-                   extent: (Point 635 50)
+                   extent: (Point 637 50)
                  )
                 (ViewSpec
                    name: 'InputFieldsBox'
@@ -239,7 +221,7 @@
                       (LabelSpec
                          label: 'InputFields Font'
                          name: 'InputFieldsFont'
-                         layout: (LayoutFrame 110 0 22 0 -5 1 44 0)
+                         layout: (LayoutFrame 110 0 22 0 -2 1 44 0)
                          translateLabel: true
                          labelChannel: inputFieldFontLabelHolder
                          adjust: left
@@ -253,14 +235,10 @@
                          tabable: true
                          model: changeInputFieldFont
                        )
-                      (DividerSpec
-                         name: 'Separator10'
-                         layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1)
-                       )
                       )
                     
                    )
-                   extent: (Point 635 50)
+                   extent: (Point 637 50)
                  )
                 (ViewSpec
                    name: 'ListsBox'
@@ -277,7 +255,7 @@
                       (LabelSpec
                          label: 'Lists Font'
                          name: 'ListsFont'
-                         layout: (LayoutFrame 110 0 22 0 -5 1 44 0)
+                         layout: (LayoutFrame 110 0 22 0 -2 1 44 0)
                          translateLabel: true
                          labelChannel: listsFontLabelHolder
                          adjust: left
@@ -291,14 +269,10 @@
                          tabable: true
                          model: changeListsFont
                        )
-                      (DividerSpec
-                         name: 'Separator8'
-                         layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1)
-                       )
                       )
                     
                    )
-                   extent: (Point 635 50)
+                   extent: (Point 637 50)
                  )
                 (ViewSpec
                    name: 'MenusBox'
@@ -315,7 +289,7 @@
                       (LabelSpec
                          label: 'Menus Font'
                          name: 'MenusFont'
-                         layout: (LayoutFrame 110 0 22 0 -5 1 44 0)
+                         layout: (LayoutFrame 110 0 22 0 -2 1 44 0)
                          translateLabel: true
                          labelChannel: menusFontLabelHolder
                          adjust: left
@@ -329,14 +303,10 @@
                          tabable: true
                          model: changeMenusFont
                        )
-                      (DividerSpec
-                         name: 'Separator9'
-                         layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1)
-                       )
                       )
                     
                    )
-                   extent: (Point 635 50)
+                   extent: (Point 637 50)
                  )
                 (ViewSpec
                    name: 'LabelsBox'
@@ -353,7 +323,7 @@
                       (LabelSpec
                          label: 'Labels'
                          name: 'LabelsFont'
-                         layout: (LayoutFrame 110 0 22 0 -5 1 44 0)
+                         layout: (LayoutFrame 110 0 22 0 -2 1 44 0)
                          translateLabel: true
                          labelChannel: labelsFontLabelHolder
                          adjust: left
@@ -367,14 +337,10 @@
                          tabable: true
                          model: changeLabelsFont
                        )
-                      (DividerSpec
-                         name: 'Separator6'
-                         layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1)
-                       )
                       )
                     
                    )
-                   extent: (Point 635 50)
+                   extent: (Point 637 50)
                  )
                 (ViewSpec
                    name: 'ButtonsBox'
@@ -391,7 +357,7 @@
                       (LabelSpec
                          label: 'Buttons Font'
                          name: 'ButtonsFont'
-                         layout: (LayoutFrame 110 0 22 0 -5 1 44 0)
+                         layout: (LayoutFrame 110 0 22 0 -2 1 44 0)
                          translateLabel: true
                          labelChannel: buttonsFontLabelHolder
                          adjust: left
@@ -405,14 +371,44 @@
                          tabable: true
                          model: changeButtonsFont
                        )
-                      (DividerSpec
-                         name: 'Separator7'
-                         layout: (LayoutFrame 0 0.0 -3 1 0 1.0 0 1)
+                      )
+                    
+                   )
+                   extent: (Point 637 50)
+                 )
+                (ViewSpec
+                   name: 'ToolTipsBox'
+                   component: 
+                  (SpecCollection
+                     collection: (
+                      (LabelSpec
+                         label: 'Tooltips'
+                         name: 'Label7'
+                         layout: (LayoutFrame 0 0.0 0 0 0 1.0 20 0)
+                         translateLabel: true
+                         adjust: left
+                       )
+                      (LabelSpec
+                         label: 'Label'
+                         name: 'Label8'
+                         layout: (LayoutFrame 110 0 22 0 -2 1 44 0)
+                         translateLabel: true
+                         labelChannel: tooltipFontLabelHolder
+                         adjust: left
+                         postBuildCallback: postBuildTooltipFontLabel:
+                       )
+                      (ActionButtonSpec
+                         label: 'Change...'
+                         name: 'Button11'
+                         layout: (LayoutFrame 0 0.0 22 0 105 0 44 0)
+                         translateLabel: true
+                         tabable: true
+                         model: changeTooltipFont
                        )
                       )
                     
                    )
-                   extent: (Point 635 50)
+                   extent: (Point 637 50)
                  )
                 (ViewSpec
                    name: 'OtherBox'
@@ -429,7 +425,7 @@
                       (LabelSpec
                          label: 'Label'
                          name: 'Label6'
-                         layout: (LayoutFrame 110 0 22 0 -5 1 44 0)
+                         layout: (LayoutFrame 110 0 22 0 -2 1 44 0)
                          translateLabel: true
                          labelChannel: otherFontLabelHolder
                          adjust: left
@@ -450,7 +446,7 @@
                       )
                     
                    )
-                   extent: (Point 635 50)
+                   extent: (Point 637 50)
                  )
                 (ViewSpec
                    name: 'AllBox'
@@ -479,7 +475,7 @@
                       )
                     
                    )
-                   extent: (Point 635 50)
+                   extent: (Point 637 50)
                  )
                 (CheckBoxSpec
                    label: 'Linux font workaround: do not reset fonts on snapshot restart'
@@ -487,12 +483,12 @@
                    visibilityChannel: linuxFontWorkaroundVisible
                    model: linuxFontWorkaround
                    translateLabel: true
-                   extent: (Point 635 30)
+                   extent: (Point 637 30)
                  )
                 (DividerSpec
                    name: 'Separator12'
                    visibilityChannel: linuxFontWorkaroundVisible
-                   extent: (Point 635 3)
+                   extent: (Point 637 3)
                  )
                 (ViewSpec
                    name: 'SpecialsBox'
@@ -582,7 +578,7 @@
                       )
                     
                    )
-                   extent: (Point 635 124)
+                   extent: (Point 637 124)
                  )
                 )
               
@@ -616,6 +612,7 @@
     self menuDef value:MenuView defaultFont.
     self textDef value:TextView defaultFont.
     self inputFieldDef value:EditField defaultFont.
+    self tooltipDef value:ActiveHelpView defaultFont.
 
     "Modified: / 10-10-2011 / 12:15:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Created: / 06-02-2012 / 12:22:39 / cg"
@@ -653,6 +650,9 @@
     fn := self listDef value.
     SelectionInListView withAllSubclasses do:[:cls | cls defaultFont:fn].
 
+    fn := self tooltipDef value.
+    ActiveHelpView withAllSubclasses do:[:cls | cls defaultFont:fn].
+
     fn := self menuDef value.
     ListView defaultFont:fn.
     MenuView defaultFont:fn.
@@ -690,16 +690,6 @@
 
 changeButtonsFont
     self changeFontFor:self buttonDef labelTitle:'Buttons'.
-"/
-"/    |f|
-"/
-"/    f := FontPanel 
-"/        fontFromUserInitial:(self buttonDef value) 
-"/                      title:(resources string:'Font for %1' with:'All')
-"/                     filter:filter.
-"/    f notNil ifTrue:[
-"/        self buttonDef value:(f onDevice:buttonsLabel device).
-"/    ]
 !
 
 changeFontFor:aHolder labelTitle:labelTitle
@@ -718,80 +708,30 @@
 
 changeInputFieldFont
     self changeFontFor:self inputFieldDef labelTitle:'Input Fields'.
-"/    |f|
-"/
-"/    f := FontPanel 
-"/        fontFromUserInitial:(self inputFieldDef value) 
-"/                      title:(resources string:'Font for %1' with:'Input Fields')
-"/                     filter:filter.
-"/    f notNil ifTrue:[
-"/        self inputFieldDef value:(f onDevice:inputFieldLabel device).
-"/    ]
 !
 
 changeLabelsFont
     self changeFontFor:self labelDef labelTitle:'Labels'.
-"/    |f |
-"/
-"/    f := FontPanel 
-"/        fontFromUserInitial:(self labelDef value) 
-"/                      title:(resources string:'Font for %1' with:'Labels')
-"/                     filter:filter.
-"/    f notNil ifTrue:[
-"/        self labelDef value:(f onDevice:labelLabel device).
-"/    ].
 !
 
 changeListsFont
     self changeFontFor:self listDef labelTitle:'Lists'.
-"/    |f|
-"/
-"/    f := FontPanel 
-"/        fontFromUserInitial:(self listDef value) 
-"/                      title:(resources string:'Font for %1' with:'Lists')
-"/                     filter:filter.
-"/    f notNil ifTrue:[
-"/        self listDef value:(f onDevice:listsLabel device).
-"/    ]
 !
 
 changeMenusFont
     self changeFontFor:self menuDef labelTitle:'Menus'.
-"/    |f|
-"/
-"/    f := FontPanel 
-"/        fontFromUserInitial:(self menuDef value) 
-"/                      title:(resources string:'Font for %1' with:'Menus')
-"/                     filter:filter.
-"/    f notNil ifTrue:[
-"/        self menuDef value:(f onDevice:menuLabel device).
-"/    ]
 !
 
 changeOtherFont
     self changeFontFor:self otherDef labelTitle:'All Others'.
-"/    |f|
-"/
-"/    f := FontPanel 
-"/        fontFromUserInitial:(self otherDef value) 
-"/                      title:(resources string:'Font for %1' with:'All Others')
-"/                     filter:filter.
-"/    f notNil ifTrue:[
-"/        self otherDef value:(f onDevice:otherLabel device).
-"/    ]
 !
 
 changeTextFont
     self changeFontFor:self textDef labelTitle:'Edited Text'.
-"/    |f|
-"/
-"/    f := FontPanel 
-"/        fontFromUserInitial:(self textDef value) 
-"/                      title:(resources string:'Font for %1' with:'Edited Text')
-"/                     filter:filter.
-"/    f notNil ifTrue:[
-"/        self textDef value:(f onDevice:textLabel device).
-"/    ]
+!
+
+changeTooltipFont
+    self changeFontFor:self tooltipDef labelTitle:'Tooltops'.
 ! !
 
 !FontSettingsApplication methodsFor:'actions-common looks'!
@@ -940,7 +880,7 @@
 infoText
     ^ (self resources 
         string:'FONT_SETTINGS_INFO'
-        default:'Please notice that any changes usually only affect new windows.
+        default:'Please notice that changes only affect new windows.
 Existing  windows usually remember their initial font as created.
 If required, reopen some of the views, including the Launcher itself.
 
@@ -1072,6 +1012,21 @@
         textFontLabelHolder := '' asValue.
     ].
     ^ textFontLabelHolder.
+!
+
+tooltipDef
+    tooltipDef isNil ifTrue:[
+        tooltipDef := ValueHolder new.
+        tooltipDef addDependent:self.
+    ].
+    ^ tooltipDef
+!
+
+tooltipFontLabelHolder
+    tooltipFontLabelHolder isNil ifTrue:[
+        tooltipFontLabelHolder := '' asValue.
+    ].
+    ^ tooltipFontLabelHolder.
 ! !
 
 !FontSettingsApplication methodsFor:'change & update'!
@@ -1088,6 +1043,10 @@
             whichLabel := otherLabel.
             whichFontLabelHolder := self otherFontLabelHolder.
         ].
+        changedObject == self tooltipDef ifTrue:[
+            whichLabel := tooltipLabel.
+            whichFontLabelHolder := self tooltipFontLabelHolder.
+        ].
         changedObject == self labelDef ifTrue:[
             whichLabel := labelLabel.
             whichFontLabelHolder := self labelsFontLabelHolder.
@@ -1199,6 +1158,11 @@
     textLabel := aWidget.
 !
 
+postBuildTooltipFontLabel:aWidget
+
+    tooltipLabel := aWidget.
+!
+
 postBuildWith:aBuilder 
 "/    self readSettings.
     self updateAllFontLabels.
@@ -1215,6 +1179,7 @@
     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].
 
     (self hasChangedAspectIn: #(linuxFontWorkaround) asComparedTo:currentUserPrefs) ifTrue:[^ true].
 
@@ -1230,10 +1195,10 @@
 !FontSettingsApplication class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__FontSettingsApplication.st,v 1.8 2014-07-08 23:20:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__FontSettingsApplication.st,v 1.9 2014-07-11 13:40:00 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__FontSettingsApplication.st,v 1.8 2014-07-08 23:20:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__FontSettingsApplication.st,v 1.9 2014-07-11 13:40:00 cg Exp $'
 ! !