mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-10-03 10:36:30 +13:00
Add initial UI elements for "Size and location" tab of Settings window
This commit is contained in:
parent
9ed9ca635e
commit
41a8b90477
2 changed files with 96 additions and 67 deletions
|
@ -63,7 +63,61 @@
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="{u:Translate 'Size and location'}">
|
<TabItem Header="{u:Translate 'Size and location'}">
|
||||||
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
|
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
|
||||||
<Label Content="fill me 2" Background="Red"/>
|
<StackPanel>
|
||||||
|
<GroupBox Header="{u:Translate 'Sizes in percent'}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="50" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<!-- TODO WPF NumericUpDown.. -->
|
||||||
|
<TextBox Grid.Row="0" Grid.Column="0" x:Name="numericUpDownSizeInPercent" VerticalContentAlignment="Center" />
|
||||||
|
<Label Grid.Row="0" Grid.Column="1" Content="UpDown" Background="Red" Padding="0" VerticalAlignment="Center"/>
|
||||||
|
<Label Grid.Row="0" Grid.Column="2" Content="{u:Translate 'Application size'}" Padding="5,0,0,0" VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="0" x:Name="numericUpDownIconSizeInPercent" VerticalContentAlignment="Center" />
|
||||||
|
<Label Grid.Row="1" Grid.Column="1" Content="UpDown" Background="Red" Padding="0" VerticalAlignment="Center"/>
|
||||||
|
<Label Grid.Row="1" Grid.Column="2" Content="{u:Translate 'Icon size'}" Padding="5,0,0,0" VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="2" Grid.Column="0" x:Name="numericUpDownRowHeighteInPercentage" VerticalContentAlignment="Center" />
|
||||||
|
<Label Grid.Row="2" Grid.Column="1" Content="UpDown" Background="Red" Padding="0" VerticalAlignment="Center"/>
|
||||||
|
<Label Grid.Row="2" Grid.Column="2" Content="{u:Translate 'Row height'}" Padding="5,0,0,0" VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="3" Grid.Column="0" x:Name="numericUpDownMenuWidth" VerticalContentAlignment="Center" />
|
||||||
|
<Label Grid.Row="3" Grid.Column="1" Content="UpDown" Background="Red" Padding="0" VerticalAlignment="Center"/>
|
||||||
|
<Label Grid.Row="3" Grid.Column="2" Content="{u:Translate 'Maximum menu width'}" Padding="5,0,0,0" VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="4" Grid.Column="0" x:Name="numericUpDownMenuHeight" VerticalContentAlignment="Center" />
|
||||||
|
<Label Grid.Row="4" Grid.Column="1" Content="UpDown" Background="Red" Padding="0" VerticalAlignment="Center"/>
|
||||||
|
<Label Grid.Row="4" Grid.Column="2" Content="{u:Translate 'Maximum menu height'}" Padding="5,0,0,0" VerticalAlignment="Center"/>
|
||||||
|
</Grid>
|
||||||
|
</GroupBox>
|
||||||
|
<GroupBox Header="{u:Translate 'Main menu appears'}">
|
||||||
|
<StackPanel>
|
||||||
|
<RadioButton x:Name="radioButtonAppearAtTheBottomRight" GroupName="MainMenuAppearsAt" Content="{u:Translate 'Bottom right'}" />
|
||||||
|
<RadioButton x:Name="radioButtonAppearAtTheBottomLeft" GroupName="MainMenuAppearsAt" Content="{u:Translate 'Bottom left'}" />
|
||||||
|
<RadioButton x:Name="radioButtonUseCustomLocation" GroupName="MainMenuAppearsAt" Content="{u:Translate 'Custom (drag it to the appropriate position)'}" />
|
||||||
|
<RadioButton x:Name="radioButtonAppearAtMouseLocation" GroupName="MainMenuAppearsAt" Content="{u:Translate 'At mouse location'}" />
|
||||||
|
</StackPanel>
|
||||||
|
</GroupBox>
|
||||||
|
<GroupBox Header="{u:Translate 'Sub menu appears'}">
|
||||||
|
<StackPanel>
|
||||||
|
<RadioButton x:Name="radioButtonNextToPreviousMenu" GroupName="SubMenuAppearsAt" Content="{u:Translate 'Next to the previous one'}" />
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<RadioButton x:Name="radioButtonOverlapping" GroupName="SubMenuAppearsAt" Content="{u:Translate 'Overlapping'}" Checked="RadioButtonOverlapping_Checked" Unchecked="RadioButtonOverlapping_Unchecked" />
|
||||||
|
<!-- TODO WPF NumericUpDown -->
|
||||||
|
<TextBox x:Name="numericUpDownOverlappingOffsetPixels" Width="50" VerticalContentAlignment="Center" Margin="15,0,0,0" />
|
||||||
|
<Label Content="UpDown" Background="Red" Padding="0" VerticalAlignment="Center"/>
|
||||||
|
<Label Content="{u:Translate 'Offset by pixels'}" Padding="5,0,0,0" VerticalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</GroupBox>
|
||||||
|
<Button Content="{u:Translate 'Default'}" Margin="3" MinWidth="76" Click="ButtonSizeAndLocationDefault_Click" HorizontalAlignment="Left"/>
|
||||||
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="{u:Translate 'Advanced'}">
|
<TabItem Header="{u:Translate 'Advanced'}">
|
||||||
|
|
|
@ -123,23 +123,6 @@ namespace SystemTrayMenu.UserInterface
|
||||||
}
|
}
|
||||||
#if TODO
|
#if TODO
|
||||||
|
|
||||||
groupBoxSize.Text = Translator.GetText("Sizes in percent");
|
|
||||||
labelSizeInPercent.Text = Translator.GetText("Application size");
|
|
||||||
labelIconSizeInPercent.Text = Translator.GetText("Icon size");
|
|
||||||
labelRowHeightInPercentage.Text = Translator.GetText("Row height");
|
|
||||||
labelMaxMenuWidth.Text = Translator.GetText("Maximum menu width");
|
|
||||||
labelMaxMenuHeight.Text = Translator.GetText("Maximum menu height");
|
|
||||||
groupBoxMenuAppearAt.Text = Translator.GetText("Main menu appears");
|
|
||||||
radioButtonAppearAtTheBottomLeft.Text = Translator.GetText("Bottom left");
|
|
||||||
radioButtonAppearAtTheBottomRight.Text = Translator.GetText("Bottom right");
|
|
||||||
radioButtonUseCustomLocation.Text = Translator.GetText("Custom (drag it to the appropriate position)");
|
|
||||||
radioButtonAppearAtMouseLocation.Text = Translator.GetText("At mouse location");
|
|
||||||
groupBoxSubMenuAppearAt.Text = Translator.GetText("Sub menu appears");
|
|
||||||
radioButtonNextToPreviousMenu.Text = Translator.GetText("Next to the previous one");
|
|
||||||
radioButtonOverlapping.Text = Translator.GetText("Overlapping");
|
|
||||||
labelOverlappingByPixelsOffset.Text = Translator.GetText("Offset by pixels");
|
|
||||||
buttonSizeAndLocationDefault.Text = Translator.GetText("Default");
|
|
||||||
|
|
||||||
groupBoxOptionalFeatures.Text = Translator.GetText("Optional Features");
|
groupBoxOptionalFeatures.Text = Translator.GetText("Optional Features");
|
||||||
checkBoxResolveLinksToFolders.Text = Translator.GetText("Resolve links to folders and show content");
|
checkBoxResolveLinksToFolders.Text = Translator.GetText("Resolve links to folders and show content");
|
||||||
checkBoxShowInTaskbar.Text = Translator.GetText("Show in Taskbar");
|
checkBoxShowInTaskbar.Text = Translator.GetText("Show in Taskbar");
|
||||||
|
@ -379,67 +362,74 @@ namespace SystemTrayMenu.UserInterface
|
||||||
numericUpDown.Value = newValue;
|
numericUpDown.Value = newValue;
|
||||||
((HandledMouseEventArgs)e).Handled = true;
|
((HandledMouseEventArgs)e).Handled = true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
numericUpDownSizeInPercent.Value = Settings.Default.SizeInPercent;
|
numericUpDownSizeInPercent.Text = Settings.Default.SizeInPercent.ToString();
|
||||||
|
#if TODO
|
||||||
numericUpDownIconSizeInPercent.Minimum = 50;
|
numericUpDownIconSizeInPercent.Minimum = 50;
|
||||||
numericUpDownIconSizeInPercent.Maximum = 200;
|
numericUpDownIconSizeInPercent.Maximum = 200;
|
||||||
numericUpDownIconSizeInPercent.Increment = 5;
|
numericUpDownIconSizeInPercent.Increment = 5;
|
||||||
numericUpDownIconSizeInPercent.MouseWheel += NumericUpDown_MouseWheel;
|
numericUpDownIconSizeInPercent.MouseWheel += NumericUpDown_MouseWheel;
|
||||||
numericUpDownIconSizeInPercent.Value = Settings.Default.IconSizeInPercent;
|
#endif
|
||||||
|
numericUpDownIconSizeInPercent.Text = Settings.Default.IconSizeInPercent.ToString();
|
||||||
|
#if TODO
|
||||||
numericUpDownRowHeighteInPercentage.Minimum = 50;
|
numericUpDownRowHeighteInPercentage.Minimum = 50;
|
||||||
numericUpDownRowHeighteInPercentage.Maximum = 200;
|
numericUpDownRowHeighteInPercentage.Maximum = 200;
|
||||||
numericUpDownRowHeighteInPercentage.Increment = 5;
|
numericUpDownRowHeighteInPercentage.Increment = 5;
|
||||||
numericUpDownRowHeighteInPercentage.MouseWheel += NumericUpDown_MouseWheel;
|
numericUpDownRowHeighteInPercentage.MouseWheel += NumericUpDown_MouseWheel;
|
||||||
|
#endif
|
||||||
if (DllImports.NativeMethods.IsTouchEnabled())
|
if (DllImports.NativeMethods.IsTouchEnabled())
|
||||||
{
|
{
|
||||||
numericUpDownRowHeighteInPercentage.Value = Settings.Default.RowHeighteInPercentageTouch;
|
numericUpDownRowHeighteInPercentage.Text = Settings.Default.RowHeighteInPercentageTouch.ToString();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
numericUpDownRowHeighteInPercentage.Value = Settings.Default.RowHeighteInPercentage;
|
numericUpDownRowHeighteInPercentage.Text = Settings.Default.RowHeighteInPercentage.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TODO
|
||||||
numericUpDownMenuWidth.Minimum = 25;
|
numericUpDownMenuWidth.Minimum = 25;
|
||||||
numericUpDownMenuWidth.Maximum = 400;
|
numericUpDownMenuWidth.Maximum = 400;
|
||||||
numericUpDownMenuWidth.Increment = 5;
|
numericUpDownMenuWidth.Increment = 5;
|
||||||
numericUpDownMenuWidth.Value = Settings.Default.WidthMaxInPercent;
|
#endif
|
||||||
|
numericUpDownMenuWidth.Text = Settings.Default.WidthMaxInPercent.ToString();
|
||||||
|
#if TODO
|
||||||
|
|
||||||
numericUpDownMenuHeight.Minimum = 25;
|
numericUpDownMenuHeight.Minimum = 25;
|
||||||
numericUpDownMenuHeight.Maximum = 400;
|
numericUpDownMenuHeight.Maximum = 400;
|
||||||
numericUpDownMenuHeight.Increment = 5;
|
numericUpDownMenuHeight.Increment = 5;
|
||||||
numericUpDownMenuHeight.Value = Settings.Default.HeightMaxInPercent;
|
#endif
|
||||||
|
numericUpDownMenuHeight.Text = Settings.Default.HeightMaxInPercent.ToString();
|
||||||
|
|
||||||
if (Settings.Default.UseCustomLocation)
|
if (Settings.Default.UseCustomLocation)
|
||||||
{
|
{
|
||||||
radioButtonUseCustomLocation.Checked = true;
|
radioButtonUseCustomLocation.IsChecked = true;
|
||||||
}
|
}
|
||||||
else if (Settings.Default.AppearAtMouseLocation)
|
else if (Settings.Default.AppearAtMouseLocation)
|
||||||
{
|
{
|
||||||
radioButtonAppearAtMouseLocation.Checked = true;
|
radioButtonAppearAtMouseLocation.IsChecked = true;
|
||||||
}
|
}
|
||||||
else if (Settings.Default.AppearAtTheBottomLeft)
|
else if (Settings.Default.AppearAtTheBottomLeft)
|
||||||
{
|
{
|
||||||
radioButtonAppearAtTheBottomLeft.Checked = true;
|
radioButtonAppearAtTheBottomLeft.IsChecked = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
radioButtonAppearAtTheBottomRight.Checked = true;
|
radioButtonAppearAtTheBottomRight.IsChecked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
numericUpDownOverlappingOffsetPixels.Value = Settings.Default.OverlappingOffsetPixels;
|
numericUpDownOverlappingOffsetPixels.Text = Settings.Default.OverlappingOffsetPixels.ToString();
|
||||||
if (Settings.Default.AppearNextToPreviousMenu)
|
if (Settings.Default.AppearNextToPreviousMenu)
|
||||||
{
|
{
|
||||||
radioButtonNextToPreviousMenu.Checked = true;
|
radioButtonNextToPreviousMenu.IsChecked = true;
|
||||||
numericUpDownOverlappingOffsetPixels.Enabled = false;
|
numericUpDownOverlappingOffsetPixels.IsEnabled = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
radioButtonOverlapping.Checked = true;
|
radioButtonOverlapping.IsChecked = true;
|
||||||
numericUpDownOverlappingOffsetPixels.Enabled = true;
|
numericUpDownOverlappingOffsetPixels.IsEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TODO
|
||||||
checkBoxResolveLinksToFolders.Checked = Settings.Default.ResolveLinksToFolders;
|
checkBoxResolveLinksToFolders.Checked = Settings.Default.ResolveLinksToFolders;
|
||||||
checkBoxShowInTaskbar.Checked = Settings.Default.ShowInTaskbar;
|
checkBoxShowInTaskbar.Checked = Settings.Default.ShowInTaskbar;
|
||||||
checkBoxSendHotkeyInsteadKillOtherInstances.Checked = Settings.Default.SendHotkeyInsteadKillOtherInstances;
|
checkBoxSendHotkeyInsteadKillOtherInstances.Checked = Settings.Default.SendHotkeyInsteadKillOtherInstances;
|
||||||
|
@ -1247,24 +1237,22 @@ namespace SystemTrayMenu.UserInterface
|
||||||
|
|
||||||
buttonAddSampleStartMenuFolder.Enabled = !doesStartMenuFolderExist;
|
buttonAddSampleStartMenuFolder.Enabled = !doesStartMenuFolderExist;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
private void ButtonSizeAndLocationDefault_Click(object sender, EventArgs e)
|
private void ButtonSizeAndLocationDefault_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
numericUpDownSizeInPercent.Value = 100;
|
numericUpDownSizeInPercent.Text = 100.ToString();
|
||||||
numericUpDownIconSizeInPercent.Value = 100;
|
numericUpDownIconSizeInPercent.Text = 100.ToString();
|
||||||
numericUpDownRowHeighteInPercentage.Value = 100;
|
numericUpDownRowHeighteInPercentage.Text = 100.ToString();
|
||||||
numericUpDownMenuWidth.Value = 100;
|
numericUpDownMenuWidth.Text = 100.ToString();
|
||||||
numericUpDownMenuHeight.Value = 100;
|
numericUpDownMenuHeight.Text = 100.ToString();
|
||||||
|
|
||||||
radioButtonAppearAtTheBottomRight.Checked = false;
|
radioButtonAppearAtTheBottomLeft.IsChecked = true;
|
||||||
radioButtonAppearAtTheBottomLeft.Checked = true;
|
|
||||||
radioButtonUseCustomLocation.Checked = false;
|
|
||||||
radioButtonAppearAtMouseLocation.Checked = false;
|
|
||||||
|
|
||||||
radioButtonNextToPreviousMenu.Checked = true;
|
radioButtonNextToPreviousMenu.IsChecked = true;
|
||||||
numericUpDownOverlappingOffsetPixels.Value = 150;
|
numericUpDownOverlappingOffsetPixels.Text = 150.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TODO
|
||||||
private void ButtonAdvancedDefault_Click(object sender, EventArgs e)
|
private void ButtonAdvancedDefault_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
checkBoxResolveLinksToFolders.Checked = true;
|
checkBoxResolveLinksToFolders.Checked = true;
|
||||||
|
@ -1491,28 +1479,15 @@ namespace SystemTrayMenu.UserInterface
|
||||||
#endif
|
#endif
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
#if TODO
|
|
||||||
private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e)
|
private void RadioButtonOverlapping_Checked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
settingsForm?.Dispose();
|
numericUpDownOverlappingOffsetPixels.IsEnabled = true;
|
||||||
settingsForm = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RadioButtonNextToPreviousMenu_CheckedChanged(object sender, EventArgs e)
|
private void RadioButtonOverlapping_Unchecked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
radioButtonOverlapping.CheckedChanged -= RadioButtonOverlapping_CheckedChanged;
|
numericUpDownOverlappingOffsetPixels.IsEnabled = false;
|
||||||
radioButtonOverlapping.Checked = false;
|
|
||||||
radioButtonOverlapping.CheckedChanged += RadioButtonOverlapping_CheckedChanged;
|
|
||||||
numericUpDownOverlappingOffsetPixels.Enabled = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RadioButtonOverlapping_CheckedChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
radioButtonNextToPreviousMenu.CheckedChanged -= RadioButtonNextToPreviousMenu_CheckedChanged;
|
|
||||||
radioButtonNextToPreviousMenu.Checked = false;
|
|
||||||
radioButtonNextToPreviousMenu.CheckedChanged += RadioButtonNextToPreviousMenu_CheckedChanged;
|
|
||||||
numericUpDownOverlappingOffsetPixels.Enabled = true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue