[Cuis-dev] Tweaks to GUI elements size windows

Juan Vuletich JuanVuletich at zoho.com
Tue Feb 22 12:32:37 PST 2022


Nice idea. Still, I'd prefer to use this gesture for scaling the Word 
(or any other morph) with Vector Graphics.

Cheers,

On 2/22/2022 11:44 AM, Mariano Montone via Cuis-dev wrote:
> 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
>


-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
https://independent.academia.edu/JuanVuletich
https://www.researchgate.net/profile/Juan-Vuletich
https://patents.justia.com/inventor/juan-manuel-vuletich
@JuanVuletich



More information about the Cuis-dev mailing list