Browse Source

Use appearance on buttons instead of static color

pull/5/head
Ionite 1 year ago
parent
commit
dbb7561a29
No known key found for this signature in database
  1. 225
      StabilityMatrix/InstallerWindow.xaml
  2. 4
      StabilityMatrix/LaunchPage.xaml
  3. 6
      StabilityMatrix/PackageManagerPage.xaml

225
StabilityMatrix/InstallerWindow.xaml

@ -7,46 +7,46 @@
Loaded="InstallPage_OnLoaded"
Title="Stability Matrix - Installer"
Width="1100"
d:DesignHeight="600"
d:DesignWidth="700"
WindowBackdropType="Mica"
d:DataContext="{d:DesignInstance Type=viewModels:InstallerViewModel,
IsDesignTimeCreatable=True}"
d:DesignHeight="600"
d:DesignWidth="700"
mc:Ignorable="d"
x:Class="StabilityMatrix.InstallerWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:api="clr-namespace:StabilityMatrix.Models.Api"
xmlns:converters="clr-namespace:StabilityMatrix.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:StabilityMatrix"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:models="clr-namespace:StabilityMatrix.Models"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:viewModels="clr-namespace:StabilityMatrix.ViewModels"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xaml="clr-namespace:Markdown.Xaml;assembly=Markdown.Xaml"
xmlns:api="clr-namespace:StabilityMatrix.Models.Api"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:converters="clr-namespace:StabilityMatrix.Converters">
xmlns:xaml="clr-namespace:Markdown.Xaml;assembly=Markdown.Xaml">
<ui:FluentWindow.Resources>
<converters:ValueConverterGroup x:Key="InvertAndVisibilitate">
<converters:BoolNegationConverter/>
<BooleanToVisibilityConverter/>
<converters:BoolNegationConverter />
<BooleanToVisibilityConverter />
</converters:ValueConverterGroup>
<converters:BoolNegationConverter x:Key="BoolNegationConverter"/>
<xaml:Markdown x:Key="Markdown"
DocumentStyle="{StaticResource DocumentStyle}"
Heading1Style="{StaticResource H1Style}"
Heading2Style="{StaticResource H2Style}"
Heading3Style="{StaticResource H3Style}"
Heading4Style="{StaticResource H4Style}"
LinkStyle="{StaticResource LinkStyle}"
ImageStyle="{StaticResource ImageStyle}"
SeparatorStyle="{StaticResource SeparatorStyle}"
AssetPathRoot="{x:Static system:Environment.CurrentDirectory}"/>
<xaml:TextToFlowDocumentConverter x:Key="TextToFlowDocumentConverter"
Markdown="{StaticResource Markdown}"/>
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
<xaml:Markdown
AssetPathRoot="{x:Static system:Environment.CurrentDirectory}"
DocumentStyle="{StaticResource DocumentStyle}"
Heading1Style="{StaticResource H1Style}"
Heading2Style="{StaticResource H2Style}"
Heading3Style="{StaticResource H3Style}"
Heading4Style="{StaticResource H4Style}"
ImageStyle="{StaticResource ImageStyle}"
LinkStyle="{StaticResource LinkStyle}"
SeparatorStyle="{StaticResource SeparatorStyle}"
x:Key="Markdown" />
<xaml:TextToFlowDocumentConverter Markdown="{StaticResource Markdown}" x:Key="TextToFlowDocumentConverter" />
</ui:FluentWindow.Resources>
<Grid>
@ -55,32 +55,40 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ui:TitleBar Background="#191919" Foreground="White">
<ui:TitleBar.Header>
<TextBlock Margin="16,8" Text="Stability Matrix" />
</ui:TitleBar.Header>
</ui:TitleBar>
<StackPanel Grid.Row="1" Orientation="Vertical" Margin="16"
Visibility="{Binding ProgressBarVisibility, FallbackValue=Visible}">
<StackPanel
Grid.Row="1"
Margin="16"
Orientation="Vertical"
Visibility="{Binding ProgressBarVisibility, FallbackValue=Visible}">
<ProgressBar Value="{Binding ProgressValue, FallbackValue=10}"
IsIndeterminate="{Binding IsIndeterminate, FallbackValue=False}"
Maximum="100" Width="500" />
<TextBlock Text="{Binding ProgressText, FallbackValue=Installing...}"
HorizontalAlignment="Center" Padding="8" />
<ProgressBar
IsIndeterminate="{Binding IsIndeterminate, FallbackValue=False}"
Maximum="100"
Value="{Binding ProgressValue, FallbackValue=10}"
Width="500" />
<TextBlock
HorizontalAlignment="Center"
Padding="8"
Text="{Binding ProgressText, FallbackValue=Installing...}" />
</StackPanel>
<Grid Grid.Row="2" HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ListView ItemsSource="{Binding AvailablePackages}"
Margin="16"
SelectedItem="{Binding SelectedPackage, Mode=TwoWay}">
<ListView
ItemsSource="{Binding AvailablePackages}"
Margin="16"
SelectedItem="{Binding SelectedPackage, Mode=TwoWay}">
<ListView.Style>
<Style TargetType="ListView">
@ -90,8 +98,10 @@
<ListView.Template>
<ControlTemplate>
<Border CornerRadius="5" BorderThickness="1"
BorderBrush="{ui:ThemeResource KeyboardFocusBorderColorBrush}">
<Border
BorderBrush="{ui:ThemeResource KeyboardFocusBorderColorBrush}"
BorderThickness="1"
CornerRadius="5">
<ItemsPresenter />
</Border>
</ControlTemplate>
@ -99,40 +109,51 @@
<ListView.ItemTemplate>
<DataTemplate DataType="{x:Type models:BasePackage}">
<StackPanel VerticalAlignment="Top" Margin="8">
<TextBlock Text="{Binding DisplayName}" Margin="0,5,0,5" />
<TextBlock Text="{Binding ByAuthor}" Margin="0,0,0,5" />
<StackPanel Margin="8" VerticalAlignment="Top">
<TextBlock Margin="0,5,0,5" Text="{Binding DisplayName}" />
<TextBlock Margin="0,0,0,5" Text="{Binding ByAuthor}" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<StackPanel Grid.Column="1" Orientation="Vertical" Margin="16,16,0,16">
<TextBlock Text="{Binding SelectedPackage.DisplayName, FallbackValue=Stable Diffusion Web UI}"
FontSize="24" FontWeight="Bold" />
<TextBlock Text="{Binding SelectedPackage.ByAuthor, FallbackValue=by Automatic111}"
FontSize="12" Margin="0,5, 0, 5" />
<StackPanel
Grid.Column="1"
Margin="16,16,0,16"
Orientation="Vertical">
<TextBlock
FontSize="24"
FontWeight="Bold"
Text="{Binding SelectedPackage.DisplayName, FallbackValue=Stable Diffusion Web UI}" />
<TextBlock
FontSize="12"
Margin="0,5,0,5"
Text="{Binding SelectedPackage.ByAuthor, FallbackValue=by Automatic111}" />
<ui:Hyperlink NavigateUri="{Binding SelectedPackage.GithubUrl}">
<TextBlock TextWrapping="Wrap">
<Run Text="GitHub Page:" />
<Run Text="{Binding SelectedPackage.GithubUrl, Mode=OneWay}" TextDecorations="Underline" />
</TextBlock>
</ui:Hyperlink>
<StackPanel Orientation="Horizontal">
<ToggleButton IsEnabled="{Binding IsReleaseModeEnabled, FallbackValue=true}"
Content="Releases" IsChecked="{Binding IsReleaseMode}"/>
<ToggleButton Content="Branches" Margin="8,0,0,0"
IsChecked="{Binding IsReleaseMode,
Converter={StaticResource BoolNegationConverter}}"/>
<ToggleButton
Content="Releases"
IsChecked="{Binding IsReleaseMode}"
IsEnabled="{Binding IsReleaseModeEnabled, FallbackValue=true}" />
<ToggleButton
Content="Branches"
IsChecked="{Binding IsReleaseMode, Converter={StaticResource BoolNegationConverter}}"
Margin="8,0,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0, 16, 0, 0">
<StackPanel Margin="0,16,0,0" Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<Label Content="{Binding ReleaseLabelText, FallbackValue=Version}"/>
<ComboBox ItemsSource="{Binding AvailableVersions}"
SelectedItem="{Binding SelectedVersion}"
MinWidth="200">
<Label Content="{Binding ReleaseLabelText, FallbackValue=Version}" />
<ComboBox
ItemsSource="{Binding AvailableVersions}"
MinWidth="200"
SelectedItem="{Binding SelectedVersion}">
<ComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type models:PackageVersion}">
<StackPanel Margin="8,0,0,0" VerticalAlignment="Top">
@ -145,46 +166,52 @@
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="8, 0, 0, 0"
Visibility="{Binding IsReleaseMode,
Converter={StaticResource InvertAndVisibilitate}}">
<Label Content="Commit"/>
<ComboBox ItemsSource="{Binding AvailableCommits}"
SelectedItem="{Binding SelectedCommit}"
MinWidth="100">
<ComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type api:GithubCommit}">
<StackPanel Margin="8,0,0,0" VerticalAlignment="Top">
<TextBlock
Margin="0,4,0,4"
Name="NameTextBlock"
Text="{Binding ShaHash}" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
<StackPanel
Margin="8,0,0,0"
Orientation="Vertical"
Visibility="{Binding IsReleaseMode, Converter={StaticResource InvertAndVisibilitate}}">
<Label Content="Commit" />
<ComboBox
ItemsSource="{Binding AvailableCommits}"
MinWidth="100"
SelectedItem="{Binding SelectedCommit}">
<ComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type api:GithubCommit}">
<StackPanel Margin="8,0,0,0" VerticalAlignment="Top">
<TextBlock
Margin="0,4,0,4"
Name="NameTextBlock"
Text="{Binding ShaHash}" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
</StackPanel>
<Label Content="Install Location" Margin="0,16,0,0"/>
<ui:TextBox Text="{Binding InstallPath}" Margin="0,0,0,8"/>
<Label Content="Display Name" Margin="0,16,0,0"/>
<ui:TextBox Text="{Binding InstallName}" Margin="0,0,0,8"/>
<ui:Button Content="{Binding InstallButtonText, FallbackValue=Install}"
Command="{Binding InstallCommand}"
Width="100" Height="50"
Background="Green"
Margin="0,16,0,0"
VerticalAlignment="Top" />
<Label Content="Install Location" Margin="0,16,0,0" />
<ui:TextBox Margin="0,0,0,8" Text="{Binding InstallPath}" />
<Label Content="Display Name" Margin="0,16,0,0" />
<ui:TextBox Margin="0,0,0,8" Text="{Binding InstallName}" />
<ui:Button
Appearance="Success"
Command="{Binding InstallCommand}"
Content="{Binding InstallButtonText, FallbackValue=Install}"
Height="50"
Margin="0,16,0,0"
VerticalAlignment="Top"
Width="100" />
</StackPanel>
<FlowDocumentScrollViewer Grid.Column="2" Margin="16, 16, 0 ,16"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Document="{Binding ReleaseNotes, Converter={StaticResource TextToFlowDocumentConverter}}"/>
<FlowDocumentScrollViewer
Document="{Binding ReleaseNotes, Converter={StaticResource TextToFlowDocumentConverter}}"
Grid.Column="2"
HorizontalAlignment="Stretch"
Margin="16,16,0,16"
VerticalAlignment="Stretch" />
</Grid>
</Grid>
</ui:FluentWindow>

4
StabilityMatrix/LaunchPage.xaml

@ -119,7 +119,7 @@
</ui:Flyout>
<ui:Button
Background="Green"
Appearance="Success"
Command="{Binding LaunchCommand}"
Content="Launch"
Grid.Column="0"
@ -131,7 +131,7 @@
Width="72"
x:Name="LaunchButton" />
<ui:Button
Background="DarkRed"
Appearance="Danger"
Command="{Binding StopCommand}"
Content="Stop"
Grid.Column="0"

6
StabilityMatrix/PackageManagerPage.xaml

@ -42,7 +42,7 @@
Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<ui:Button
Background="Green"
Appearance="Success"
Command="{Binding ShowInstallWindowCommand}"
Foreground="{ui:ThemeResource TextFillColorPrimaryBrush}"
Height="40"
@ -107,7 +107,7 @@
Text="{Binding SelectedPackage.Path, FallbackValue=C:\Users\Example\Downloads}" />
<StackPanel Margin="0,16,0,0" Orientation="Horizontal">
<ui:Button
Background="Green"
Appearance="Success"
Command="{Binding InstallCommand}"
Content="{Binding InstallButtonText, FallbackValue=Install}"
Height="50"
@ -116,7 +116,7 @@
Visibility="{Binding InstallButtonVisibility, FallbackValue=Visible}"
Width="100" />
<ui:Button
Background="DarkRed"
Appearance="Danger"
Command="{Binding UninstallCommand}"
Content="Uninstall"
Height="50"

Loading…
Cancel
Save