Added resizing

Server Settings - have added resizing to all the grids, so the height can be increased/decreased. The height is also remembered, so when you reopen, it will size the grid correctly.
This commit is contained in:
Brett Hewitson 2021-11-26 09:58:00 +10:00
parent 75c7cd2d40
commit ff4129d5ad
6 changed files with 61 additions and 16 deletions

View file

@ -561,6 +561,12 @@
<setting name="MainWindow_WindowState" serializeAs="String"> <setting name="MainWindow_WindowState" serializeAs="String">
<value>Normal</value> <value>Normal</value>
</setting> </setting>
<setting name="MOTDHeight" serializeAs="String">
<value>100</value>
</setting>
<setting name="ServerFilesGridHeight" serializeAs="String">
<value>250</value>
</setting>
</ServerManagerTool.Config> </ServerManagerTool.Config>
</userSettings> </userSettings>
</configuration> </configuration>

View file

@ -1932,5 +1932,29 @@ namespace ServerManagerTool {
this["MainWindow_WindowState"] = value; this["MainWindow_WindowState"] = value;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("100")]
public global::System.Windows.GridLength MOTDHeight {
get {
return ((global::System.Windows.GridLength)(this["MOTDHeight"]));
}
set {
this["MOTDHeight"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("250")]
public global::System.Windows.GridLength ServerFilesGridHeight {
get {
return ((global::System.Windows.GridLength)(this["ServerFilesGridHeight"]));
}
set {
this["ServerFilesGridHeight"] = value;
}
}
} }
} }

View file

@ -536,5 +536,11 @@
<Setting Name="MainWindow_WindowState" Type="System.Windows.WindowState" Scope="User"> <Setting Name="MainWindow_WindowState" Type="System.Windows.WindowState" Scope="User">
<Value Profile="(Default)">Normal</Value> <Value Profile="(Default)">Normal</Value>
</Setting> </Setting>
<Setting Name="MOTDHeight" Type="System.Windows.GridLength" Scope="User">
<Value Profile="(Default)">100</Value>
</Setting>
<Setting Name="ServerFilesGridHeight" Type="System.Windows.GridLength" Scope="User">
<Value Profile="(Default)">250</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View file

@ -24,8 +24,9 @@
<u style="font-size: .9em;">NEW</u> <u style="font-size: .9em;">NEW</u>
<br/> <br/>
<ul> <ul>
<li>Global Settings - Added option to set the Main Window start mode - Normal, Maximized, Minimized.</li> <li>Global Settings - added option to set the Main Window start mode - Normal, Maximized, Minimized.</li>
<li>Main Window - now sotres the Left and Top positions of the window, when in Normal mode. Will restore the window position when started. Defaults to 50,50.</li> <li>Main Window - now stores the Left and Top positions of the window, when in Normal mode. Will restore the window position when started. Defaults to 50,50.</li>
<li>Server Settings - added resizing to all the grids, so the height can be increased/decreased. The height is also remembered, so when you reopen, it will size the grid correctly.</li>
</ul> </ul>
<u style="font-size: .9em;">CHANGE</u> <u style="font-size: .9em;">CHANGE</u>
<br/> <br/>

View file

@ -24,8 +24,9 @@
<u style="font-size: .9em;">NEW</u> <u style="font-size: .9em;">NEW</u>
<br/> <br/>
<ul> <ul>
<li>Global Settings - Added option to set the Main Window start mode - Normal, Maximized, Minimized.</li> <li>Global Settings - added option to set the Main Window start mode - Normal, Maximized, Minimized.</li>
<li>Main Window - now sotres the Left and Top positions of the window, when in Normal mode. Will restore the window position when started. Defaults to 50,50.</li> <li>Main Window - now stores the Left and Top positions of the window, when in Normal mode. Will restore the window position when started. Defaults to 50,50.</li>
<li>Server Settings - added resizing to all the grids, so the height can be increased/decreased. The height is also remembered, so when you reopen, it will size the grid correctly.</li>
</ul> </ul>
<u style="font-size: .9em;">CHANGE</u> <u style="font-size: .9em;">CHANGE</u>
<br/> <br/>

View file

@ -1043,20 +1043,21 @@
</Grid> </Grid>
</GroupBox> </GroupBox>
<GroupBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="6" Header="{DynamicResource ServerSettings_MOTDLabel}" Style="{StaticResource GroupBoxStyle}" Height="200"> <GroupBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="6" Header="{DynamicResource ServerSettings_MOTDLabel}" Style="{StaticResource GroupBoxStyle}">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition /> <RowDefinition Height="{Binding Config.MOTDHeight, ElementName=SettingsControl, FallbackValue=100, Mode=TwoWay}" MinHeight="100"/>
<RowDefinition Height="Auto"/> <!--Splitter Row-->
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="80"/> <ColumnDefinition Width="Auto" MinWidth="100"/>
<ColumnDefinition Width="Auto" MinWidth="80"/> <ColumnDefinition Width="Auto" MinWidth="100"/>
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="1" Orientation="Horizontal"> <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
<Label Content="{DynamicResource ServerSettings_MOTDLineCountLabel}" VerticalAlignment="Center"> <Label Content="{DynamicResource ServerSettings_MOTDLineCountLabel}" VerticalAlignment="Center">
<Label.Style> <Label.Style>
<Style BasedOn="{StaticResource {x:Type Label}}" TargetType="{x:Type Label}"> <Style BasedOn="{StaticResource {x:Type Label}}" TargetType="{x:Type Label}">
@ -1083,7 +1084,7 @@
</Label> </Label>
</StackPanel> </StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" Grid.ColumnSpan="3"> <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
<Label Content="{DynamicResource ServerSettings_MOTDLengthLabel}" VerticalAlignment="Center"> <Label Content="{DynamicResource ServerSettings_MOTDLengthLabel}" VerticalAlignment="Center">
<Label.Style> <Label.Style>
<Style BasedOn="{StaticResource {x:Type Label}}" TargetType="{x:Type Label}"> <Style BasedOn="{StaticResource {x:Type Label}}" TargetType="{x:Type Label}">
@ -1110,10 +1111,12 @@
</Label> </Label>
</StackPanel> </StackPanel>
<TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Margin="1" Text="{Binding MOTD, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}" ToolTip="{DynamicResource ServerSettings_MOTDTooltip}" AcceptsReturn="True" TextWrapping="Wrap" MaxLength="4096" SpellCheck.IsEnabled="True" VerticalScrollBarVisibility="Auto" SourceUpdated="MOTD_SourceUpdated"/> <TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Margin="1" Text="{Binding MOTD, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True}" ToolTip="{DynamicResource ServerSettings_MOTDTooltip}" AcceptsReturn="True" TextWrapping="Wrap" MaxLength="4096" SpellCheck.IsEnabled="True" VerticalScrollBarVisibility="Auto" SourceUpdated="MOTD_SourceUpdated"/>
<CheckBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Margin="1" HorizontalAlignment="Left" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_MOTDIntervalEnabledLabel}" IsChecked="{Binding MOTDIntervalEnabled}" ToolTip="{DynamicResource ServerSettings_MOTDIntervalEnabledTooltip}"/> <GridSplitter Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Height="5" ShowsPreview="True" HorizontalAlignment="Stretch" VerticalAlignment="Center" Opacity="0"/>
<cctl:AnnotatedSlider Grid.Row="3" Grid.Column="2" Margin="1" Value="{Binding MOTDInterval, Converter={cc:IntRangeValueConverter 1}}" Suffix="{DynamicResource ServerSettings_MOTDIntervalUnits}" Minimum="10" Maximum="1440" TickFrequency="60" SmallChange="10" LargeChange="60" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" IsEnabled="{Binding MOTDIntervalEnabled}" ToolTip="{DynamicResource ServerSettings_MOTDIntervalTooltip}" />
<CheckBox Grid.Row="3" Grid.Column="0" Margin="1" HorizontalAlignment="Left" VerticalAlignment="Center" Content="{DynamicResource ServerSettings_MOTDIntervalEnabledLabel}" IsChecked="{Binding MOTDIntervalEnabled}" ToolTip="{DynamicResource ServerSettings_MOTDIntervalEnabledTooltip}"/>
<cctl:AnnotatedSlider Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Margin="1" Value="{Binding MOTDInterval, Converter={cc:IntRangeValueConverter 1}}" Suffix="{DynamicResource ServerSettings_MOTDIntervalUnits}" Minimum="10" Maximum="1440" TickFrequency="60" SmallChange="10" LargeChange="60" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" IsEnabled="{Binding MOTDIntervalEnabled}" ToolTip="{DynamicResource ServerSettings_MOTDIntervalTooltip}" />
</Grid> </Grid>
</GroupBox> </GroupBox>
@ -1439,7 +1442,9 @@
<Grid Margin="-8,0,2,0"> <Grid Margin="-8,0,2,0">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="*"/> <RowDefinition Height="{Binding Config.ServerFilesGridHeight, ElementName=SettingsControl, FallbackValue=250, Mode=TwoWay}" MinHeight="200"/>
<RowDefinition Height="Auto"/> <!--Splitter Row-->
<RowDefinition Height="1" MinHeight="1"/> <!--Empty Row for Last Splitter-->
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition/> <ColumnDefinition/>
@ -1448,7 +1453,7 @@
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontWeight="Bold" Content="{DynamicResource ServerSettings_ServerFilesWarningLabel}"/> <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontWeight="Bold" Content="{DynamicResource ServerSettings_ServerFilesWarningLabel}"/>
<GroupBox Grid.Row="1" Grid.Column="0" HorizontalAlignment="Stretch" Height="250"> <GroupBox Grid.Row="1" Grid.Column="0" HorizontalAlignment="Stretch">
<GroupBox.Header> <GroupBox.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Label Content="{DynamicResource ServerSettings_ServerFilesBlacklistedLabel}"/> <Label Content="{DynamicResource ServerSettings_ServerFilesBlacklistedLabel}"/>
@ -1536,7 +1541,7 @@
</DataGrid> </DataGrid>
</GroupBox> </GroupBox>
<GroupBox Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" Height="250"> <GroupBox Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch">
<GroupBox.Header> <GroupBox.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<CheckBox Margin="0,6,0,5" IsChecked="{Binding EnableWhitelist}" Content="{DynamicResource ServerSettings_ServerFilesWhitelistedLabel}" ToolTip="{DynamicResource ServerSettings_ServerFilesWhitelistedTooltip}" VerticalAlignment="Center"/> <CheckBox Margin="0,6,0,5" IsChecked="{Binding EnableWhitelist}" Content="{DynamicResource ServerSettings_ServerFilesWhitelistedLabel}" ToolTip="{DynamicResource ServerSettings_ServerFilesWhitelistedTooltip}" VerticalAlignment="Center"/>
@ -1623,6 +1628,8 @@
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
</GroupBox> </GroupBox>
<GridSplitter Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Height="5" ShowsPreview="True" HorizontalAlignment="Stretch" VerticalAlignment="Center" Opacity="0"/>
</Grid> </Grid>
</Expander> </Expander>