mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Redesigned sidebar
Removed dependency on Mahapps, ControlzEx and Dragablz
This commit is contained in:
1 parent
cec6fb45dc
commit
fe21bc83da
27 files changed
+377
-474
No files matched your search
@@ -6,47 +6,19 @@
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:surfaceEditor="clr-namespace:Artemis.UI.Screens.SurfaceEditor.Dialogs"
|
||||
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="351.305" d:DesignWidth="262.163"
|
||||
d:DataContext="{d:DesignInstance {x:Type surfaceEditor:SurfaceDeviceConfigViewModel}}">
|
||||
<StackPanel Margin="16">
|
||||
<TextBlock Text="{Binding Title}" Style="{StaticResource MaterialDesignTitleTextBlock}" />
|
||||
<TextBlock Text="Note: These are not being validated yet" Style="{StaticResource MaterialDesignSubheadingTextBlock}" />
|
||||
<TextBox materialDesign:HintAssist.Hint="X-coordinate" Text="{Binding X}" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="0 10" />
|
||||
|
||||
<Label>X-coordinate</Label>
|
||||
<mah:NumericUpDown materialDesign:HintAssist.Hint="X-coordinate"
|
||||
Value="{Binding X}"
|
||||
Style="{StaticResource MaterialDesignNumericUpDown}"
|
||||
Minimum="0"
|
||||
Interval="1"
|
||||
StringFormat="0" />
|
||||
|
||||
<Label>Y-coordinate</Label>
|
||||
<mah:NumericUpDown materialDesign:HintAssist.Hint="Y-coordinate"
|
||||
Value="{Binding Y}"
|
||||
Style="{StaticResource MaterialDesignNumericUpDown}"
|
||||
Minimum="0"
|
||||
Interval="1"
|
||||
StringFormat="0" />
|
||||
|
||||
<Label>Scale</Label>
|
||||
<mah:NumericUpDown materialDesign:HintAssist.Hint="Scale"
|
||||
Value="{Binding Scale}"
|
||||
Style="{StaticResource MaterialDesignNumericUpDown}"
|
||||
Minimum="0"
|
||||
Interval="0.1"
|
||||
StringFormat="0.00" />
|
||||
|
||||
<Label>Rotation</Label>
|
||||
<mah:NumericUpDown materialDesign:HintAssist.Hint="Rotation"
|
||||
Value="{Binding Rotation}"
|
||||
Style="{StaticResource MaterialDesignNumericUpDown}"
|
||||
Minimum="0"
|
||||
Maximum="359"
|
||||
Interval="1"
|
||||
StringFormat="0" />
|
||||
<TextBox materialDesign:HintAssist.Hint="Y-coordinate" Text="{Binding Y}" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="0 10" />
|
||||
|
||||
<TextBox materialDesign:HintAssist.Hint="Scale" Text="{Binding Scale}" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="0 10" />
|
||||
|
||||
<TextBox materialDesign:HintAssist.Hint="Rotation" Text="{Binding Rotation}" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Margin="0 10" />
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0"
|
||||
Command="{s:Action Cancel}">
|
||||
|
||||
@@ -66,10 +66,10 @@
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Rectangle Grid.Row="0" Grid.Column="0" Fill="{DynamicResource MaterialDesignPaper}" />
|
||||
<Rectangle Grid.Row="0" Grid.Column="0" Fill="Black" Opacity="0.15" />
|
||||
<Rectangle Grid.Row="0" Grid.Column="1" />
|
||||
<Rectangle Grid.Row="1" Grid.Column="0" />
|
||||
<Rectangle Grid.Row="1" Grid.Column="1" Fill="{DynamicResource MaterialDesignPaper}" />
|
||||
<Rectangle Grid.Row="1" Grid.Column="0" />
|
||||
<Rectangle Grid.Row="1" Grid.Column="1" Fill="Black" Opacity="0.15" />
|
||||
</Grid>
|
||||
</VisualBrush.Visual>
|
||||
</VisualBrush>
|
||||
|
||||
@@ -15,11 +15,12 @@ using Artemis.UI.Screens.Shared;
|
||||
using Artemis.UI.Screens.SurfaceEditor.Dialogs;
|
||||
using Artemis.UI.Screens.SurfaceEditor.Visualization;
|
||||
using Artemis.UI.Services.Interfaces;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.SurfaceEditor
|
||||
{
|
||||
public class SurfaceEditorViewModel : Screen, IScreenViewModel
|
||||
public class SurfaceEditorViewModel : MainScreenViewModel
|
||||
{
|
||||
private readonly IDeviceService _deviceService;
|
||||
private readonly IDialogService _dialogService;
|
||||
@@ -28,6 +29,10 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
||||
|
||||
public SurfaceEditorViewModel(ISurfaceService surfaceService, IDialogService dialogService, ISettingsService settingsService, IDeviceService deviceService)
|
||||
{
|
||||
DisplayName = "Surface Editor";
|
||||
DisplayIcon = PackIconKind.Edit;
|
||||
DisplayOrder = 4;
|
||||
|
||||
Devices = new ObservableCollection<SurfaceDeviceViewModel>();
|
||||
SurfaceConfigurations = new ObservableCollection<ArtemisSurface>();
|
||||
SelectionRectangle = new RectangleGeometry();
|
||||
@@ -59,9 +64,7 @@ namespace Artemis.UI.Screens.SurfaceEditor
|
||||
ApplySelectedSurfaceConfiguration();
|
||||
}
|
||||
}
|
||||
|
||||
public string Title => "Surface Editor";
|
||||
|
||||
|
||||
public ArtemisSurface CreateSurfaceConfiguration(string name)
|
||||
{
|
||||
var config = _surfaceService.CreateSurfaceConfiguration(name);
|
||||
|
||||
@@ -65,10 +65,10 @@
|
||||
<!-- Selection rectangle -->
|
||||
<Rectangle Width="Auto" Height="Auto" StrokeThickness="2">
|
||||
<Rectangle.Stroke>
|
||||
<SolidColorBrush Color="{StaticResource IdealForegroundColor}" />
|
||||
<SolidColorBrush Color="{StaticResource Accent700}" />
|
||||
</Rectangle.Stroke>
|
||||
<Rectangle.Fill>
|
||||
<SolidColorBrush Color="{StaticResource IdealForegroundColor}" Opacity="0.25" />
|
||||
<SolidColorBrush Color="{StaticResource Accent700}" Opacity="0.25" />
|
||||
</Rectangle.Fill>
|
||||
<Rectangle.Style>
|
||||
<Style TargetType="{x:Type Rectangle}">
|
||||
@@ -80,10 +80,10 @@
|
||||
<Storyboard>
|
||||
<ColorAnimation
|
||||
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
|
||||
To="{StaticResource IdealForegroundColor}" Duration="0:0:0.25" />
|
||||
To="{StaticResource Accent700}" Duration="0:0:0.25" />
|
||||
<ColorAnimation
|
||||
Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)"
|
||||
To="{StaticResource IdealForegroundColor}" Duration="0:0:0.25" />
|
||||
To="{StaticResource Accent700}" Duration="0:0:0.25" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</DataTrigger.EnterActions>
|
||||
|
||||
Reference in new issue
Block a user