-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #329 from BAndysc/host_windows
Fixes to floating host windows
- Loading branch information
Showing
15 changed files
with
264 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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,24 @@ | ||
using System; | ||
using System.Globalization; | ||
using Avalonia.Data.Converters; | ||
|
||
namespace Dock.Avalonia.Converters; | ||
|
||
internal class IntLessThanConverter : IValueConverter | ||
{ | ||
public int TrueIfLessThan { get; set; } | ||
|
||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) | ||
{ | ||
if (value is int intValue) | ||
{ | ||
return intValue < TrueIfLessThan; | ||
} | ||
return false; | ||
} | ||
|
||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
This file contains 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 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,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Avalonia.Controls; | ||
using Avalonia.VisualTree; | ||
using Dock.Avalonia.Controls; | ||
using Dock.Model.Core; | ||
|
||
namespace Dock.Avalonia.Internal; | ||
|
||
internal static class Extensions | ||
{ | ||
public static IEnumerable<DockControl> GetZOrderedDockControls(this IList<IDockControl> dockControls) | ||
{ | ||
// Note: we should traverse the dock controls in their windows' z-order. | ||
// However there is no way to get the z-order of a window in Avalonia. | ||
// Uncomment once this PR is merged and a new Avalonia version is released | ||
// https://github.com/AvaloniaUI/Avalonia/pull/14909 | ||
// return dockControls | ||
// .OfType<DockControl>() | ||
// .Select(dock => (dock, order: (dock.GetVisualRoot() as Window)?.WindowZOrder ?? IntPtr.Zero)) | ||
// .OrderByDescending(x => x.order) | ||
// .Select(pair => pair.dock); | ||
|
||
// For now, as a workaround, iterating in the reverse order of the dock controls is better then the regular order, | ||
// because the main window dock control is always at index 0 and all the other windows are always | ||
// on top of the main window. | ||
return dockControls | ||
.OfType<DockControl>() | ||
.Reverse(); | ||
} | ||
} |
Oops, something went wrong.