mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 11:26:31 +00:00
rework to floating window on the top
TODO: keys
This commit is contained in:
@@ -4,12 +4,19 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Azaion Оператор" Height="450" Width="800">
|
Title="Azaion Оператор" Height="100" Width="200"
|
||||||
<Grid Background="Black">
|
WindowStyle="None"
|
||||||
<TabControl Name="MainTabControl"
|
ResizeMode="NoResize"
|
||||||
TabStripPlacement="Left"
|
Top="0"
|
||||||
Margin="0, 0, 0, 10"
|
Topmost="True"
|
||||||
Background="Black">
|
>
|
||||||
</TabControl>
|
<Grid>
|
||||||
|
<ListView Name="ListView" Background="Black" BorderBrush="Black">
|
||||||
|
<ListView.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<StackPanel Orientation="Horizontal" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ListView.ItemsPanel>
|
||||||
|
</ListView>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ using System.Windows.Media;
|
|||||||
using Azaion.Annotator.Extensions;
|
using Azaion.Annotator.Extensions;
|
||||||
using Azaion.Common.DTO;
|
using Azaion.Common.DTO;
|
||||||
using Azaion.Common.DTO.Config;
|
using Azaion.Common.DTO.Config;
|
||||||
using Azaion.Dataset;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using SharpVectors.Converters;
|
using SharpVectors.Converters;
|
||||||
@@ -34,6 +33,7 @@ public partial class MainSuite
|
|||||||
SizeChanged += async (_, _) => await SaveUserSettings();
|
SizeChanged += async (_, _) => await SaveUserSettings();
|
||||||
LocationChanged += async (_, _) => await SaveUserSettings();
|
LocationChanged += async (_, _) => await SaveUserSettings();
|
||||||
StateChanged += async (_, _) => await SaveUserSettings();
|
StateChanged += async (_, _) => await SaveUserSettings();
|
||||||
|
Left = SystemParameters.WorkArea.Width - Width - 150;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnLoaded(object sender, RoutedEventArgs e)
|
private void OnLoaded(object sender, RoutedEventArgs e)
|
||||||
@@ -45,47 +45,40 @@ public partial class MainSuite
|
|||||||
if (!Directory.Exists(_appConfig.DirectoriesConfig.ResultsDirectory))
|
if (!Directory.Exists(_appConfig.DirectoriesConfig.ResultsDirectory))
|
||||||
Directory.CreateDirectory(_appConfig.DirectoriesConfig.ResultsDirectory);
|
Directory.CreateDirectory(_appConfig.DirectoriesConfig.ResultsDirectory);
|
||||||
|
|
||||||
|
|
||||||
Left = _appConfig.WindowConfig.WindowLocation.X;
|
|
||||||
Top = _appConfig.WindowConfig.WindowLocation.Y;
|
|
||||||
Width = _appConfig.WindowConfig.WindowSize.Width;
|
|
||||||
Height = _appConfig.WindowConfig.WindowSize.Height;
|
|
||||||
|
|
||||||
if (_appConfig.WindowConfig.FullScreen)
|
|
||||||
WindowState = WindowState.Maximized;
|
|
||||||
|
|
||||||
foreach (var azaionModule in _modules)
|
foreach (var azaionModule in _modules)
|
||||||
{
|
{
|
||||||
var window = (_sp.GetRequiredService(azaionModule.MainWindowType) as Window)!;
|
var lvItem = new ListViewItem
|
||||||
window.Height = 0;
|
{
|
||||||
window.Width = 0;
|
Content = new StackPanel { Children =
|
||||||
window.Show();
|
{
|
||||||
window.Hide();
|
new SvgViewbox
|
||||||
_openedWindows.Add(window);
|
|
||||||
var icon = new SvgViewbox
|
|
||||||
{
|
{
|
||||||
SvgSource = azaionModule.SvgIcon,
|
SvgSource = azaionModule.SvgIcon,
|
||||||
Width = 32,
|
Width = 32,
|
||||||
Height = 32,
|
Height = 32,
|
||||||
Margin = new Thickness(0, 0, 10, 0)
|
Margin = new Thickness(0, 0, 10, 0)
|
||||||
};
|
},
|
||||||
var text = new TextBlock
|
new TextBlock
|
||||||
{
|
{
|
||||||
Text = azaionModule.Name,
|
Text = azaionModule.Name,
|
||||||
Foreground = Brushes.White,
|
Foreground = Brushes.White,
|
||||||
HorizontalAlignment = HorizontalAlignment.Center,
|
HorizontalAlignment = HorizontalAlignment.Center,
|
||||||
Background = Brushes.Black
|
Background = Brushes.Black
|
||||||
};
|
}
|
||||||
var tabItem = new TabItem
|
} },
|
||||||
{
|
|
||||||
Header = new StackPanel { Children = { icon, text } },
|
|
||||||
Content = window.Content,
|
|
||||||
Background = Brushes.Black,
|
Background = Brushes.Black,
|
||||||
Foreground = Brushes.White,
|
Foreground = Brushes.White,
|
||||||
Cursor = Cursors.Hand,
|
Cursor = Cursors.Hand,
|
||||||
Tag = azaionModule.WindowEnum
|
Tag = azaionModule
|
||||||
};
|
};
|
||||||
MainTabControl.Items.Add(tabItem);
|
lvItem.MouseUp += (sender, _) =>
|
||||||
|
{
|
||||||
|
var module = ((sender as ListViewItem)!.Tag as IAzaionModule)!;
|
||||||
|
var window = (_sp.GetRequiredService(module.MainWindowType) as Window)!;
|
||||||
|
_openedWindows.Add(window);
|
||||||
|
window.Show();
|
||||||
|
};
|
||||||
|
ListView.Items.Add(lvItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user