Skip to content

Commit

Permalink
Editing launchsettings config, tweaking icon fonts to fix resulting i…
Browse files Browse the repository at this point in the history
…ssues (#25)

Co-authored-by: Loïc Carrère <[email protected]>
  • Loading branch information
BeepBeepBopBop and lcarrere authored Nov 24, 2024
1 parent a223b14 commit ea0c6c3
Show file tree
Hide file tree
Showing 24 changed files with 3,699 additions and 1,509 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ LM-Kit-Maestro/obj
*.user
/tests/bin
/tests/obj
/.idea
3 changes: 2 additions & 1 deletion LM-Kit-Maestro/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary x:Name="colors" Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
<ResourceDictionary Source="Resources/Styles/Icons.xaml"/>
<ResourceDictionary Source="Resources/Styles/MaterialIcons.xaml"/>
<ResourceDictionary Source="Resources/Styles/FontAwesome.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Expand Down
2 changes: 2 additions & 0 deletions LM-Kit-Maestro/AppConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ internal static class AppConstants

public const double ChatPageToggleButtonWidth = 32;

public const double IconFontSize = 16;

#if BETA_DOWNLOAD_MODELS
//LM-Kit models catalog: https://huggingface.co/lm-kit
public static readonly ModelInfo[] AvailableModels =
Expand Down
10 changes: 7 additions & 3 deletions LM-Kit-Maestro/LM-Kit-Maestro.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<EnableDefaultCssItems>false</EnableDefaultCssItems>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<WindowsPackageType>None</WindowsPackageType>
<AssemblyName>Maestro</AssemblyName>
<OutputName>Maestro</OutputName>

Expand All @@ -33,9 +33,9 @@
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>

Expand All @@ -56,6 +56,10 @@
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<!--<ItemGroup>
<MauiFont Include="Resources\Fonts\Font Awesome 6 Free-Solid-900.otf" Alias="Material" />
</ItemGroup>-->

<ItemGroup>
<MauiCss Include="wwwroot\css\font-awesome.css" />
<MauiCss Include="wwwroot\css\font-awesome.min.css" />
Expand Down
60 changes: 31 additions & 29 deletions LM-Kit-Maestro/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ public static MauiApp CreateMauiApp()
fonts.AddFont("Segoe UI.ttf", "Segoe");
fonts.AddFont("Segoe UI Bold.ttf", "SegoeBold");

fonts.AddFont("MaterialIcons-Regular.ttf", "Material");

//fonts.AddFont("FontAkwesome.ttf", "Material");
// FontAwesome
fonts.AddFont("Font Awesome 6 Free-Regular-400.otf", "FARegular");
fonts.AddFont("Font Awesome 6 Free-Solid-900.otf", "FASolid");
//fonts.AddFont("Font Awesome 6 Free-Regular-400.otf", "FARegular");
})
.ConfigureMauiHandlers(handlers =>
{
handlers.AddCustomHandlers();
});
.ConfigureMauiHandlers(handlers => { handlers.AddCustomHandlers(); });

builder.Services.AddMauiBlazorWebView();
builder.Services.AddJsInteropExtensions();
Expand Down Expand Up @@ -97,10 +96,13 @@ private static void RegisterServices(this MauiAppBuilder builder)
builder.Services.AddSingleton<Services.ILauncher, Services.Launcher>();
builder.Services.AddSingleton<INavigationService, NavigationService>();
builder.Services.AddSingleton<IMainThread, Services.MainThread>();
builder.Services.AddSingleton<CommunityToolkit.Maui.Core.IPopupService, CommunityToolkit.Maui.PopupService>();
builder.Services
.AddSingleton<CommunityToolkit.Maui.Core.IPopupService, CommunityToolkit.Maui.PopupService>();

#if WINDOWS
builder.Services.AddSingleton<IFolderPicker, WinUI.FolderPicker>();
#elif MACCATALYST
builder.Services.AddSingleton<IFolderPicker, LMKit.Maestro.MacFolderPicker>();
#endif

builder.Services.AddSingleton(Preferences.Default);
Expand All @@ -120,30 +122,30 @@ private static void OnUnhandledException(object sender, UnhandledExceptionEventA
public static void ConfigureLogger(this MauiAppBuilder builder)
{
builder.Logging
.AddTraceLogger(
options =>
{
options.MinLevel = LogLevel.Trace;
options.MaxLevel = LogLevel.Critical;
}) // Will write to the Debug Output
.AddInMemoryLogger(
options =>
{
options.MaxLines = 1024;
options.MinLevel = LogLevel.Debug;
options.MaxLevel = LogLevel.Critical;
})
.AddStreamingFileLogger(
options =>
{
options.RetainDays = 2;
options.FolderPath = Path.Combine(
FileSystem.CacheDirectory,
"MetroLogs");
});
.AddTraceLogger(
options =>
{
options.MinLevel = LogLevel.Trace;
options.MaxLevel = LogLevel.Critical;
}) // Will write to the Debug Output
.AddInMemoryLogger(
options =>
{
options.MaxLines = 1024;
options.MinLevel = LogLevel.Debug;
options.MaxLevel = LogLevel.Critical;
})
.AddStreamingFileLogger(
options =>
{
options.RetainDays = 2;
options.FolderPath = Path.Combine(
FileSystem.CacheDirectory,
"MetroLogs");
});

var path = FileSystem.CacheDirectory;
builder.Services.AddSingleton(LogOperatorRetriever.Instance);
}
}
}
}
11 changes: 11 additions & 0 deletions LM-Kit-Maestro/Platforms/MacCatalyst/MacFolderPicker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using LMKit.Maestro.Services;

namespace LMKit.Maestro;

public class MacFolderPicker : IFolderPicker
{
public Task<FolderPickerResult> PickAsync(string initialPath, CancellationToken cancellationToken = default)
{
return Task.FromResult(new FolderPickerResult(false, null, null));
}
}
2 changes: 1 addition & 1 deletion LM-Kit-Maestro/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"profiles": {
"Windows Machine": {
"commandName": "MsixPackage",
"commandName": "Project",
"nativeDebugging": false
}
}
Expand Down
Binary file not shown.
Binary file added LM-Kit-Maestro/Resources/Fonts/FontAwesome.ttf
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit ea0c6c3

Please sign in to comment.