mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-07 09:28:03 +08: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:
parent
3bdd9a850f
commit
165365473f
@ -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")]
|
[JsonPropertyName("name")]
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
@ -154,6 +184,8 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
|||||||
{
|
{
|
||||||
_unit = value;
|
_unit = value;
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
|
OnPropertyChanged("ExtraBoxOpacity");
|
||||||
|
OnPropertyChanged("EnableEtraBoxes");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,6 +128,7 @@
|
|||||||
TextAlignment="Center"
|
TextAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Margin="{StaticResource SmallTopMargin}"
|
Margin="{StaticResource SmallTopMargin}"
|
||||||
|
Opacity="{x:Bind Path=ExtraBoxOpacity, Mode=OneWay}"
|
||||||
Width="25"/>
|
Width="25"/>
|
||||||
|
|
||||||
<muxc:NumberBox Value="{x:Bind Path=Height, Mode=TwoWay}"
|
<muxc:NumberBox Value="{x:Bind Path=Height, Mode=TwoWay}"
|
||||||
@ -135,6 +136,8 @@
|
|||||||
Height="34"
|
Height="34"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
SpinButtonPlacementMode="Compact"
|
SpinButtonPlacementMode="Compact"
|
||||||
|
Opacity="{x:Bind Path=ExtraBoxOpacity, Mode=OneWay}"
|
||||||
|
IsEnabled="{x:Bind Path=EnableEtraBoxes, Mode=OneWay}"
|
||||||
Margin="{StaticResource SmallTopMargin}"/>
|
Margin="{StaticResource SmallTopMargin}"/>
|
||||||
|
|
||||||
<ComboBox SelectedIndex="{Binding Path=Unit, Mode=TwoWay}"
|
<ComboBox SelectedIndex="{Binding Path=Unit, Mode=TwoWay}"
|
||||||
|
@ -48,7 +48,6 @@ namespace
|
|||||||
{
|
{
|
||||||
const wchar_t MSI_VERSION_MUTEX_NAME[] = L"Local\\PowerToyRunMutex";
|
const wchar_t MSI_VERSION_MUTEX_NAME[] = L"Local\\PowerToyRunMutex";
|
||||||
const wchar_t MSIX_VERSION_MUTEX_NAME[] = L"Local\\PowerToyMSIXRunMutex";
|
const wchar_t MSIX_VERSION_MUTEX_NAME[] = L"Local\\PowerToyMSIXRunMutex";
|
||||||
|
|
||||||
const wchar_t PT_URI_PROTOCOL_SCHEME[] = L"powertoys://";
|
const wchar_t PT_URI_PROTOCOL_SCHEME[] = L"powertoys://";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,6 +291,10 @@ void run_settings_window()
|
|||||||
settings_isUserAnAdmin = L"false";
|
settings_isUserAnAdmin = L"false";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create general settings file to initialze the settings file with installation configurations like :
|
||||||
|
// 1. Run on start up.
|
||||||
|
PTSettingsHelper::save_general_settings(save_settings.to_json());
|
||||||
|
|
||||||
std::wstring executable_args = L"\"";
|
std::wstring executable_args = L"\"";
|
||||||
executable_args.append(executable_path);
|
executable_args.append(executable_path);
|
||||||
executable_args.append(L"\" ");
|
executable_args.append(L"\" ");
|
||||||
|
Loading…
Reference in New Issue
Block a user