1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Added a few buttons

This commit is contained in:
Robert Beekman 2016-05-24 22:44:09 +02:00
parent d9ab9d5af3
commit a596382274
3 changed files with 65 additions and 26 deletions

View File

@ -41,7 +41,7 @@ namespace Artemis.Managers
/// <param name="e"></param> /// <param name="e"></param>
private void SetupProfilePreview(object sender, ElapsedEventArgs e) private void SetupProfilePreview(object sender, ElapsedEventArgs e)
{ {
if (_deviceManager.ChangingKeyboard || ProfilePreviewModel == null) if (_deviceManager.ActiveKeyboard == null ||_deviceManager.ChangingKeyboard || ProfilePreviewModel == null)
return; return;
var activePreview = GameViewModels.FirstOrDefault(vm => vm.IsActive); var activePreview = GameViewModels.FirstOrDefault(vm => vm.IsActive);

View File

@ -568,10 +568,9 @@ namespace Artemis.ViewModels
_draggingLayerOffset = new Point(x - selectedProps.X, y - selectedProps.Y); _draggingLayerOffset = new Point(x - selectedProps.X, y - selectedProps.Y);
_draggingLayer = hoverLayer; _draggingLayer = hoverLayer;
if (Math.Sqrt(Math.Pow(x - layerRect.BottomRight.X, 2) + Math.Pow(y - layerRect.BottomRight.Y, 2)) < 0.6) // Detect dragging if cursor is in the bottom right
_resizing = true; _resizing = Math.Sqrt(Math.Pow(x - layerRect.BottomRight.X, 2) +
else Math.Pow(y - layerRect.BottomRight.Y, 2)) < 0.6;
_resizing = false;
} }
if (_draggingLayerOffset == null || _draggingLayer == null || (_draggingLayer != SelectedLayer)) if (_draggingLayerOffset == null || _draggingLayer == null || (_draggingLayer != SelectedLayer))

View File

@ -52,11 +52,54 @@
<Label Content="Active profile" /> <Label Content="Active profile" />
<ComboBox Width="110" VerticalAlignment="Top" x:Name="Profiles" DisplayMemberPath="Name" <ComboBox Width="110" VerticalAlignment="Top" x:Name="Profiles" DisplayMemberPath="Name"
Margin="5,0,0,0" /> Margin="5,0,0,0" />
<Button x:Name="AddProfile" Content="Add profile" VerticalAlignment="Top" <Button x:Name="AddProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Left" Margin="10,0,0,0" /> Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Add profile">
<Button x:Name="RemoveProfile" Content="Remove profile" VerticalAlignment="Top" <Button.Content>
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Right" <Rectangle
Margin="10,0,0,0" /> Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
Width="12" Height="12">
<Rectangle.OpacityMask>
<VisualBrush Visual="{StaticResource appbar_add}" Stretch="Fill" />
</Rectangle.OpacityMask>
</Rectangle>
</Button.Content>
</Button>
<Button x:Name="DuplicateProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Duplicate profile">
<Button.Content>
<Rectangle
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
Width="12" Height="12">
<Rectangle.OpacityMask>
<VisualBrush Visual="{StaticResource appbar_clipboard_paste}" Stretch="Fill" />
</Rectangle.OpacityMask>
</Rectangle>
</Button.Content>
</Button>
<Button x:Name="EditProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Rename profile">
<Button.Content>
<Rectangle
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
Width="12" Height="12">
<Rectangle.OpacityMask>
<VisualBrush Visual="{StaticResource appbar_edit}" Stretch="Fill" />
</Rectangle.OpacityMask>
</Rectangle>
</Button.Content>
</Button>
<Button x:Name="RemoveProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Delete profile">
<Button.Content>
<Rectangle
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
Width="12" Height="12">
<Rectangle.OpacityMask>
<VisualBrush Visual="{StaticResource appbar_delete}" Stretch="Fill" />
</Rectangle.OpacityMask>
</Rectangle>
</Button.Content>
</Button>
</StackPanel> </StackPanel>
<!-- Layer list --> <!-- Layer list -->
@ -101,21 +144,18 @@
</TreeView.ItemContainerStyle> </TreeView.ItemContainerStyle>
</TreeView> </TreeView>
</Border> </Border>
<Grid Grid.Column="1" Grid.Row="2" Margin="10,5,0,0"> <Button Grid.Column="1" Grid.Row="2" Margin="10,5,0,0" x:Name="AddLayer" VerticalAlignment="Top"
<Grid.ColumnDefinitions> Style="{DynamicResource SquareButtonStyle}"
<ColumnDefinition /> Width="26" Height="26" ToolTip="Add layer" HorizontalAlignment="Right">
<ColumnDefinition /> <Button.Content>
<ColumnDefinition /> <Rectangle
<ColumnDefinition /> Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
</Grid.ColumnDefinitions> Width="12" Height="12">
<Button Grid.Column="0" x:Name="AddLayer" Content="Add layer" VerticalAlignment="Top" <Rectangle.OpacityMask>
Style="{DynamicResource SquareButtonStyle}" Width="95" /> <VisualBrush Visual="{StaticResource appbar_add}" Stretch="Fill" />
<Button Grid.Column="3" x:Name="RemoveLayer" Content="Remove layer" VerticalAlignment="Top" </Rectangle.OpacityMask>
Style="{DynamicResource SquareButtonStyle}" Width="95" /> </Rectangle>
</Grid> </Button.Content>
</Button>
<!-- Layer movement -->
<StackPanel Grid.Column="2" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center"
Margin="10,0,0,0"/>
</Grid> </Grid>
</UserControl> </UserControl>