[pve-devel] [PATCH widget-toolkit 1/2] Utils: add calculate max button width hack

Matthias Heiserer m.heiserer at proxmox.com
Mon Mar 28 12:17:34 CEST 2022


On 28.03.2022 11:44, Thomas Lamprecht wrote:
> On 28.03.22 11:43, Matthias Heiserer wrote:
>> On 25.03.2022 09:47, Thomas Lamprecht wrote:
>>> On 24.03.22 12:33, Matthias Heiserer wrote:
>>>> The same code is used once in widget toolkit and twice in PVE already,
>>>> so it makes sense to add it as a separate function.
>>>>
>>>
>>> FWIW, there'd be also the possibility of adding a new button class, derived
>>> from proxmoxButton, that would be a bit more boilerplate but also avoid having a
>>> rather specific helper in the general utils class and avoid coupling from property
>>> existance/behavior over such "code distance". Maybe we could also move some more
>>> common "AltButton" behavior in there though (did not checked too closely).
>>> What do you think?
>>>
>> Not a big fan tbh, as would mean it can't be used with an Ext.button.
> 
> Not seeing the problem? You just use the derived xtype which *is* a Ext.button,
> we alreay use an also derived variant in the respective places anyway (proxmoxButton)
> so not sure which problems you envision...
I meant in case we need the functionality with an ext button, but as you 
say, can just use a proxmoxButton instead then.
Will send a v2 with a separate class. You want it named AltButton?





More information about the pve-devel mailing list