Skip to content

Commit

Permalink
Revert "adding CustomEditor control, removing plainer package reference"
Browse files Browse the repository at this point in the history
This reverts commit 5348a24.
  • Loading branch information
BeepBeepBopBop committed Nov 22, 2024
1 parent 5348a24 commit 9bc7892
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 98 deletions.
5 changes: 0 additions & 5 deletions LM-Kit-Maestro/Controls/CustomEditor.cs

This file was deleted.

27 changes: 14 additions & 13 deletions LM-Kit-Maestro/Controls/CustomEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,29 @@
using Windows.System;
#endif

namespace LMKitMaestro.Controls;

class CustomEntry : Entry
namespace LMKitMaestro.Controls
{
protected override void OnHandlerChanged()
class CustomEntry : Entry
{
base.OnHandlerChanged();
protected override void OnHandlerChanged()
{
base.OnHandlerChanged();

#if WINDOWS
TextBox textBox = (TextBox)Handler!.PlatformView!;
TextBox textBox = (TextBox)Handler!.PlatformView!;

textBox.KeyDown += OnKeyDown;
textBox.KeyDown += OnKeyDown;
#endif
}
}

#if WINDOWS
private void OnKeyDown(object sender, Microsoft.UI.Xaml.Input.KeyRoutedEventArgs e)
{
if (e.Key == VirtualKey.Enter)
private void OnKeyDown(object sender, Microsoft.UI.Xaml.Input.KeyRoutedEventArgs e)
{
Unfocus();
if (e.Key == VirtualKey.Enter)
{
Unfocus();
}
}
}
#endif
}
}
69 changes: 0 additions & 69 deletions LM-Kit-Maestro/Handlers/CustomEditorHandler.cs

This file was deleted.

1 change: 0 additions & 1 deletion LM-Kit-Maestro/Handlers/MauiHandlerCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public static class MauiHandlerCollectionExtensions
public static IMauiHandlersCollection AddCustomHandlers(this IMauiHandlersCollection handlers)
{
handlers.AddHandler(typeof(CustomEntry), typeof(CustomEntryHandler));
handlers.AddHandler(typeof(CustomEditor), typeof(CustomEditorHandler));
handlers.AddHandler(typeof(StatefulContentView), typeof(StatefulContentViewHandler));

return handlers;
Expand Down
1 change: 1 addition & 0 deletions LM-Kit-Maestro/LM-Kit-Maestro.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
<PackageReference Include="MetroLog.Maui" Version="2.1.0" />
<PackageReference Include="Mopups" Version="1.3.2" />
<PackageReference Include="Plainer.Maui" Version="1.7.1" />
<PackageReference Include="SimpleToolkit.Core" Version="5.1.2" />
<PackageReference Include="SimpleToolkit.SimpleShell" Version="4.1.3" />
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
Expand Down
2 changes: 2 additions & 0 deletions LM-Kit-Maestro/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using LMKitMaestro.ViewModels;
using LMKitMaestro.Services;
using LMKitMaestro.Data;
using Plainer.Maui;
using SimpleToolkit.SimpleShell;
using LMKitMaestro.Handlers;
using MetroLog.MicrosoftExtensions;
Expand Down Expand Up @@ -46,6 +47,7 @@ public static MauiApp CreateMauiApp()
.ConfigureMauiHandlers(handlers =>
{
handlers.AddCustomHandlers();
handlers.AddPlainer();
});

builder.Services.AddMauiBlazorWebView();
Expand Down
1 change: 1 addition & 0 deletions LM-Kit-Maestro/UI/ChatConversationsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:vm="clr-namespace:LMKitMaestro.ViewModels"
xmlns:controls="clr-namespace:LMKitMaestro.Controls"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:plainer="clr-namespace:Plainer.Maui.Controls;assembly=Plainer.Maui"
x:DataType="vm:ChatPageViewModel"
x:Class="LMKitMaestro.UI.ChatConversationsView"
x:Name="chatConversationsView"
Expand Down
19 changes: 10 additions & 9 deletions LM-Kit-Maestro/UI/ChatSettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
xmlns:vm="clr-namespace:LMKitMaestro.ViewModels"
xmlns:services="clr-namespace:LMKitMaestro.Services"
xmlns:controls="clr-namespace:LMKitMaestro.Controls"
xmlns:plainer="clr-namespace:Plainer.Maui.Controls;assembly=Plainer.Maui"
xmlns:local="clr-namespace:LMKitMaestro"
x:DataType="vm:SettingsViewModel"
x:Name="chatSettingsView"
Expand Down Expand Up @@ -187,13 +188,13 @@
<Grid StyleClass="SettingGrid">
<Label VerticalOptions="Center" Text="System prompt"/>
<Border
x:Name="systemPromptBorder"
StrokeThickness="0.25"
StrokeShape="RoundRectangle 4"
Padding="0, 8"
Grid.ColumnSpan="2"
Grid.Row="1"
HeightRequest="120">
x:Name="systemPromptBorder"
StrokeThickness="0.25"
StrokeShape="RoundRectangle 4"
Padding="0, 8"
Grid.ColumnSpan="2"
Grid.Row="1"
HeightRequest="120">
<Border.Triggers>
<DataTrigger TargetType="Border" Binding="{Binding Source={x:Reference systemPromptBorder}, Path=IsFocused}" Value="True">
<Setter Property="Stroke" Value="{StaticResource OnSurface}"/>
Expand All @@ -203,7 +204,7 @@
</DataTrigger>
</Border.Triggers>

<controls:CustomEditor Unfocused="OnSystemPromptUnfocused" x:Name="systemPromptEditor" BackgroundColor="Transparent" Text="{Binding SystemPrompt, Mode=TwoWay}"/>
<plainer:EditorView Unfocused="OnSystemPromptUnfocused" x:Name="systemPromptEditor" BackgroundColor="Transparent" Text="{Binding SystemPrompt, Mode=TwoWay}"/>
</Border>
</Grid>

Expand All @@ -223,7 +224,7 @@
</DataTrigger>
</Border.Triggers>

<controls:CustomEntry
<plainer:EntryView
x:Name="maxCompletionTokensEntry"
Unfocused="OnMaxCompletionTokensEntryUnfocused"
Text="{Binding Source={x:Reference chatSettingsView}, Path=MaxCompletionTokensText, Mode=TwoWay}"
Expand Down
1 change: 1 addition & 0 deletions LM-Kit-Maestro/UI/ChatView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
xmlns:controls="clr-namespace:LMKitMaestro.Controls"
xmlns:converters="clr-namespace:LMKitMaestro.Converters"
xmlns:services="clr-namespace:LMKitMaestro.Services"
xmlns:plainer="clr-namespace:Plainer.Maui.Controls;assembly=Plainer.Maui"
x:Class="LMKitMaestro.UI.ChatView"
x:DataType="vm:ConversationViewModel"
IsEnabled="{Binding ., Converter={mct:IsNotNullConverter}}"
Expand Down
1 change: 1 addition & 0 deletions LM-Kit-Maestro/UI/ConversationListItemView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
xmlns:models="clr-namespace:LMKitMaestro.Models"
xmlns:vm="clr-namespace:LMKitMaestro.ViewModels"
xmlns:controls="clr-namespace:LMKitMaestro.Controls"
xmlns:plainer="clr-namespace:Plainer.Maui.Controls;assembly=Plainer.Maui"
x:DataType="vm:ConversationViewModel"
ToolTipProperties.Text="{Binding Title}"
x:Class="LMKitMaestro.UI.ConversationListItemView"
Expand Down
3 changes: 2 additions & 1 deletion LM-Kit-Maestro/UI/Pages/ModelsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:local="clr-namespace:LMKitMaestro"
xmlns:models="clr-namespace:LMKitMaestro.Models"
xmlns:vm="clr-namespace:LMKitMaestro.ViewModels"
xmlns:plainer="clr-namespace:Plainer.Maui.Controls;assembly=Plainer.Maui"
xmlns:converters="clr-namespace:LMKitMaestro.Converters"
x:DataType="vm:ModelsPageViewModel"
x:Class="LMKitMaestro.UI.ModelsPage"
Expand Down Expand Up @@ -266,7 +267,7 @@
BackgroundColor="Transparent"
Stroke="{StaticResource Surface4}">

<controls:CustomEntry VerticalOptions="End" IsReadOnly="True" Text="{Binding AppSettingsService.ModelsFolderPath}"/>
<plainer:EntryView VerticalOptions="End" IsReadOnly="True" Text="{Binding AppSettingsService.ModelsFolderPath}"/>
</Border>

<Button
Expand Down
1 change: 1 addition & 0 deletions LM-Kit-Maestro/UI/Popups/ChatConversationActionPopup.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:models="clr-namespace:LMKitMaestro.Models"
xmlns:vm="clr-namespace:LMKitMaestro.ViewModels"
xmlns:controls="clr-namespace:LMKitMaestro.Controls"
xmlns:plainer="clr-namespace:Plainer.Maui.Controls;assembly=Plainer.Maui"
x:DataType="vm:ChatConversationActionPopupViewModel"
x:Class="LMKitMaestro.UI.ChatConversationActionPopup">

Expand Down

0 comments on commit 9bc7892

Please sign in to comment.