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

4
StabilityMatrix/LaunchPage.xaml

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

6
StabilityMatrix/PackageManagerPage.xaml

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

Loading…
Cancel
Save