[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:
Lavius Motileng 2020-06-19 13:18:37 -07:00 committed by GitHub
parent 3bdd9a850f
commit 165365473f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 1 deletions

View File

@ -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");
}
}
}

View File

@ -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}"

View File

@ -48,7 +48,6 @@ namespace
{
const wchar_t MSI_VERSION_MUTEX_NAME[] = L"Local\\PowerToyRunMutex";
const wchar_t MSIX_VERSION_MUTEX_NAME[] = L"Local\\PowerToyMSIXRunMutex";
const wchar_t PT_URI_PROTOCOL_SCHEME[] = L"powertoys://";
}

View File

@ -291,6 +291,10 @@ void run_settings_window()
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"\"";
executable_args.append(executable_path);
executable_args.append(L"\" ");