Skip to content

Commit

Permalink
Merge pull request #9 from LM-Kit/icons-refactoring
Browse files Browse the repository at this point in the history
Icons refactoring
  • Loading branch information
BeepBeepBopBop authored Nov 22, 2024
2 parents e6fdc01 + 729a094 commit 03f0940
Show file tree
Hide file tree
Showing 23 changed files with 1,474 additions and 70 deletions.
2 changes: 1 addition & 1 deletion LM-Kit-Maestro/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary x:Name="colors" Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />

<ResourceDictionary Source="Resources/Styles/Icons.xaml"/>
<!--<material:StyleResource ColorsOverride="{x:Reference colors}">
<material:StyleResource.Overrides>
<ResourceDictionary Source="Resources/Styles/Styles.xaml"/>
Expand Down
9 changes: 3 additions & 6 deletions LM-Kit-Maestro/LM-Kit-Maestro.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\Fonts\FontAwesome.otf" />
</ItemGroup>

<ItemGroup>
<MauiCss Include="wwwroot\css\font-awesome.css" />
<MauiCss Include="wwwroot\css\font-awesome.min.css" />
Expand Down Expand Up @@ -89,8 +85,6 @@
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
<PackageReference Include="UraniumUI" Version="2.10.2" />
<PackageReference Include="UraniumUI.Icons.FontAwesome" Version="2.10.2" />
<PackageReference Include="UraniumUI.Icons.MaterialIcons" Version="2.10.2" />
<PackageReference Include="UraniumUI.Material" Version="2.10.2" />
</ItemGroup>

Expand All @@ -113,6 +107,9 @@
<MauiXaml Update="Controls\CustomCollectionView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Resources\Styles\Icons.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="UI\ModelSelectionButton.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
Expand Down
7 changes: 3 additions & 4 deletions LM-Kit-Maestro/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public static MauiApp CreateMauiApp()
.ConfigureMopups()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
// Roboto
fonts.AddFont("Roboto-Thin.ttf", "RobotoThin");
fonts.AddFont("Roboto-Light.ttf", "RobotoLight");
Expand All @@ -46,8 +44,9 @@ public static MauiApp CreateMauiApp()
fonts.AddFont("Segoe UI.ttf", "Segoe");
fonts.AddFont("Segoe UI Bold.ttf", "SegoeBold");

fonts.AddFontAwesomeIconFonts();
fonts.AddMaterialIconFonts();
// FontAwesome
fonts.AddFont("Font Awesome 6 Free-Regular-400.otf", "FARegular");
fonts.AddFont("Font Awesome 6 Free-Solid-900.otf", "FASolid");
})
.ConfigureMauiHandlers(handlers =>
{
Expand Down
Binary file not shown.
Binary file not shown.
Binary file removed LM-Kit-Maestro/Resources/Fonts/FontAwesome.otf
Binary file not shown.
1,398 changes: 1,398 additions & 0 deletions LM-Kit-Maestro/Resources/Styles/Icons.xaml

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions LM-Kit-Maestro/Resources/Styles/Icons.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace LMKitMaestro.Resources.Styles;

public partial class Icons : ResourceDictionary
{
public Icons()
{
InitializeComponent();
}
}
18 changes: 14 additions & 4 deletions LM-Kit-Maestro/Resources/Styles/Styles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@
<Setter Property="WidthRequest" Value="{x:Static local:AppConstants.ChatPageToggleButtonWidth}"/>
<Setter Property="HeightRequest" Value="{x:Static local:AppConstants.ChatPageToggleButtonWidth}"/>
<Setter Property="VerticalOptions" Value="Center"/>
<Setter Property="FontFamily" Value="MaterialRegular"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontFamily" Value="FASolid"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Padding" Value="8"/>
<Setter Property="BorderWidth" Value="0"/>
<Setter Property="TextColor" Value="{StaticResource OnBackground}" />
Expand Down Expand Up @@ -129,10 +129,10 @@
</Style>

<Style x:Key="SecondaryActionButtonStyle" TargetType="Button">
<Setter Property="FontFamily" Value="MaterialRegular"/>
<Setter Property="FontFamily" Value="FASolid"/>
<Setter Property="CornerRadius" Value="16"/>
<Setter Property="Padding" Value="8"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="WidthRequest" Value="{x:Static local:AppConstants.ChatPageToggleButtonWidth}"/>
<Setter Property="HeightRequest" Value="{x:Static local:AppConstants.ChatPageToggleButtonWidth}"/>
<Setter Property="BackgroundColor" Value="{StaticResource Background}"/>
Expand Down Expand Up @@ -278,6 +278,16 @@
</Setter>
</Style>

<Style TargetType="Label" Class="IconSmall">
<Setter Property="FontFamily" Value="FASolid"/>
<Setter Property="FontSize" Value="9"/>
</Style>

<Style TargetType="Label" Class="Icon">
<Setter Property="FontFamily" Value="FASolid"/>
<Setter Property="FontSize" Value="12"/>
</Style>

<Style TargetType="Span">
<Setter Property="TextColor" Value="{StaticResource OnBackground}" />
</Style>
Expand Down
1 change: 0 additions & 1 deletion LM-Kit-Maestro/UI/ChatConversationsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
xmlns:models="clr-namespace:LMKitMaestro.Models"
xmlns:vm="clr-namespace:LMKitMaestro.ViewModels"
xmlns:controls="clr-namespace:LMKitMaestro.Controls"
xmlns:icons="clr-namespace:UraniumUI.Icons.MaterialIcons;assembly=UraniumUI.Icons.MaterialIcons"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:plainer="clr-namespace:Plainer.Maui.Controls;assembly=Plainer.Maui"
xmlns:uranium="http://schemas.enisn-projects.io/dotnet/maui/uraniumui"
Expand Down
16 changes: 9 additions & 7 deletions LM-Kit-Maestro/UI/ChatSettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
xmlns:controls="clr-namespace:LMKitMaestro.Controls"
xmlns:plainer="clr-namespace:Plainer.Maui.Controls;assembly=Plainer.Maui"
xmlns:local="clr-namespace:LMKitMaestro"
xmlns:icons="clr-namespace:UraniumUI.Icons.MaterialIcons;assembly=UraniumUI.Icons.MaterialIcons"
x:DataType="vm:SettingsViewModel"
x:Name="chatSettingsView"
>
Expand Down Expand Up @@ -166,13 +165,13 @@
<Grid RowDefinitions="*, auto">
<HorizontalStackLayout Padding="16" Spacing="8">
<Label Text="General settings"/>
<Label VerticalOptions="Center" FontFamily="MaterialRegular">
<Label VerticalOptions="Center" StyleClass="IconSmall">
<Label.Triggers>
<DataTrigger TargetType="Label" Binding="{Binding Source={x:Reference generalSettingsExpander}, Path=IsExpanded}" Value="True">
<Setter Property="Text" Value="{x:Static icons:MaterialRegular.Keyboard_arrow_up}"/>
<Setter Property="Text" Value="{StaticResource ChevronUp}"/>
</DataTrigger>
<DataTrigger TargetType="Label" Binding="{Binding Source={x:Reference generalSettingsExpander}, Path=IsExpanded}" Value="False">
<Setter Property="Text" Value="{x:Static icons:MaterialRegular.Keyboard_arrow_right}"/>
<Setter Property="Text" Value="{StaticResource ChevronDown}"/>
</DataTrigger>
</Label.Triggers>
</Label>
Expand Down Expand Up @@ -272,13 +271,16 @@
<Grid RowDefinitions="*, auto">
<HorizontalStackLayout Padding="16" Spacing="8">
<Label Text="Sampling configuration"/>
<Label VerticalOptions="Center" FontFamily="MaterialRegular" Text="{x:Static icons:MaterialRegular.Keyboard_arrow_right}">
<Label
VerticalOptions="Center"
StyleClass="IconSmall"
Text="{StaticResource ChevronRight}">
<Label.Triggers>
<DataTrigger TargetType="Label" Binding="{Binding Source={x:Reference samplingSettingsExpander}, Path=IsExpanded}" Value="True">
<Setter Property="Text" Value="{x:Static icons:MaterialRegular.Keyboard_arrow_up}"/>
<Setter Property="Text" Value="{StaticResource ChevronUp}"/>
</DataTrigger>
<DataTrigger TargetType="Label" Binding="{Binding Source={x:Reference samplingSettingsExpander}, Path=IsExpanded}" Value="False">
<Setter Property="Text" Value="{x:Static icons:MaterialRegular.Keyboard_arrow_right}"/>
<Setter Property="Text" Value="{StaticResource ChevronDown}"/>
</DataTrigger>
</Label.Triggers>
</Label>
Expand Down
12 changes: 5 additions & 7 deletions LM-Kit-Maestro/UI/ChatView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
xmlns:converters="clr-namespace:LMKitMaestro.Converters"
xmlns:services="clr-namespace:LMKitMaestro.Services"
xmlns:plainer="clr-namespace:Plainer.Maui.Controls;assembly=Plainer.Maui"
xmlns:icons="clr-namespace:UraniumUI.Icons.MaterialIcons;assembly=UraniumUI.Icons.MaterialIcons"
xmlns:fa="clr-namespace:UraniumUI.Icons.FontAwesome;assembly=UraniumUI.Icons.FontAwesome"
xmlns:uranium="http://schemas.enisn-projects.io/dotnet/maui/uraniumui"
x:Class="LMKitMaestro.UI.ChatView"
x:DataType="vm:ConversationViewModel"
Expand Down Expand Up @@ -110,7 +108,7 @@
FontFamily="FASolid"
FontSize="14"
Margin="0, 0, 0, 10"
Text="{x:Static fa:Solid.ArrowUp}"
Text="{StaticResource ArrowUp}"
Style="{StaticResource SendButtonStyle}"
>

Expand All @@ -125,7 +123,7 @@
</DataTrigger>

<DataTrigger TargetType="Button" Binding="{Binding AwaitingResponse}" Value="True">
<Setter Property="Text" Value="{x:Static fa:Solid.Stop}"/>
<Setter Property="Text" Value="{StaticResource Stop}"/>
<Setter Property="Command" Value="{Binding CancelCommand}"/>
<Setter Property="IsEnabled" Value="True"/>
</DataTrigger>
Expand Down Expand Up @@ -207,12 +205,12 @@
x:Name="reloadIcon"
Margin="2, 0"
IsVisible="False"
FontSize="13"
TranslationX="{Binding Source={x:Reference reloadLabel}, Path=Width}"
FontFamily="MaterialRegular"
VerticalOptions="Center"
TextColor="{StaticResource Outline}"
Text="{x:Static icons:MaterialRegular.Refresh}"/>
StyleClass="Icon"
Text="{StaticResource RotateRight}"
/>
</Grid>
</uranium:StatefulContentView>
</Grid>
Expand Down
6 changes: 3 additions & 3 deletions LM-Kit-Maestro/UI/ConversationListItemView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
xmlns:vm="clr-namespace:LMKitMaestro.ViewModels"
xmlns:controls="clr-namespace:LMKitMaestro.Controls"
xmlns:uranium="http://schemas.enisn-projects.io/dotnet/maui/uraniumui"
xmlns:icons="clr-namespace:UraniumUI.Icons.MaterialIcons;assembly=UraniumUI.Icons.MaterialIcons"
xmlns:plainer="clr-namespace:Plainer.Maui.Controls;assembly=Plainer.Maui"
x:DataType="vm:ConversationViewModel"
ToolTipProperties.Text="{Binding Title}"
Expand Down Expand Up @@ -163,9 +162,10 @@
StyleClass="RegularAction"
ZIndex="2"
Grid.Column="2"
FontSize="20"
FontSize="16"
Clicked="OnShowMoreButtonClicked"
Text="{x:Static icons:MaterialRegular.More_horiz}">
FontFamily="FASolid"
Text="{StaticResource Ellipsis}">
<Button.IsVisible>
<MultiBinding Converter="{StaticResource AnyTrueConverter}">
<Binding Path="IsHovered"/>
Expand Down
8 changes: 6 additions & 2 deletions LM-Kit-Maestro/UI/LinkView.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:icons="clr-namespace:UraniumUI.Icons.MaterialIcons;assembly=UraniumUI.Icons.MaterialIcons"
xmlns:uranium="http://schemas.enisn-projects.io/dotnet/maui/uraniumui"
x:Class="LMKitMaestro.UI.LinkView"
x:Name="linkView"
Expand Down Expand Up @@ -39,7 +38,12 @@
TappedCommand="{Binding Command}"
Tapped="OnLinkClicked">
<HorizontalStackLayout Spacing="4" HorizontalOptions="Center">
<Label TextColor="{Binding TextColor}" VerticalOptions="Center" Text="{Binding Icon}" FontFamily="MaterialRegular"/>
<Label
TextColor="{Binding TextColor}"
VerticalOptions="Center"
StyleClass="Icon"
Text="{Binding Icon}" />

<Label
FontSize="{Binding FontSize}"
FontFamily="{Binding FontFamily}"
Expand Down
9 changes: 4 additions & 5 deletions LM-Kit-Maestro/UI/ModelSelectionButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
xmlns:models="clr-namespace:LMKitMaestro.Models"
xmlns:vm="clr-namespace:LMKitMaestro.ViewModels"
xmlns:services="clr-namespace:LMKitMaestro.Services"
xmlns:icons="clr-namespace:UraniumUI.Icons.MaterialIcons;assembly=UraniumUI.Icons.MaterialIcons"
xmlns:uranium="http://schemas.enisn-projects.io/dotnet/maui/uraniumui"
x:Class="LMKitMaestro.UI.ModelSelectionButton"
x:DataType="vm:ModelListViewModel"
Expand All @@ -27,8 +26,8 @@
<Setter Property="Padding" Value="0"/>
<Setter Property="ToolTipProperties.Text" Value="Eject model"/>
<Setter Property="TextColor" Value="{StaticResource Primary}"/>
<Setter Property="FontFamily" Value="MaterialSharp"/>
<Setter Property="Text" Value="{x:Static icons:MaterialSharp.Eject}"/>
<Setter Property="FontFamily" Value="FASolid"/>
<Setter Property="Text" Value="{StaticResource Eject}"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
Expand Down Expand Up @@ -173,9 +172,9 @@
HorizontalOptions="End"
Grid.Column="2"
VerticalOptions="Center"
FontFamily="MaterialRegular"
StyleClass="IconSmall"
TextColor="{StaticResource Outline}"
Text="{x:Static icons:MaterialRegular.Keyboard_arrow_down}">
Text="{StaticResource ChevronDown}">
<Label.Triggers>
<DataTrigger TargetType="Label" Binding="{Binding Source={x:RelativeSource AncestorType={x:Type vm:AppShellViewModel}}, Path=AppIsInitialized}" Value="False">
<Setter Property="IsVisible" Value="False"/>
Expand Down
1 change: 0 additions & 1 deletion LM-Kit-Maestro/UI/Pages/AssistantsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
xmlns:vm="clr-namespace:LMKitMaestro.ViewModels"
xmlns:razor="clr-namespace:LMKitMaestro.UI.Razor.Components"
xmlns:services="clr-namespace:LMKitMaestro.Services"
xmlns:icons="clr-namespace:UraniumUI.Icons.MaterialIcons;assembly=UraniumUI.Icons.MaterialIcons"
xmlns:uranium="http://schemas.enisn-projects.io/dotnet/maui/uraniumui"
x:DataType="vm:AssistantsPageViewModel"
x:Class="LMKitMaestro.UI.AssistantsPage">
Expand Down
13 changes: 6 additions & 7 deletions LM-Kit-Maestro/UI/Pages/ChatPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
xmlns:vm="clr-namespace:LMKitMaestro.ViewModels"
xmlns:razor="clr-namespace:LMKitMaestro.UI.Razor.Components"
xmlns:services="clr-namespace:LMKitMaestro.Services"
xmlns:icons="clr-namespace:UraniumUI.Icons.MaterialIcons;assembly=UraniumUI.Icons.MaterialIcons"
xmlns:uranium="http://schemas.enisn-projects.io/dotnet/maui/uraniumui"
x:Class="LMKitMaestro.UI.ChatPage"
x:DataType="vm:ChatPageViewModel"
Expand Down Expand Up @@ -44,7 +43,7 @@
<Button
Margin="12, 0"
Style="{StaticResource SidebarToggleButtonStyle}"
Text="{x:Static icons:MaterialRegular.Settings}"
Text="{StaticResource Gear}"
Command="{Binding ToggleSettingsSidebarCommand}"
HorizontalOptions="End"
Grid.Column="2"/>
Expand Down Expand Up @@ -90,7 +89,7 @@

<Button
Style="{StaticResource SidebarToggleButtonStyle}"
Text="{x:Static icons:MaterialRegular.Forum}"
Text="{StaticResource Comments}"
Command="{Binding ToggleChatsSidebarCommand}"
HorizontalOptions="Start"/>

Expand All @@ -105,8 +104,8 @@
ToolTipProperties.Text="Start a new chat"
Style="{StaticResource SecondaryActionButtonStyle}"
Grid.Column="2"
FontFamily="MaterialRegular"
Text="{x:Static icons:MaterialRegular.Add}"
FontFamily="FASolid"
Text="{StaticResource Plus}"
Command="{Binding StartNewConversationCommand}"/>
</Grid>

Expand Down Expand Up @@ -136,7 +135,7 @@
HorizontalOptions="Start"
ToolTipProperties.Text="Reset default settings"
Style="{StaticResource SecondaryActionButtonStyle}"
Text="{x:Static icons:MaterialRegular.Restart_alt}"
Text="{StaticResource ArrowRotateLeft}"
Command="{Binding SettingsViewModel.ResetDefaultValuesCommand}" />

<Label
Expand All @@ -148,7 +147,7 @@
<Button
Grid.Column="2"
Style="{StaticResource SidebarToggleButtonStyle}"
Text="{x:Static icons:MaterialRegular.Settings}"
Text="{StaticResource Gear}"
Command="{Binding Source={RelativeSource AncestorType={x:Type vm:ChatPageViewModel}}, Path=ToggleSettingsSidebarCommand}"/>
</Grid>
</Grid>
Expand Down
Loading

0 comments on commit 03f0940

Please sign in to comment.