mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Plugins tab - Added missing button
Profile editor - Color tweaks Layer adaption hints - Color tweaks Layer adaption hints - Save on close Layer properties - Fix loading of keyframes
This commit is contained in:
parent
a2ce3b9d9c
commit
eccad3042a
@ -550,7 +550,11 @@ namespace Artemis.Core
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (KeyframeEntity keyframeEntity in Entity.KeyframeEntities.Where(k => k.Position <= ProfileElement.Timeline.Length))
|
foreach (KeyframeEntity keyframeEntity in Entity.KeyframeEntities.Where(k => k.Position <= ProfileElement.Timeline.Length))
|
||||||
CreateKeyframeFromEntity(keyframeEntity);
|
{
|
||||||
|
LayerPropertyKeyframe<T>? keyframe = CreateKeyframeFromEntity(keyframeEntity) as LayerPropertyKeyframe<T>;
|
||||||
|
if (keyframe != null)
|
||||||
|
AddKeyframe(keyframe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (JsonException)
|
catch (JsonException)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,7 +4,6 @@ using Avalonia;
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using Avalonia.Media.Immutable;
|
using Avalonia.Media.Immutable;
|
||||||
using FluentAvalonia.Styling;
|
|
||||||
using FluentAvalonia.UI.Controls;
|
using FluentAvalonia.UI.Controls;
|
||||||
using FluentAvalonia.UI.Media;
|
using FluentAvalonia.UI.Media;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
@ -56,19 +55,16 @@ namespace Artemis.UI.Shared
|
|||||||
{
|
{
|
||||||
base.OnOpened(e);
|
base.OnOpened(e);
|
||||||
|
|
||||||
// Enable Mica on Windows 11
|
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || !IsWindows11)
|
||||||
FluentAvaloniaTheme? thm = AvaloniaLocator.Current.GetService<FluentAvaloniaTheme>();
|
return;
|
||||||
if (thm != null && RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
||||||
{
|
|
||||||
// TODO: add Windows version to CoreWindow
|
|
||||||
if (IsWindows11 && thm.RequestedTheme != FluentAvaloniaTheme.HighContrastModeString)
|
|
||||||
{
|
|
||||||
TransparencyBackgroundFallback = Brushes.Transparent;
|
|
||||||
TransparencyLevelHint = WindowTransparencyLevel.Mica;
|
|
||||||
|
|
||||||
TryEnableMicaEffect(thm);
|
// Enable Mica on Windows 11, based on the FluentAvalonia sample application
|
||||||
}
|
TransparencyBackgroundFallback = Brushes.Transparent;
|
||||||
}
|
TransparencyLevelHint = WindowTransparencyLevel.Mica;
|
||||||
|
|
||||||
|
Color2 color = this.TryFindResource("SolidBackgroundFillColorBase", out object? value) ? (Color) value : new Color2(32, 32, 32);
|
||||||
|
color = color.LightenPercent(-0.8f);
|
||||||
|
Background = new ImmutableSolidColorBrush(color, 0.78);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDataContextChanged(object? value)
|
private void OnDataContextChanged(object? value)
|
||||||
@ -85,29 +81,5 @@ namespace Artemis.UI.Shared
|
|||||||
ClearValue(DataContextProperty);
|
ClearValue(DataContextProperty);
|
||||||
else if (DataContext != value) DataContext = value;
|
else if (DataContext != value) DataContext = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TryEnableMicaEffect(FluentAvaloniaTheme thm)
|
|
||||||
{
|
|
||||||
// The background colors for the Mica brush are still based around SolidBackgroundFillColorBase resource
|
|
||||||
// BUT since we can't control the actual Mica brush color, we have to use the window background to create
|
|
||||||
// the same effect. However, we can't use SolidBackgroundFillColorBase directly since its opaque, and if
|
|
||||||
// we set the opacity the color become lighter than we want. So we take the normal color, darken it and
|
|
||||||
// apply the opacity until we get the roughly the correct color
|
|
||||||
// NOTE that the effect still doesn't look right, but it suffices. Ideally we need access to the Mica
|
|
||||||
// CompositionBrush to properly change the color but I don't know if we can do that or not
|
|
||||||
if (thm.RequestedTheme == FluentAvaloniaTheme.DarkModeString)
|
|
||||||
{
|
|
||||||
Color2 color = this.TryFindResource("SolidBackgroundFillColorBase", out object? value) ? (Color) value : new Color2(32, 32, 32);
|
|
||||||
color = color.LightenPercent(-0.8f);
|
|
||||||
Background = new ImmutableSolidColorBrush(color, 0.78);
|
|
||||||
}
|
|
||||||
else if (thm.RequestedTheme == FluentAvaloniaTheme.LightModeString)
|
|
||||||
{
|
|
||||||
// Similar effect here
|
|
||||||
Color2 color = this.TryFindResource("SolidBackgroundFillColorBase", out object? value) ? (Color) value : new Color2(243, 243, 243);
|
|
||||||
color = color.LightenPercent(0.5f);
|
|
||||||
Background = new ImmutableSolidColorBrush(color, 0.9);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8,6 +8,7 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.Dialogs.LayerHintsDialogView"
|
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.Dialogs.LayerHintsDialogView"
|
||||||
x:DataType="dialogs:LayerHintsDialogViewModel"
|
x:DataType="dialogs:LayerHintsDialogViewModel"
|
||||||
|
WindowStartupLocation="CenterOwner"
|
||||||
Title="Artemis | Adaption hints"
|
Title="Artemis | Adaption hints"
|
||||||
Width="750"
|
Width="750"
|
||||||
Height="800">
|
Height="800">
|
||||||
@ -15,8 +16,8 @@
|
|||||||
<Grid Margin="15" RowDefinitions="Auto,*,Auto">
|
<Grid Margin="15" RowDefinitions="Auto,*,Auto">
|
||||||
<Grid Grid.Row="0" ColumnDefinitions="*,Auto" RowDefinitions="Auto,Auto">
|
<Grid Grid.Row="0" ColumnDefinitions="*,Auto" RowDefinitions="Auto,Auto">
|
||||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||||
<avalonia:MaterialIcon Kind="{CompiledBinding Layer.LayerBrush.Descriptor.Icon}" Width="24" Height="24" Margin="0 0 5 10"/>
|
<avalonia:MaterialIcon Kind="{CompiledBinding Layer.LayerBrush.Descriptor.Icon}" Width="24" Height="24" Margin="0 0 5 10" />
|
||||||
<TextBlock Classes="h4" Text="{CompiledBinding Layer.Name}" TextWrapping="Wrap"/>
|
<TextBlock Classes="h4" Text="{CompiledBinding Layer.Name}" TextWrapping="Wrap" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<controls:HyperlinkButton Grid.Row="0"
|
<controls:HyperlinkButton Grid.Row="0"
|
||||||
@ -31,22 +32,37 @@
|
|||||||
</TextBlock>
|
</TextBlock>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden" Margin="0 15">
|
<Border Grid.Row="1" Classes="card" Margin="0 15">
|
||||||
<ItemsControl Items="{CompiledBinding AdaptionHints}" Classes="adaption-hints">
|
<Panel>
|
||||||
<ItemsControl.ItemsPanel>
|
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden" IsVisible="{CompiledBinding AdaptionHints.Count}">
|
||||||
<ItemsPanelTemplate>
|
<ItemsControl Items="{CompiledBinding AdaptionHints}" Classes="adaption-hints">
|
||||||
<StackPanel Spacing="10" />
|
<ItemsControl.ItemsPanel>
|
||||||
</ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
<StackPanel Spacing="10" />
|
||||||
<ItemsControl.ItemTemplate>
|
</ItemsPanelTemplate>
|
||||||
<DataTemplate>
|
</ItemsControl.ItemsPanel>
|
||||||
<Border Classes="card-condensed">
|
<ItemsControl.ItemTemplate>
|
||||||
<ContentControl Content="{Binding}"></ContentControl>
|
<DataTemplate>
|
||||||
</Border>
|
<Border Classes="card-condensed">
|
||||||
</DataTemplate>
|
<ContentControl Content="{Binding}"></ContentControl>
|
||||||
</ItemsControl.ItemTemplate>
|
</Border>
|
||||||
</ItemsControl>
|
</DataTemplate>
|
||||||
</ScrollViewer>
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
|
<StackPanel IsVisible="{CompiledBinding !AdaptionHints.Count}" VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||||
|
<avalonia:MaterialIcon Kind="AlertCircleOutline" HorizontalAlignment="Center" Width="48" Height="48" />
|
||||||
|
<TextBlock Classes="h4" TextAlignment="Center" TextWrapping="Wrap">
|
||||||
|
You haven't set up any adaption hints
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Classes="subtitle" TextAlignment="Center" TextWrapping="Wrap">
|
||||||
|
Artemis will attempt to directly map the LEDs of this layer to different surfaces but results may vary.
|
||||||
|
</TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
</Panel>
|
||||||
|
|
||||||
|
</Border>
|
||||||
|
|
||||||
<Grid Grid.Row="2" ColumnDefinitions="*,Auto">
|
<Grid Grid.Row="2" ColumnDefinitions="*,Auto">
|
||||||
<Button Grid.Row="0" Grid.Column="0" Command="{Binding AutoDetermineHints}">Auto-determine hints</Button>
|
<Button Grid.Row="0" Grid.Column="0" Command="{Binding AutoDetermineHints}">Auto-determine hints</Button>
|
||||||
|
|||||||
@ -260,6 +260,7 @@ public abstract class TreeItemViewModel : ActivatableViewModelBase
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
await _windowService.ShowDialogAsync<LayerHintsDialogViewModel, bool>(("layer", layer));
|
await _windowService.ShowDialogAsync<LayerHintsDialogViewModel, bool>(("layer", layer));
|
||||||
|
await ProfileEditorService.SaveProfileAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void UpdateCanPaste(bool isFlyoutOpen)
|
private async void UpdateCanPaste(bool isFlyoutOpen)
|
||||||
|
|||||||
@ -82,10 +82,7 @@
|
|||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
</paz:ZoomBorder>
|
</paz:ZoomBorder>
|
||||||
<Border CornerRadius="0 0 8 0" VerticalAlignment="Top" HorizontalAlignment="Left">
|
<Border CornerRadius="0 0 8 0" VerticalAlignment="Top" HorizontalAlignment="Left" Background="{DynamicResource ControlFillColorDefaultBrush}">
|
||||||
<Border.Background>
|
|
||||||
<SolidColorBrush Color="{DynamicResource CardStrokeColorDefaultSolid}" Opacity="0.65" />
|
|
||||||
</Border.Background>
|
|
||||||
<StackPanel Orientation="Horizontal" Margin="8">
|
<StackPanel Orientation="Horizontal" Margin="8">
|
||||||
<shared:ProfileConfigurationIcon ConfigurationIcon="{CompiledBinding ProfileConfiguration.Icon}"
|
<shared:ProfileConfigurationIcon ConfigurationIcon="{CompiledBinding ProfileConfiguration.Icon}"
|
||||||
Foreground="{DynamicResource ToolTipForeground}"
|
Foreground="{DynamicResource ToolTipForeground}"
|
||||||
|
|||||||
@ -3,21 +3,32 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:settings="clr-namespace:Artemis.UI.Screens.Settings"
|
xmlns:settings="clr-namespace:Artemis.UI.Screens.Settings"
|
||||||
|
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||||
mc:Ignorable="d" d:DesignWidth="1200" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="1200" d:DesignHeight="450"
|
||||||
x:Class="Artemis.UI.Screens.Settings.PluginsTabView"
|
x:Class="Artemis.UI.Screens.Settings.PluginsTabView"
|
||||||
x:DataType="settings:PluginsTabViewModel">
|
x:DataType="settings:PluginsTabViewModel">
|
||||||
<Grid RowDefinitions="Auto,*">
|
<Grid RowDefinitions="Auto,*">
|
||||||
<Grid Grid.Row="0" Grid.Column="0" MaxWidth="900" Margin="0 10">
|
<Grid Grid.Row="0" Grid.Column="0" MaxWidth="900" Margin="0 10">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition MinWidth="165" MaxWidth="400"/>
|
<ColumnDefinition MinWidth="165" MaxWidth="400" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBox Classes="clearButton" Text="{CompiledBinding SearchPluginInput}" Watermark="Search plugins" Margin="0 0 10 0"/>
|
<TextBox Classes="clearButton" Text="{CompiledBinding SearchPluginInput}" Watermark="Search plugins" Margin="0 0 10 0" />
|
||||||
<Button Grid.Row="0" Grid.Column="1" Classes="accent" Command="{CompiledBinding ImportPlugin}" HorizontalAlignment="Right">Import plugin</Button>
|
|
||||||
|
<StackPanel Spacing="5" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||||
|
<controls:HyperlinkButton Grid.Row="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
NavigateUri="https://wiki.artemis-rgb.com/en/guides/user/plugins">
|
||||||
|
Get more plugins
|
||||||
|
</controls:HyperlinkButton>
|
||||||
|
<Button Classes="accent" Command="{CompiledBinding ImportPlugin}">Import plugin</Button>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<ScrollViewer Grid.Row="1" Grid.Column="0" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" VerticalAlignment="Top">
|
<ScrollViewer Grid.Row="1" Grid.Column="0" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" VerticalAlignment="Top">
|
||||||
<ItemsControl Items="{CompiledBinding Plugins}" MaxWidth="900" VerticalAlignment="Center"/>
|
<ItemsControl Items="{CompiledBinding Plugins}" MaxWidth="900" VerticalAlignment="Center" />
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
Loading…
x
Reference in New Issue
Block a user