Files
AI-Studio/app/MindWork AI Studio/Components/ConfigurationInterfaceSize.razor
T

13 lines
1.0 KiB
Plaintext

@using AIStudio.Settings
@using AIStudio.Settings.DataModel
@inherits MSGComponentBase
@*
Another screen may offer other sizes, and a select that gets its new value before the item of
that value exists keeps showing the old one. The key builds the select anew for every screen:
*@
<ConfigurationSelect @key="@this.ScreenKey" OptionDescription="@T("Interface size on this screen")" SelectedValue="@(() => this.SizeOnScreen)" Data="@ConfigurationSelectDataFactory.GetInterfaceSizeData(this.OffersAppDefault)" SelectionUpdateAsync="@this.UpdateSize" Disabled="@(() => this.MeasuredScreen is null)" OptionHelp="@this.SizeHelp"/>
@if (this.MeasuredScreen is { } screen && this.SizeOnScreen is InterfaceSize.CUSTOM)
{
<ConfigurationSlider T="int" OptionDescription="@T("Custom interface size on this screen")" Min="@screen.MinPercent" Max="@screen.MaxPercent" Step="5" Unit="%" Value="@(() => this.ScalePercent(screen))" ValueUpdate="@this.UpdateScalePercent" Immediate="@false" OptionHelp="@this.ScaleHelp(screen)"/>
}