1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2026-01-02 02:33:32 +00:00

Compare commits

...

2 Commits

10 changed files with 31 additions and 5 deletions

View File

@ -39,6 +39,11 @@ public interface INode : INotifyPropertyChanged, IBreakableModel, IPluginFeature
/// Gets a boolean indicating whether the node is a default node that connot be removed /// Gets a boolean indicating whether the node is a default node that connot be removed
/// </summary> /// </summary>
bool IsDefaultNode { get; } bool IsDefaultNode { get; }
/// <summary>
/// Gets a boolean indicating whether the node is currently loading, use this to disable pin type changes etc.
/// </summary>
bool IsLoading { get; set; }
/// <summary> /// <summary>
/// Gets or sets the X-position of the node /// Gets or sets the X-position of the node

View File

@ -46,6 +46,7 @@ public class NodeData
if (entity != null) if (entity != null)
{ {
node.IsLoading = true;
node.X = entity.X; node.X = entity.X;
node.Y = entity.Y; node.Y = entity.Y;
try try

View File

@ -206,6 +206,8 @@ public abstract class NodeScript : CorePropertyChanged, INodeScript
} }
LoadConnections(); LoadConnections();
foreach (INode node in Nodes)
node.IsLoading = false;
} }
internal void LoadFromEntity(NodeScriptEntity entity) internal void LoadFromEntity(NodeScriptEntity entity)
@ -216,6 +218,7 @@ public abstract class NodeScript : CorePropertyChanged, INodeScript
private void LoadExistingNode(INode node, NodeEntity nodeEntity) private void LoadExistingNode(INode node, NodeEntity nodeEntity)
{ {
node.IsLoading = true;
node.Id = nodeEntity.Id; node.Id = nodeEntity.Id;
node.X = nodeEntity.X; node.X = nodeEntity.X;
node.Y = nodeEntity.Y; node.Y = nodeEntity.Y;

View File

@ -92,6 +92,9 @@ public abstract class Node : BreakableModel, INode
/// <inheritdoc /> /// <inheritdoc />
public virtual bool IsDefaultNode => false; public virtual bool IsDefaultNode => false;
/// <inheritdoc />
public bool IsLoading { get; set; }
private readonly List<IPin> _pins = new(); private readonly List<IPin> _pins = new();
/// <inheritdoc /> /// <inheritdoc />

View File

@ -10,7 +10,7 @@
x:DataType="propertyInput:BrushPropertyInputViewModel"> x:DataType="propertyInput:BrushPropertyInputViewModel">
<UserControl.Styles> <UserControl.Styles>
<Style Selector="ComboBox.brush /template/ ContentControl#ContentPresenter"> <Style Selector="ComboBox.brush /template/ ContentPresenter#ContentPresenter">
<Setter Property="ContentTemplate"> <Setter Property="ContentTemplate">
<Setter.Value> <Setter.Value>
<DataTemplate DataType="{x:Type layerBrushes:LayerBrushDescriptor}"> <DataTemplate DataType="{x:Type layerBrushes:LayerBrushDescriptor}">

View File

@ -65,7 +65,7 @@
</StackPanel> </StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"> <StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Center">
<StackPanel.Styles> <StackPanel.Styles>
<Style Selector="ComboBox.layoutProvider /template/ ContentControl#ContentPresenter"> <Style Selector="ComboBox.layoutProvider /template/ ContentPresenter#ContentPresenter">
<Setter Property="ContentTemplate"> <Setter Property="ContentTemplate">
<Setter.Value> <Setter.Value>
<DataTemplate x:DataType="layoutProviders:ILayoutProviderViewModel"> <DataTemplate x:DataType="layoutProviders:ILayoutProviderViewModel">

View File

@ -17,7 +17,7 @@
</StackPanel> </StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Spacing="5"> <StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Spacing="5">
<StackPanel.Styles> <StackPanel.Styles>
<Style Selector="ComboBox.layoutProvider /template/ ContentControl#ContentPresenter"> <Style Selector="ComboBox.layoutProvider /template/ ContentPresenter#ContentPresenter">
<Setter Property="ContentTemplate"> <Setter Property="ContentTemplate">
<Setter.Value> <Setter.Value>
<DataTemplate x:DataType="models:InstalledEntry"> <DataTemplate x:DataType="models:InstalledEntry">

View File

@ -7,7 +7,7 @@
x:Class="Artemis.UI.Screens.ProfileEditor.DisplayCondition.DisplayConditionScriptView" x:Class="Artemis.UI.Screens.ProfileEditor.DisplayCondition.DisplayConditionScriptView"
x:DataType="displayCondition:DisplayConditionScriptViewModel"> x:DataType="displayCondition:DisplayConditionScriptViewModel">
<UserControl.Styles> <UserControl.Styles>
<Style Selector="ComboBox.condition-type /template/ ContentControl#ContentPresenter"> <Style Selector="ComboBox.condition-type /template/ ContentPresenter#ContentPresenter">
<Setter Property="ContentTemplate"> <Setter Property="ContentTemplate">
<Setter.Value> <Setter.Value>
<DataTemplate DataType="{x:Type displayCondition:ConditionTypeViewModel}"> <DataTemplate DataType="{x:Type displayCondition:ConditionTypeViewModel}">
@ -35,7 +35,13 @@
<TextBlock Text="{CompiledBinding Description}" Foreground="{DynamicResource TextFillColorSecondaryBrush}" TextWrapping="Wrap" MaxWidth="350" /> <TextBlock Text="{CompiledBinding Description}" Foreground="{DynamicResource TextFillColorSecondaryBrush}" TextWrapping="Wrap" MaxWidth="350" />
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
<ComboBox.SelectionBoxItemTemplate>
<DataTemplate DataType="{x:Type displayCondition:ConditionTypeViewModel}">
<TextBlock Text="{CompiledBinding Name}" TextWrapping="Wrap" MaxWidth="350" />
</DataTemplate>
</ComboBox.SelectionBoxItemTemplate>
</ComboBox> </ComboBox>
<ContentControl Grid.Row="2" Content="{CompiledBinding ConditionViewModel}" /> <ContentControl Grid.Row="2" Content="{CompiledBinding ConditionViewModel}" />
</Grid> </Grid>

View File

@ -267,7 +267,7 @@
</StackPanel> </StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"> <StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
<StackPanel.Styles> <StackPanel.Styles>
<Style Selector="ComboBox.brush /template/ ContentControl#ContentPresenter"> <Style Selector="ComboBox.brush /template/ ContentPresenter#ContentPresenter">
<Setter Property="ContentTemplate"> <Setter Property="ContentTemplate">
<Setter.Value> <Setter.Value>
<DataTemplate DataType="{x:Type layerBrushes:LayerBrushDescriptor}"> <DataTemplate DataType="{x:Type layerBrushes:LayerBrushDescriptor}">

View File

@ -38,6 +38,14 @@
<Setter Property="VerticalScrollBarVisibility" Value="Disabled"></Setter> <Setter Property="VerticalScrollBarVisibility" Value="Disabled"></Setter>
</Style> </Style>
<!-- Workaround for https://github.com/amwx/FluentAvalonia/issues/648 -->
<Style Selector="controls|FontIcon">
<Setter Property="Width" Value="24" />
</Style>
<Style Selector="controls|SymbolIcon">
<Setter Property="Width" Value="24" />
</Style>
<Styles.Resources> <Styles.Resources>
<ResourceDictionary> <ResourceDictionary>
<FontFamily x:Key="RobotoMono">avares://Artemis.UI/Assets/Fonts#Roboto Mono</FontFamily> <FontFamily x:Key="RobotoMono">avares://Artemis.UI/Assets/Fonts#Roboto Mono</FontFamily>