(SettingsWindow): some tweaks.

This commit is contained in:
morkt 2018-01-11 18:45:23 +04:00
parent 8d4cb0567f
commit 33ffb0da6f
2 changed files with 6 additions and 4 deletions

View File

@ -46,6 +46,7 @@ IN THE SOFTWARE.
<CheckBox DataContext="{TemplateBinding DataContext}" IsChecked="{Binding Value}" <CheckBox DataContext="{TemplateBinding DataContext}" IsChecked="{Binding Value}"
Content="{Binding Text}" ToolTip="{Binding Description}" Margin="2"/> Content="{Binding Text}" ToolTip="{Binding Description}" Margin="2"/>
</ControlTemplate> </ControlTemplate>
<TextBlock x:Key="FormatsPanel" Text="Not much settings implemented so far."/>
<Style x:Key="ExpandCollapseToggleStyle" TargetType="ToggleButton"> <Style x:Key="ExpandCollapseToggleStyle" TargetType="ToggleButton">
<Setter Property="Focusable" Value="False"/> <Setter Property="Focusable" Value="False"/>
@ -170,7 +171,7 @@ IN THE SOFTWARE.
<StackPanel Orientation="Vertical" DataContext="{Binding ElementName=SectionsPane,Path=SelectedItem}"> <StackPanel Orientation="Vertical" DataContext="{Binding ElementName=SectionsPane,Path=SelectedItem}">
<TextBlock Text="{Binding SectionTitle}" Background="{StaticResource SectionTitleBackground}" <TextBlock Text="{Binding SectionTitle}" Background="{StaticResource SectionTitleBackground}"
FontWeight="Bold" FontSize="14" Padding="2,0,2,0" Margin="0,0,0,4"/> FontWeight="Bold" FontSize="14" Padding="2,0,2,0" Margin="0,0,0,4"/>
<StackPanel x:Name="SettingsPane"/> <Decorator x:Name="SettingsPane"/>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
</Border> </Border>

View File

@ -52,10 +52,10 @@ namespace GARbro.GUI
private void OnSectionChanged (object sender, System.Windows.RoutedEventArgs e) private void OnSectionChanged (object sender, System.Windows.RoutedEventArgs e)
{ {
this.SettingsPane.Children.Clear(); this.SettingsPane.Child = null;
var section = SectionsPane.SelectedValue as SettingsSectionView; var section = SectionsPane.SelectedValue as SettingsSectionView;
if (section != null && section.Panel != null) if (section != null && section.Panel != null)
this.SettingsPane.Children.Add (section.Panel); this.SettingsPane.Child = section.Panel;
} }
private void Button_ClickApply (object sender, System.Windows.RoutedEventArgs e) private void Button_ClickApply (object sender, System.Windows.RoutedEventArgs e)
@ -86,7 +86,8 @@ namespace GARbro.GUI
SettingsSectionView[] list = { SettingsSectionView[] list = {
new SettingsSectionView { new SettingsSectionView {
Label = "Formats", Label = "Formats",
Children = EnumerateFormatsSettings() Children = EnumerateFormatsSettings(),
Panel = (UIElement)this.Resources["FormatsPanel"]
}, },
}; };
SettingsSectionView selected_section = null; SettingsSectionView selected_section = null;