mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
[Settings][Fix][Image Resizer ] Unused text box when selecting custom percent in new settings (#4344)
* save general settings to file upon launch * ImageResizer: Added flags to disable and hide extra boxes Co-authored-by: Lavius Motileng <laviusmotileng-ms>
This commit is contained in:
@@ -68,6 +68,36 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
}
|
||||
}
|
||||
|
||||
public int ExtraBoxOpacity
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Unit == 2)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool EnableEtraBoxes
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Unit == 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name
|
||||
{
|
||||
@@ -154,6 +184,8 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
{
|
||||
_unit = value;
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged("ExtraBoxOpacity");
|
||||
OnPropertyChanged("EnableEtraBoxes");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@
|
||||
TextAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Margin="{StaticResource SmallTopMargin}"
|
||||
Opacity="{x:Bind Path=ExtraBoxOpacity, Mode=OneWay}"
|
||||
Width="25"/>
|
||||
|
||||
<muxc:NumberBox Value="{x:Bind Path=Height, Mode=TwoWay}"
|
||||
@@ -135,6 +136,8 @@
|
||||
Height="34"
|
||||
VerticalAlignment="Center"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
Opacity="{x:Bind Path=ExtraBoxOpacity, Mode=OneWay}"
|
||||
IsEnabled="{x:Bind Path=EnableEtraBoxes, Mode=OneWay}"
|
||||
Margin="{StaticResource SmallTopMargin}"/>
|
||||
|
||||
<ComboBox SelectedIndex="{Binding Path=Unit, Mode=TwoWay}"
|
||||
|
||||
Reference in New Issue
Block a user