mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 00:46:12 +02:00
Make UI structure more flat
This commit is contained in:
@@ -18,7 +18,7 @@ internal class PluginEntryDataContext(PluginMetadata pluginMetadata, ICommand co
|
|||||||
|
|
||||||
public string Name => pluginMetadata.Name;
|
public string Name => pluginMetadata.Name;
|
||||||
|
|
||||||
public string? Description => pluginMetadata.Description;
|
public string? Description => pluginMetadata.Description?.Trim();
|
||||||
|
|
||||||
public string Author => pluginMetadata.Author ?? (string)App.LanguageDictionary["unknown"];
|
public string Author => pluginMetadata.Author ?? (string)App.LanguageDictionary["unknown"];
|
||||||
|
|
||||||
|
|||||||
@@ -23,44 +23,42 @@
|
|||||||
<ui:ToggleSwitch x:Name="editCheckBox" Height="30" VerticalAlignment="Center" Margin="5 0 0 0" Content="{DynamicResource editLayout}" Click="EditCheckBox_Click" />
|
<ui:ToggleSwitch x:Name="editCheckBox" Height="30" VerticalAlignment="Center" Margin="5 0 0 0" Content="{DynamicResource editLayout}" Click="EditCheckBox_Click" />
|
||||||
</ui:Card>
|
</ui:Card>
|
||||||
|
|
||||||
<ui:Card Grid.Row="1" Padding="0 5" VerticalAlignment="Stretch" VerticalContentAlignment="Top">
|
<ScrollViewer Background="#FFBBBBBB" PreviewMouseWheel="ScrollViewer_PreviewMouseWheel" Grid.Row="1" VerticalAlignment="Stretch" VerticalContentAlignment="Top">
|
||||||
<ScrollViewer Background="#FFBBBBBB" PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
<ItemsControl ItemsSource="{Binding Settings.CurrentLayout.Plugins}">
|
||||||
<ItemsControl ItemsSource="{Binding Settings.CurrentLayout.Plugins}">
|
<ItemsControl.ItemTemplate>
|
||||||
<ItemsControl.ItemTemplate>
|
<DataTemplate>
|
||||||
<DataTemplate>
|
<ui:CardExpander Tag="{Binding}" Margin="0 0 0 5" Expanded="OptionsCardExpander_Expanded">
|
||||||
<ui:CardExpander Tag="{Binding}" Margin="5 0 5 5" Expanded="OptionsCardExpander_Expanded">
|
<ui:CardExpander.Header>
|
||||||
<ui:CardExpander.Header>
|
<Grid>
|
||||||
<Grid>
|
<Grid.RowDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
</Grid.RowDefinitions>
|
||||||
</Grid.RowDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="Auto" />
|
</Grid.ColumnDefinitions>
|
||||||
</Grid.ColumnDefinitions>
|
<ui:TextBlock Grid.Row="0" Grid.Column="0" FontTypography="Body" Text="{Binding Value.Metadata.Name}" />
|
||||||
<ui:TextBlock Grid.Row="0" Grid.Column="0" FontTypography="Body" Text="{Binding Value.Metadata.Name}" />
|
<Label Grid.Row="1" Grid.Column="0" Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}" FontSize="12" ContentStringFormat="{DynamicResource authorFormat}">
|
||||||
<Label Grid.Row="1" Grid.Column="0" Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}" FontSize="12" ContentStringFormat="{DynamicResource authorFormat}">
|
<Label.Style>
|
||||||
<Label.Style>
|
<Style TargetType="Label" BasedOn="{StaticResource {x:Type Label}}">
|
||||||
<Style TargetType="Label" BasedOn="{StaticResource {x:Type Label}}">
|
<Setter Property="Content" Value="{Binding Value.Metadata.Author, Converter={StaticResource UnderscoreEscapingConverter}}" />
|
||||||
<Setter Property="Content" Value="{Binding Value.Metadata.Author, Converter={StaticResource UnderscoreEscapingConverter}}" />
|
<Style.Triggers>
|
||||||
<Style.Triggers>
|
<DataTrigger Binding="{Binding Value.Metadata.Author}" Value="{x:Null}">
|
||||||
<DataTrigger Binding="{Binding Value.Metadata.Author}" Value="{x:Null}">
|
<Setter Property="Content" Value="{DynamicResource unknown}" />
|
||||||
<Setter Property="Content" Value="{DynamicResource unknown}" />
|
</DataTrigger>
|
||||||
</DataTrigger>
|
</Style.Triggers>
|
||||||
</Style.Triggers>
|
</Style>
|
||||||
</Style>
|
</Label.Style>
|
||||||
</Label.Style>
|
</Label>
|
||||||
</Label>
|
<ui:ToggleSwitch Grid.Row="0" Grid.RowSpan="2" Grid.Column="1" Click="PluginCheckBox_Click" IsChecked="{Binding Value.Enabled}" Tag="{Binding Key}" Margin="0,0,16,0" VerticalAlignment="Center" />
|
||||||
<ui:ToggleSwitch Grid.Row="0" Grid.RowSpan="2" Grid.Column="1" Click="PluginCheckBox_Click" IsChecked="{Binding Value.Enabled}" Tag="{Binding Key}" Margin="0,0,16,0" VerticalAlignment="Center" />
|
</Grid>
|
||||||
</Grid>
|
</ui:CardExpander.Header>
|
||||||
</ui:CardExpander.Header>
|
</ui:CardExpander>
|
||||||
</ui:CardExpander>
|
</DataTemplate>
|
||||||
</DataTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl>
|
||||||
</ItemsControl>
|
</ScrollViewer>
|
||||||
</ScrollViewer>
|
|
||||||
</ui:Card>
|
|
||||||
|
|
||||||
<ui:Card Grid.Row="2" Grid.ColumnSpan="2" Margin="0 5 0 0" Padding="5">
|
<ui:Card Grid.Row="2" Grid.ColumnSpan="2" Margin="0 5 0 0" Padding="5">
|
||||||
<Grid >
|
<Grid >
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="2*" />
|
<RowDefinition Height="2*" />
|
||||||
<RowDefinition Height="auto" />
|
<RowDefinition Height="auto" />
|
||||||
<RowDefinition Height="3*" />
|
<RowDefinition Height="auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<ui:Card HorizontalAlignment="Center" Width="100" Padding="5" Height="100" BorderThickness="1" BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}">
|
<ui:Card HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="100" Padding="5" Height="100" BorderThickness="1" BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}">
|
||||||
<Image Source="{Binding Logo, FallbackValue={StaticResource ModioCogBlue}, TargetNullValue={StaticResource ModioCogBlue}}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
|
<Image Source="{Binding Logo, FallbackValue={StaticResource ModioCogBlue}, TargetNullValue={StaticResource ModioCogBlue}}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
|
||||||
</ui:Card>
|
</ui:Card>
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
<Label Content="{Binding Version}" HorizontalAlignment="Center" ContentStringFormat="{DynamicResource versionFormat}" />
|
<Label Content="{Binding Version}" HorizontalAlignment="Center" ContentStringFormat="{DynamicResource versionFormat}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<Grid Grid.Row="1" Grid.ColumnSpan="2">
|
<Grid Grid.Row="1" Grid.ColumnSpan="2" Margin="0 5">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
<TextBlock Text="{Binding InstallUninstallButtonData.Text}" />
|
<TextBlock Text="{Binding InstallUninstallButtonData.Text}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Grid.Column="1" Command="{Binding OpenButtonData.Command}" IsEnabled="{Binding OpenButtonData.IsEnabled}" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Margin="5 5 10 0">
|
<Button Grid.Column="1" Command="{Binding OpenButtonData.Command}" IsEnabled="{Binding OpenButtonData.IsEnabled}" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Margin="5 0 5 0">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<ui:SymbolIcon Symbol="{Binding OpenButtonData.Icon}" Margin="0 0 10 0" />
|
<ui:SymbolIcon Symbol="{Binding OpenButtonData.Icon}" Margin="0 0 10 0" />
|
||||||
<TextBlock Text="{Binding OpenButtonData.Text}" />
|
<TextBlock Text="{Binding OpenButtonData.Text}" />
|
||||||
@@ -56,9 +56,9 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<StackPanel Grid.Row="2" Grid.ColumnSpan="2" Margin="0 5">
|
<StackPanel Grid.Row="2" Grid.ColumnSpan="2" Margin="5">
|
||||||
<Label Content="{Binding Name, Converter={StaticResource UnderscoreEscapingConverter}}" FontSize="20" Padding="0" />
|
<ui:TextBlock Text="{Binding Name, Converter={StaticResource UnderscoreEscapingConverter}}" FontTypography="Title" Padding="0" Margin="0 0 0 5" />
|
||||||
<TextBlock Text="{Binding Description}" TextWrapping="Wrap" />
|
<TextBlock Text="{Binding Description}" TextWrapping="Wrap" Margin="0" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ui:Card>
|
</ui:Card>
|
||||||
|
|||||||
@@ -42,40 +42,11 @@
|
|||||||
</ui:Card>
|
</ui:Card>
|
||||||
|
|
||||||
<busyIndicator:BusyMask Grid.Row="2" IsBusy="{Binding IsSearching}" IndicatorType="Ring" BusyContent="Searching..." BusyContentMargin="0,50,0,0" IsBusyAtStartup="False" Foreground="{DynamicResource TextFillColorPrimaryBrush}" Background="{DynamicResource ControlStrokeColorDefaultBrush}">
|
<busyIndicator:BusyMask Grid.Row="2" IsBusy="{Binding IsSearching}" IndicatorType="Ring" BusyContent="Searching..." BusyContentMargin="0,50,0,0" IsBusyAtStartup="False" Foreground="{DynamicResource TextFillColorPrimaryBrush}" Background="{DynamicResource ControlStrokeColorDefaultBrush}">
|
||||||
<ui:Card VerticalAlignment="Stretch" Padding="0" VerticalContentAlignment="Top">
|
<ScrollViewer VerticalScrollBarVisibility="Auto" VerticalAlignment="Stretch" Padding="0" VerticalContentAlignment="Top" Margin="0 0 2.5 0">
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
<ItemsControl ItemsSource="{Binding AllPlugins}">
|
||||||
<ItemsControl ItemsSource="{Binding AllPlugins}" Margin="5">
|
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<local:ModEntry Margin="0 0 0 5" />
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
<ItemsControl.Style>
|
|
||||||
<Style TargetType="ItemsControl">
|
|
||||||
<Style.Triggers>
|
|
||||||
<Trigger Property="HasItems" Value="false">
|
|
||||||
<Setter Property="Template">
|
|
||||||
<Setter.Value>
|
|
||||||
<ControlTemplate>
|
|
||||||
<TextBlock Text="No plugins found!" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
</Trigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</ItemsControl.Style>
|
|
||||||
</ItemsControl>
|
|
||||||
</ScrollViewer>
|
|
||||||
</ui:Card>
|
|
||||||
</busyIndicator:BusyMask>
|
|
||||||
|
|
||||||
<ui:Card Grid.Row="2" Grid.Column="2" VerticalAlignment="Stretch" Padding="0" VerticalContentAlignment="Top">
|
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
|
||||||
<ItemsControl ItemsSource="{Binding InstalledPlugins}" Margin="5">
|
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<local:ModEntry Margin="0 0 0 5"/>
|
<local:ModEntry Margin="0 0 0 5" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
<ItemsControl.Style>
|
<ItemsControl.Style>
|
||||||
@@ -95,7 +66,32 @@
|
|||||||
</ItemsControl.Style>
|
</ItemsControl.Style>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</ui:Card>
|
</busyIndicator:BusyMask>
|
||||||
|
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="2" Grid.Column="2" VerticalAlignment="Stretch" Padding="0" VerticalContentAlignment="Top">
|
||||||
|
<ItemsControl ItemsSource="{Binding InstalledPlugins}" Margin="2.5 0 0 0">
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<local:ModEntry Margin="0 0 0 5"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
<ItemsControl.Style>
|
||||||
|
<Style TargetType="ItemsControl">
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="HasItems" Value="false">
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate>
|
||||||
|
<TextBlock Text="No plugins found!" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</ItemsControl.Style>
|
||||||
|
</ItemsControl>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
<ui:Card Grid.Row="3" Grid.ColumnSpan="3" Padding="5" Margin="0 5 0 0">
|
<ui:Card Grid.Row="3" Grid.ColumnSpan="3" Padding="5" Margin="0 5 0 0">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|||||||
Reference in New Issue
Block a user