[Cuis-dev] Tweaks to GUI elements size windows

Mariano Montone marianomontone at gmail.com
Tue Feb 22 06:44:24 PST 2022


This version uses mouse scroll to set GUI sizes:

options _ #(tinyFonts verySmallFonts smallFonts standardFonts largeFonts 
hugeFonts).
currentSize _ #standardFonts.

UISupervisor whenUIinSafeState: [ |morph|
	morph _ (MVCMenuMorph from: (PopUpMenu labels: 'Done') title: 'Use 
mouse scroll to set GUI size').
	morph setProperty: #'handlesMouseScroll:' toValue: true.
	morph setProperty:  #mouseScroll:localPosition: toValue: [:ev :lpos |
	 currentSize _ options at: (ev direction == #up ifTrue:
		[((options indexOf: currentSize) + 1) min: options size]
		ifFalse: [((options indexOf: currentSize) - 1) max: 1]).
	Transcript show: currentSize.
	Preferences perform: currentSize].	
	morph
		invokeAt: self runningWorld activeHand morphPosition
		allowKeyboard: true]

I think I like it, as an alternative option for setting sizes at least.

Thoughts?

Cheers,

Mariano

El 22/2/22 a las 10:57, Mariano Montone escribió:
> El 22/2/22 a las 09:37, Juan Vuletich via Cuis-dev escribió:
>> Hi Folks,
>>
>> I just pushed a change to tweak a bit the behavior of the "Size of GUI 
>> elements" menu. I felt that the difference between sizes was too 
>> large, so I made "tiny" larger, "huge" smaller, and adjusted the rest. 
>> I hope you find it pleasant and not annoying. In any case, now you can 
>> call #defaultFontSize: with any number, especially if using TrueType.
> 
> It is fine for me.
> 
> I think it could be cool to provide some widget for selecting the size 
> instead of a menu.
> 
> Like a refined version of this:
> 
> options _ #(tinyFonts verySmallFonts smallFonts standardFonts largeFonts 
> hugeFonts).
> sb := ScrollBar new.
> sb morphExtent: 100@(sb buttonExtent).
> sb scrollDelta: 1/(options size) pageDelta: 1/(options size).
> sb model: [:val | |sizeSelector|
>      Transcript show: val.
>      Transcript show: (val * options size - 1) rounded.
> 
>      sizeSelector _ options at: (val * (options size - 1)) rounded + 1 .
>      Transcript show: sizeSelector.
>      Preferences perform: sizeSelector] setValueSelector: #value:.
> sb    openInWorld
> 
> I'll see if I can come up with something better, or better idea...
> 
> Cheers,
> 
> Mariano



More information about the Cuis-dev mailing list