'From Cuis 6.0 [latest update: #5090] on 2 March 2022 at 5:10:58 pm'!

!Preferences class methodsFor: 'bigger and smaller GUI' stamp: 'MM 3/2/2022 17:02:36'!
hugeFonts
	"Sets not only fonts but other GUI elements
	to fit regular resolution and size screens
	Preferences hugeFonts
	"

	self defaultFontSize: 32.
	self setPreference: #guiElementsSize toValue:  #hugeFonts.! !

!Preferences class methodsFor: 'bigger and smaller GUI' stamp: 'MM 3/2/2022 17:03:20'!
largeFonts
	"Sets not only fonts but other GUI elements
	to fit regular resolution and size screens
	Preferences largeFonts
	"

	self defaultFontSize: 18.
	self setPreference: #guiElementsSize toValue:  #largeFonts.! !

!Preferences class methodsFor: 'bigger and smaller GUI' stamp: 'MM 3/2/2022 17:03:32'!
smallFonts
	"Sets not only fonts but other GUI elements
	to fit very low resolution or very small screens
	Preferences smallFonts
	"
	
	self defaultFontSize: 11.
	self setPreference: #guiElementsSize toValue:  #smallFonts.! !

!Preferences class methodsFor: 'bigger and smaller GUI' stamp: 'MM 3/2/2022 17:03:40'!
standardFonts
	"Sets not only fonts but other GUI elements
	to fit regular resolution and size screens
	Preferences standardFonts
	"

	self defaultFontSize: 14.
	self setPreference: #guiElementsSize toValue:  #standardFonts.! !

!Preferences class methodsFor: 'bigger and smaller GUI' stamp: 'MM 3/2/2022 17:03:45'!
tinyFonts
	"Sets not only fonts but other GUI elements
	to fit very low resolution or very small screens
	Preferences tinyFonts
	"

	self defaultFontSize: 7.
	self setPreference: #guiElementsSize toValue:  #tinyFonts.! !

!Preferences class methodsFor: 'bigger and smaller GUI' stamp: 'MM 3/2/2022 17:03:51'!
veryLargeFonts
	"Sets not only fonts but other GUI elements
	to fit regular resolution and size screens
	Preferences veryLargeFonts
	"

	self defaultFontSize: 24.
	self setPreference: #guiElementsSize toValue:  #veryLargeFonts.! !

!Preferences class methodsFor: 'bigger and smaller GUI' stamp: 'MM 3/2/2022 17:03:57'!
verySmallFonts
	"Sets not only fonts but other GUI elements
	to fit very low resolution or very small screens
	Preferences verySmallFonts
	"
	
	self defaultFontSize: 9.
	self setPreference: #guiElementsSize toValue:  #verySmallFonts.! !


!Theme class methodsFor: 'user interface' stamp: 'MM 3/2/2022 17:09:37'!
changeFontSizes

	| currentSize decSize incSize m options wm idx item |
	options _ #(tinyFonts verySmallFonts smallFonts standardFonts largeFonts veryLargeFonts hugeFonts).
	currentSize _ Preferences valueOfFlag: #guiElementsSize ifAbsent: [ #standardFonts ].

	wm _ (MenuMorph new defaultTarget: Preferences)
	        addTitle: 'Make GUI elements';
	        addStayUpIcons;
	        add: 'Huge' action: #hugeFonts;
	        add: 'Very Large' action: #veryLargeFonts;
	        add: 'Large' action: #largeFonts;
	        add: 'Regular Size' action: #standardFonts;
	        add: 'Small' action: #smallFonts;
	        add: 'Very Small'action: #verySmallFonts;
	        add: 'Tiny'action: #tinyFonts;
	        yourself.
	    idx _ options indexOf: currentSize.
	    item _ wm items at: options size - idx + 1.
	    wm selectItem: item.

	incSize _ [
	    idx _ (((options indexOf: currentSize) + 1) min: options size).
	    currentSize _ options at: idx.
	    item _ wm items at: options size - idx + 1.
	    wm selectItem: item.
	    Preferences perform: currentSize].
	           
	decSize _ [
	    idx _ (((options indexOf: currentSize) - 1) max: 1).
	    currentSize _ options at: idx.
	    item _ wm items at: options size - idx + 1.
	    wm selectItem: item.
	    Preferences perform: currentSize].

	m _ LayoutMorph newRow
	        color: wm color;
	        borderWidth: 0;
	        axisEdgeWeight: #center;
	        separation: (20@0);
	        morphHeight: 20;
	        yourself.
	       
	m addMorph:
	     ((PluggableButtonMorph model: decSize action: #value)
	         icon: Theme current collapseIcon;
	         instVarNamed: #magnifiedIcon put: Theme current collapseIcon;
	         yourself)
	     layoutSpec: LayoutSpec keepMorphExtent.

	m addMorph:
	     ((PluggableButtonMorph model: incSize action: #value)
	         icon: Theme current expandIcon;
	         instVarNamed: #magnifiedIcon put: Theme current expandIcon;
	         yourself)
	     layoutSpec: LayoutSpec keepMorphExtent.

	wm addMorphBack: m.

	wm popUpInWorld. ! !

