Improved TabButton.

This commit is contained in:
Creeper Lv
2025-12-21 03:19:53 +11:00
parent ec2ac8f2b7
commit 40f35ddf63
7 changed files with 45 additions and 3 deletions

View File

@@ -5,7 +5,6 @@
RequestedThemeVariant="Default"> RequestedThemeVariant="Default">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. --> <!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
<Application.Styles> <Application.Styles>
<FluentTheme/> <FluentTheme/>
<!--<DevolutionsDevExpressTheme />--> <!--<DevolutionsDevExpressTheme />-->

View File

@@ -7,6 +7,7 @@ namespace Progrart.Controls.TabSystem;
public partial class TabButton : UserControl public partial class TabButton : UserControl
{ {
public string? Title { get => MainButton.Content as string; set => MainButton.Content = value; } public string? Title { get => MainButton.Content as string; set => MainButton.Content = value; }
public string? TooltipText { get => ToolTip.GetTip(MainButton) as string; set => ToolTip.SetTip(MainButton, value); }
public ITabPage page; public ITabPage page;
public TabHost Host; public TabHost Host;
public TabButton(ITabPage page, TabHost host) public TabButton(ITabPage page, TabHost host)

View File

@@ -25,6 +25,8 @@ public partial class EditorPage : UserControl, ITabPage, IEditorPage
if (file is not null) if (file is not null)
{ {
btn.Title = file.Name; btn.Title = file.Name;
var path = file.TryGetLocalPath();
btn.TooltipText = path;
} }
} }
@@ -43,6 +45,8 @@ public partial class EditorPage : UserControl, ITabPage, IEditorPage
if (btn is not null) if (btn is not null)
{ {
btn.Title = file.Name; btn.Title = file.Name;
var path= file.TryGetLocalPath();
btn.TooltipText= path;
} }
Task.Run(async () => Task.Run(async () =>
{ {

View File

@@ -0,0 +1,8 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Progrart.ProgrartEditorPage">
</UserControl>

View File

@@ -0,0 +1,13 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Progrart;
public partial class ProgrartEditorPage : UserControl
{
public ProgrartEditorPage()
{
InitializeComponent();
}
}

File diff suppressed because one or more lines are too long

View File

@@ -84,6 +84,10 @@ public partial class MainView : UserControl
FileContainer.Children.Add(new FileItem(folder)); FileContainer.Children.Add(new FileItem(folder));
} }
}; };
FileExplorerCloseButton.Click += (_, _) =>
{
LeftPanelToggle.IsChecked = false;
};
LeftPanelToggle.IsChecked = true; LeftPanelToggle.IsChecked = true;
} }
public void Write(string message) public void Write(string message)