mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
UI - Update Avalonia to preview7
UI - Update FluentAvalonia to preview7
This commit is contained in:
1 parent
b1e39dbd39
commit
c50a572363
82 files changed
+214
-208
No files matched your search
@@ -36,7 +36,7 @@
|
||||
<TextBox Name="SearchBox" Text="{CompiledBinding SearchText}" Margin="0 0 0 15" Watermark="Search"></TextBox>
|
||||
<TreeView Name="NodeTree"
|
||||
Grid.Row="1"
|
||||
Items="{CompiledBinding Categories}"
|
||||
ItemsSource="{CompiledBinding Categories}"
|
||||
IsVisible="{CompiledBinding Categories.Count}"
|
||||
SelectedItem="{CompiledBinding SelectedNode}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<ContentControl Content="{CompiledBinding DragViewModel}" ClipToBounds="False" />
|
||||
|
||||
<!-- Cables -->
|
||||
<ItemsControl Items="{CompiledBinding CableViewModels}" ClipToBounds="False">
|
||||
<ItemsControl ItemsSource="{CompiledBinding CableViewModels}" ClipToBounds="False">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<Canvas />
|
||||
@@ -71,7 +71,7 @@
|
||||
</ItemsControl>
|
||||
|
||||
<!-- Nodes -->
|
||||
<ItemsControl Name="NodesContainer" Items="{CompiledBinding NodeViewModels}" ClipToBounds="False">
|
||||
<ItemsControl Name="NodesContainer" ItemsSource="{CompiledBinding NodeViewModels}" ClipToBounds="False">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<Canvas />
|
||||
|
||||
@@ -293,22 +293,16 @@ public class NodeScriptViewModel : ActivatableViewModelBase
|
||||
|
||||
private async Task ExecuteCopySelected()
|
||||
{
|
||||
if (Application.Current?.Clipboard == null)
|
||||
return;
|
||||
|
||||
List<INode> nodes = NodeViewModels.Where(vm => vm.IsSelected).Select(vm => vm.Node).Where(n => !n.IsDefaultNode && !n.IsExitNode).ToList();
|
||||
DataObject dataObject = new();
|
||||
string copy = CoreJson.SerializeObject(new NodesClipboardModel(NodeScript, nodes), true);
|
||||
dataObject.Set(CLIPBOARD_DATA_FORMAT, copy);
|
||||
await Application.Current.Clipboard.SetDataObjectAsync(dataObject);
|
||||
await Shared.UI.Clipboard.SetDataObjectAsync(dataObject);
|
||||
}
|
||||
|
||||
private async Task ExecutePasteSelected()
|
||||
{
|
||||
if (Application.Current?.Clipboard == null)
|
||||
return;
|
||||
|
||||
byte[]? bytes = (byte[]?) await Application.Current.Clipboard.GetDataAsync(CLIPBOARD_DATA_FORMAT);
|
||||
byte[]? bytes = (byte[]?) await Shared.UI.Clipboard.GetDataAsync(CLIPBOARD_DATA_FORMAT);
|
||||
if (bytes == null!)
|
||||
return;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<Grid Margin="15" ColumnDefinitions="*,*" RowDefinitions="Auto,Auto,*">
|
||||
<Menu Grid.Row="0" Grid.ColumnSpan="2" VerticalAlignment="Top" Margin="-10 -10 -10 0">
|
||||
<MenuItem Header="_File">
|
||||
<MenuItem Header="Add Node" Items="{CompiledBinding Categories}">
|
||||
<MenuItem Header="Add Node" ItemsSource="{CompiledBinding Categories}">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="Plus" />
|
||||
</MenuItem.Icon>
|
||||
@@ -31,7 +31,7 @@
|
||||
<Style Selector="MenuItem > MenuItem > MenuItem">
|
||||
<Setter Property="Command" Value="{Binding CreateNode}" />
|
||||
<Setter Property="Header" Value="{Binding Header}" />
|
||||
<Setter Property="Items" Value="{Binding Items}" />
|
||||
<Setter Property="ItemsSource" Value="{Binding Items}" />
|
||||
</Style>
|
||||
</MenuItem.Styles>
|
||||
</MenuItem>
|
||||
|
||||
@@ -67,9 +67,9 @@ public class NodeScriptWindowViewModel : NodeScriptWindowViewModelBase
|
||||
{
|
||||
_keyBindingsEnabled = Shared.UI.KeyBindingsEnabled.ToProperty(this, vm => vm.KeyBindingsEnabled).DisposeWith(d);
|
||||
|
||||
DispatcherTimer updateTimer = new(TimeSpan.FromMilliseconds(25.0 / 1000), DispatcherPriority.Normal, Update);
|
||||
DispatcherTimer updateTimer = new(TimeSpan.FromMilliseconds(25.0 / 1000), DispatcherPriority.Background, Update);
|
||||
// TODO: Remove in favor of saving each time a node editor command is executed
|
||||
DispatcherTimer saveTimer = new(TimeSpan.FromMinutes(2), DispatcherPriority.Normal, Save);
|
||||
DispatcherTimer saveTimer = new(TimeSpan.FromMinutes(2), DispatcherPriority.Background, Save);
|
||||
|
||||
updateTimer.Start();
|
||||
saveTimer.Start();
|
||||
|
||||
@@ -75,8 +75,8 @@
|
||||
IsVisible="{CompiledBinding DisplayCustomViewModelAbove}" />
|
||||
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" IsVisible="{CompiledBinding HasInputPins}">
|
||||
<ItemsControl Items="{CompiledBinding InputPinViewModels}" Margin="4 0" />
|
||||
<ItemsControl Items="{CompiledBinding InputPinCollectionViewModels}" />
|
||||
<ItemsControl ItemsSource="{CompiledBinding InputPinViewModels}" Margin="4 0" />
|
||||
<ItemsControl ItemsSource="{CompiledBinding InputPinCollectionViewModels}" />
|
||||
</StackPanel>
|
||||
|
||||
<ContentControl Grid.Row="1"
|
||||
@@ -86,8 +86,8 @@
|
||||
IsVisible="{CompiledBinding DisplayCustomViewModelBetween}" />
|
||||
|
||||
<StackPanel Grid.Row="1" Grid.Column="2" IsVisible="{CompiledBinding HasOutputPins}">
|
||||
<ItemsControl Items="{CompiledBinding OutputPinViewModels}" Margin="4 0" />
|
||||
<ItemsControl Items="{CompiledBinding OutputPinCollectionViewModels}" />
|
||||
<ItemsControl ItemsSource="{CompiledBinding OutputPinViewModels}" Margin="4 0" />
|
||||
<ItemsControl ItemsSource="{CompiledBinding OutputPinCollectionViewModels}" />
|
||||
</StackPanel>
|
||||
|
||||
<ContentControl Grid.Row="2"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
Command="{CompiledBinding AddPin}">
|
||||
<avalonia:MaterialIcon Kind="Add"></avalonia:MaterialIcon>
|
||||
</Button>
|
||||
<ItemsControl Items="{CompiledBinding PinViewModels}" Margin="4 0">
|
||||
<ItemsControl ItemsSource="{CompiledBinding PinViewModels}" Margin="4 0">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="pins:PinViewModel">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
Command="{CompiledBinding AddPin}">
|
||||
<avalonia:MaterialIcon Kind="Add"></avalonia:MaterialIcon>
|
||||
</Button>
|
||||
<ItemsControl Items="{CompiledBinding PinViewModels}" Margin="4 0" HorizontalAlignment="Right">
|
||||
<ItemsControl ItemsSource="{CompiledBinding PinViewModels}" Margin="4 0" HorizontalAlignment="Right">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="pins:PinViewModel">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
|
||||
Reference in new issue
Block a user