-
-
Notifications
You must be signed in to change notification settings - Fork 158
Add flat proportional dock presentation #1103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
204a6ed
Update Avalonia and diagnostics tooling
wieslawsoltes 0b369cd
Add flat proportional dock presentation
wieslawsoltes f72cb19
Add Fluent flat dock theme
wieslawsoltes 866c944
Cover flat dock presentation
wieslawsoltes edf48d5
Add ReactiveUI flat dock sample
wieslawsoltes ad9c6c4
Smooth flat dock panel animations
wieslawsoltes 1d1dde8
Refine flat dock target motion
wieslawsoltes 9ec14e4
Enable docking defaults in flat sample
wieslawsoltes f36f923
Stabilize flat panel animation tests
wieslawsoltes d1bccb0
Add reusable flat controls package
wieslawsoltes fa1f1ae
Wire flat controls into Dock Avalonia
wieslawsoltes 2153d17
Address flat panel review feedback
wieslawsoltes 4347f75
Stabilize flat panel transition tests
wieslawsoltes 411b24a
Avoid max clamp on unbounded flat measure
wieslawsoltes 920a847
Use condition waits in flat transition tests
wieslawsoltes a37c9f9
Prune flat dock adapter cache
wieslawsoltes 29c5571
Stabilize pending insert transition test
wieslawsoltes d0218a8
Remove timing checkpoint from retarget transition test
wieslawsoltes 2aef0cf
Preserve flat dock proportions during collapse
wieslawsoltes a70f0d2
Merge flat dock controls into Simple theme
wieslawsoltes 655e1df
Use temporary flat proportions for unsafe layout
wieslawsoltes 0881cf2
Guard flat zero proportions on unbounded measure
wieslawsoltes 0cb025e
Move flat sample theme controls to view model
wieslawsoltes 655c683
Redistribute constrained flat proportions
wieslawsoltes d2148c7
Compute flat desired length from proportions
wieslawsoltes a95f53a
Preserve flat minimum budgets
wieslawsoltes 6ed4455
Fix flat dock target discovery and preview startup
wieslawsoltes 407adc8
Fix tab drag-out bounds refresh
wieslawsoltes 0410b04
Collapse empty flat dock branches
wieslawsoltes 50245ce
Harden flat panel transitions and bindings
wieslawsoltes f642af1
Preserve splitters across collapsed siblings
wieslawsoltes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <ItemGroup> | ||
| <PackageReference Include="Avalonia.Diagnostics" Condition="'$(Configuration)' == 'Debug'" /> | ||
| <PackageReference Include="ProDiagnostics" Condition="'$(Configuration)' == 'Debug'" /> | ||
| </ItemGroup> | ||
| </Project> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| <Application xmlns="https://github.com/avaloniaui" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:local="using:DockReactiveUIFlatSample" | ||
| xmlns:core="using:Dock.Model.Core" | ||
| Name="Dock Avalonia Demo" | ||
| x:CompileBindings="True" | ||
| x:Class="DockReactiveUIFlatSample.App"> | ||
|
|
||
| <Application.DataTemplates> | ||
| <local:ViewLocator /> | ||
| </Application.DataTemplates> | ||
|
|
||
| <Application.Resources> | ||
|
|
||
| <ResourceDictionary> | ||
| <ResourceDictionary.MergedDictionaries> | ||
|
|
||
| <ResourceInclude Source="avares://Dock.Avalonia.Themes.Fluent/Presets/Ide/Default.axaml" /> | ||
|
|
||
| <ResourceDictionary> | ||
| <ControlRecycling x:Key="ControlRecyclingKey" /> | ||
| </ResourceDictionary> | ||
|
|
||
| <ResourceDictionary> | ||
| <ResourceDictionary.ThemeDictionaries> | ||
| <ResourceDictionary x:Key='Default'> | ||
| <Color x:Key="RegionColor">#FFFAFAFA</Color> | ||
| <Color x:Key="AcrylicFallbackColor">#E2E2E2</Color> | ||
| </ResourceDictionary> | ||
| <ResourceDictionary x:Key='Dark'> | ||
| <Color x:Key="RegionColor">#FF212121</Color> | ||
| <Color x:Key="AcrylicFallbackColor">#1F1F1F</Color> | ||
| </ResourceDictionary> | ||
| </ResourceDictionary.ThemeDictionaries> | ||
| </ResourceDictionary> | ||
| </ResourceDictionary.MergedDictionaries> | ||
|
|
||
| </ResourceDictionary> | ||
|
|
||
| </Application.Resources> | ||
|
|
||
| <Application.Styles> | ||
|
|
||
| <FluentTheme /> | ||
|
|
||
| <DockFluentFlatTheme /> | ||
|
|
||
| <Style Selector="DockControl"> | ||
| <Setter Property="(ControlRecyclingDataTemplate.ControlRecycling)" Value="{StaticResource ControlRecyclingKey}" /> | ||
| </Style> | ||
|
|
||
| <Style Selector="DocumentControl"> | ||
| <Setter Property="HeaderTemplate"> | ||
| <DataTemplate DataType="core:IDockable" x:DataType="core:IDockable"> | ||
| <StackPanel Orientation="Horizontal"> | ||
| <PathIcon | ||
| Data="M5 1C3.89543 1 3 1.89543 3 3V13C3 14.1046 3.89543 15 5 15H11C12.1046 15 13 14.1046 13 13V5.41421C13 5.01639 12.842 4.63486 12.5607 4.35355L9.64645 1.43934C9.36514 1.15804 8.98361 1 8.58579 1H5ZM4 3C4 2.44772 4.44772 2 5 2H8V4.5C8 5.32843 8.67157 6 9.5 6H12V13C12 13.5523 11.5523 14 11 14H5C4.44772 14 4 13.5523 4 13V3ZM11.7929 5H9.5C9.22386 5 9 4.77614 9 4.5V2.20711L11.7929 5Z" | ||
| Width="16" | ||
| Height="16" | ||
| Margin="0" /> | ||
| <TextBlock Text="{CompiledBinding Title}" | ||
| VerticalAlignment="Center" | ||
| Padding="4,0,0,0" /> | ||
| </StackPanel> | ||
| </DataTemplate> | ||
| </Setter> | ||
| </Style> | ||
|
|
||
| <Style Selector="ToolControl"> | ||
| <Setter Property="HeaderTemplate"> | ||
| <DataTemplate DataType="core:IDockable" x:DataType="core:IDockable"> | ||
| <TextBlock Text="{CompiledBinding Title}" Padding="2" /> | ||
| </DataTemplate> | ||
| </Setter> | ||
| </Style> | ||
|
|
||
| <Style Selector="ToolChromeControl"> | ||
| <Setter Property="Background" Value="Transparent" /> | ||
| </Style> | ||
|
|
||
| </Application.Styles> | ||
|
|
||
| </Application> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using Avalonia; | ||
| using Avalonia.Controls.ApplicationLifetimes; | ||
| #if DEBUG | ||
| using Avalonia.Diagnostics; | ||
| #endif | ||
| using Avalonia.Input; | ||
| using Avalonia.Markup.Xaml; | ||
| using Dock.Avalonia.Diagnostics.Controls; | ||
| using Dock.Avalonia.Diagnostics; | ||
| using Dock.Avalonia.Themes; | ||
| using Dock.Avalonia.Themes.Fluent; | ||
| using DockReactiveUIFlatSample.Services; | ||
| using DockReactiveUIFlatSample.ViewModels; | ||
| using DockReactiveUIFlatSample.Views; | ||
|
|
||
| namespace DockReactiveUIFlatSample; | ||
|
|
||
| [RequiresUnreferencedCode("Requires unreferenced code for MainWindowViewModel.")] | ||
| [RequiresDynamicCode("Requires unreferenced code for MainWindowViewModel.")] | ||
| public partial class App : Application | ||
| { | ||
| public static IDockThemeManager? ThemeManager; | ||
|
|
||
| public override void Initialize() | ||
| { | ||
| ThemeManager = new DockFluentThemeManager(); | ||
| #if DOCK_USE_GENERATED_APP_INITIALIZE_COMPONENT | ||
| InitializeComponent(); | ||
| #else | ||
| AvaloniaXamlLoader.Load(this); | ||
| #endif | ||
| } | ||
|
|
||
| public override void OnFrameworkInitializationCompleted() | ||
| { | ||
| // DockManager.s_enableSplitToWindow = true; | ||
|
|
||
| var themeService = ThemeManager is null ? null : new DockThemeService(ThemeManager); | ||
| var mainWindowViewModel = new MainWindowViewModel(themeService); | ||
|
|
||
| switch (ApplicationLifetime) | ||
| { | ||
| case IClassicDesktopStyleApplicationLifetime desktopLifetime: | ||
| { | ||
| var mainWindow = new MainWindow | ||
| { | ||
| DataContext = mainWindowViewModel | ||
| }; | ||
| #if DEBUG | ||
| mainWindow.AttachDockDebug( | ||
| () => mainWindowViewModel.Layout!, | ||
| new KeyGesture(Key.F11)); | ||
| mainWindow.AttachDockDebugOverlay(new KeyGesture(Key.F9)); | ||
| #endif | ||
| mainWindow.Closing += (_, _) => | ||
| { | ||
| mainWindowViewModel.CloseLayout(); | ||
| }; | ||
|
|
||
| desktopLifetime.MainWindow = mainWindow; | ||
|
|
||
| desktopLifetime.Exit += (_, _) => | ||
| { | ||
| mainWindowViewModel.CloseLayout(); | ||
| }; | ||
|
|
||
| break; | ||
| } | ||
| case ISingleViewApplicationLifetime singleViewLifetime: | ||
| { | ||
| var mainView = new MainView() | ||
| { | ||
| DataContext = mainWindowViewModel | ||
| }; | ||
|
|
||
| singleViewLifetime.MainView = mainView; | ||
|
|
||
| break; | ||
| } | ||
| } | ||
|
|
||
| base.OnFrameworkInitializationCompleted(); | ||
|
|
||
| #if DEBUG | ||
| this.AttachDevTools(); | ||
| #endif | ||
| } | ||
| } |
42 changes: 42 additions & 0 deletions
42
samples/DockReactiveUIFlatSample/DockReactiveUIFlatSample.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
| <OutputType>WinExe</OutputType> | ||
| <GenerateAssemblyInfo>False</GenerateAssemblyInfo> | ||
| <IsPackable>False</IsPackable> | ||
| <Nullable>enable</Nullable> | ||
| <AvaloniaNameGeneratorBehavior>InitializeComponent</AvaloniaNameGeneratorBehavior> | ||
| <DockEnableGeneratedAppInitializeComponent>true</DockEnableGeneratedAppInitializeComponent> | ||
| <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> | ||
| <CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GeneratedFiles</CompilerGeneratedFilesOutputPath> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <PublishAot>true</PublishAot> | ||
| </PropertyGroup> | ||
|
|
||
| <Import Project="..\..\build\ReferenceAssemblies.props" /> | ||
| <Import Project="..\..\build\Avalonia.props" /> | ||
| <Import Project="..\..\build\Avalonia.Themes.Fluent.props" /> | ||
| <Import Project="..\..\build\Avalonia.Desktop.props" /> | ||
| <Import Project="..\..\build\Avalonia.Diagnostics.props" /> | ||
| <Import Project="..\..\build\Avalonia.ReactiveUI.props" /> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="StaticViewLocator"> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
| </PackageReference> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\..\src\Dock.Model.ReactiveUI\Dock.Model.ReactiveUI.csproj" /> | ||
| <ProjectReference Include="..\..\src\Dock.Model\Dock.Model.csproj" /> | ||
| <ProjectReference Include="..\..\src\Dock.Avalonia\Dock.Avalonia.csproj" /> | ||
| <ProjectReference Include="..\..\src\Dock.Avalonia.Diagnostics\Dock.Avalonia.Diagnostics.csproj" /> | ||
| <ProjectReference Include="..\..\src\Dock.Avalonia.Themes.Fluent\Dock.Avalonia.Themes.Fluent.csproj" /> | ||
| <ProjectReference Include="..\..\src\Dock.Serializer.Newtonsoft\Dock.Serializer.Newtonsoft.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| | ||
| namespace DockReactiveUIFlatSample.Models; | ||
|
|
||
| public class DemoData | ||
| { | ||
| } |
6 changes: 6 additions & 0 deletions
6
samples/DockReactiveUIFlatSample/Models/Documents/DemoDocument.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| | ||
| namespace DockReactiveUIFlatSample.Models.Documents; | ||
|
|
||
| public class DemoDocument | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| | ||
| namespace DockReactiveUIFlatSample.Models.Tools; | ||
|
|
||
| public class Tool1 | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| | ||
| namespace DockReactiveUIFlatSample.Models.Tools; | ||
|
|
||
| public class Tool2 | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| | ||
| namespace DockReactiveUIFlatSample.Models.Tools; | ||
|
|
||
| public class Tool3 | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| | ||
| namespace DockReactiveUIFlatSample.Models.Tools; | ||
|
|
||
| public class Tool4 | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| | ||
| namespace DockReactiveUIFlatSample.Models.Tools; | ||
|
|
||
| public class Tool5 | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| | ||
| namespace DockReactiveUIFlatSample.Models.Tools; | ||
|
|
||
| public class Tool6 | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| | ||
| namespace DockReactiveUIFlatSample.Models.Tools; | ||
|
|
||
| public class Tool7 | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| | ||
| namespace DockReactiveUIFlatSample.Models.Tools; | ||
|
|
||
| public class Tool8 | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // Copyright (c) Wiesław Šoltés. All rights reserved. | ||
| // Licensed under the MIT license. See LICENSE file in the project root for details. | ||
| using Avalonia; | ||
| using ReactiveUI.Avalonia; | ||
| using System; | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using Dock.Settings; | ||
|
|
||
| namespace DockReactiveUIFlatSample; | ||
|
|
||
| [RequiresUnreferencedCode("Requires unreferenced code for App.")] | ||
| [RequiresDynamicCode("Requires unreferenced code for App.")] | ||
| internal class Program | ||
| { | ||
| [STAThread] | ||
| private static void Main(string[] args) | ||
| { | ||
| BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); | ||
| } | ||
|
|
||
| public static AppBuilder BuildAvaloniaApp() | ||
| => AppBuilder.Configure<App>() | ||
| .UsePlatformDetect() | ||
| .WithInterFont() | ||
| .UseReactiveUI() | ||
| .ShowDockablePreviewOnDrag() | ||
| .SetDragPreviewOpacity(0.6) | ||
| // .UseManagedWindows() | ||
| .LogToTrace(); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.