|
538 | 538 | <MenuItem Header="Remove Selected" x:Name="RemoveSelectedMenuItem" Foreground="#f38ba8"/> |
539 | 539 | </ContextMenu> |
540 | 540 | </ListBox.ContextMenu> |
| 541 | + <ListBox.Styles> |
| 542 | + <Style Selector="Border.clientSprBox"> |
| 543 | + <Setter Property="BorderBrush" Value="Transparent"/> |
| 544 | + </Style> |
| 545 | + <Style Selector="ListBoxItem:selected Border.clientSprBox"> |
| 546 | + <Setter Property="BorderBrush" Value="#89b4fa"/> |
| 547 | + </Style> |
| 548 | + </ListBox.Styles> |
541 | 549 | <ListBox.ItemTemplate> |
542 | 550 | <DataTemplate x:DataType="vm:ClientItemViewModel"> |
543 | 551 | <Grid ColumnDefinitions="38,*" Height="38" Margin="2,1"> |
544 | | - <Border Background="#11111b" CornerRadius="4" Width="32" Height="32" |
| 552 | + <Border Classes="clientSprBox" Background="#11111b" CornerRadius="4" Width="32" Height="32" |
| 553 | + BorderThickness="2" |
545 | 554 | VerticalAlignment="Center" HorizontalAlignment="Center" ClipToBounds="True"> |
546 | 555 | <Image Source="{Binding Sprite}" Width="32" Height="32" |
547 | 556 | RenderOptions.BitmapInterpolationMode="None" Stretch="Uniform"/> |
|
578 | 587 | Height="{Binding CompositionPreviewHeight}" |
579 | 588 | HorizontalAlignment="Center" VerticalAlignment="Center"> |
580 | 589 | <Border Background="{Binding CompositionGridBrush}"> |
581 | | - <ItemsControl x:Name="CompositionGrid" ItemsSource="{Binding CompositionSprites}"> |
582 | | - <ItemsControl.ItemsPanel> |
| 590 | + <ListBox x:Name="CompositionGrid" ItemsSource="{Binding CompositionSprites}" |
| 591 | + SelectedItem="{Binding SelectedCompositionSprite}" |
| 592 | + SelectionMode="Single" |
| 593 | + Background="Transparent" BorderThickness="0" Padding="0"> |
| 594 | + <ListBox.ItemsPanel> |
583 | 595 | <ItemsPanelTemplate><WrapPanel/></ItemsPanelTemplate> |
584 | | - </ItemsControl.ItemsPanel> |
585 | | - <ItemsControl.ItemTemplate> |
| 596 | + </ListBox.ItemsPanel> |
| 597 | + <ListBox.Styles> |
| 598 | + <Style Selector="ListBoxItem"> |
| 599 | + <Setter Property="Padding" Value="0"/> |
| 600 | + <Setter Property="Margin" Value="0"/> |
| 601 | + <Setter Property="MinWidth" Value="0"/> |
| 602 | + <Setter Property="MinHeight" Value="0"/> |
| 603 | + <Setter Property="Background" Value="Transparent"/> |
| 604 | + </Style> |
| 605 | + <Style Selector="Border.compCell"> |
| 606 | + <Setter Property="BorderBrush" Value="Transparent"/> |
| 607 | + </Style> |
| 608 | + <Style Selector="ListBoxItem:selected"> |
| 609 | + <Setter Property="Background" Value="Transparent"/> |
| 610 | + </Style> |
| 611 | + <Style Selector="ListBoxItem:pointerover"> |
| 612 | + <Setter Property="Background" Value="Transparent"/> |
| 613 | + </Style> |
| 614 | + <Style Selector="ListBoxItem:selected /template/ ContentPresenter"> |
| 615 | + <Setter Property="Background" Value="Transparent"/> |
| 616 | + </Style> |
| 617 | + <Style Selector="ListBoxItem:pointerover /template/ ContentPresenter"> |
| 618 | + <Setter Property="Background" Value="Transparent"/> |
| 619 | + </Style> |
| 620 | + <Style Selector="ListBoxItem:selected Border.compCell"> |
| 621 | + <Setter Property="BorderBrush" Value="#89b4fa"/> |
| 622 | + </Style> |
| 623 | + </ListBox.Styles> |
| 624 | + <ListBox.ItemTemplate> |
586 | 625 | <DataTemplate x:DataType="vm:SpriteViewModel"> |
587 | | - <Border Width="64" Height="64" Margin="1" Background="#11111b" |
588 | | - ToolTip.Tip="{Binding SpriteId}" |
589 | | - DoubleTapped="OnCompositionSpriteDoubleTapped"> |
| 626 | + <Border Classes="compCell" Width="64" Height="64" Margin="1" |
| 627 | + Background="#11111b" BorderThickness="2" |
| 628 | + ToolTip.Tip="{Binding SpriteId}"> |
590 | 629 | <Border.ContextMenu> |
591 | 630 | <ContextMenu> |
592 | 631 | <MenuItem Header="Paste" |
593 | | - Command="{Binding $parent[ItemsControl].((vm:MainWindowViewModel)DataContext).PasteSpriteToSlotCommand}" |
| 632 | + Command="{Binding $parent[ListBox].((vm:MainWindowViewModel)DataContext).PasteSpriteToSlotCommand}" |
594 | 633 | CommandParameter="{Binding}"/> |
595 | 634 | </ContextMenu> |
596 | 635 | </Border.ContextMenu> |
597 | | - <Image Source="{Binding Bitmap}" Width="64" Height="64" |
| 636 | + <Image Source="{Binding Bitmap}" Width="60" Height="60" |
598 | 637 | RenderOptions.BitmapInterpolationMode="None" Stretch="Fill"/> |
599 | 638 | </Border> |
600 | 639 | </DataTemplate> |
601 | | - </ItemsControl.ItemTemplate> |
602 | | - </ItemsControl> |
| 640 | + </ListBox.ItemTemplate> |
| 641 | + </ListBox> |
603 | 642 | </Border> |
604 | 643 | <Rectangle IsVisible="{Binding ShowCropSize}" |
605 | 644 | Width="{Binding CropOverlaySize}" Height="{Binding CropOverlaySize}" |
|
1350 | 1389 | ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
1351 | 1390 | DoubleTapped="OnOtbItemDoubleTapped" |
1352 | 1391 | SelectionChanged="OnOtbItemSelectionChanged"> |
| 1392 | + <ListBox.Styles> |
| 1393 | + <Style Selector="Border.otbSprBox"> |
| 1394 | + <Setter Property="BorderBrush" Value="Transparent"/> |
| 1395 | + </Style> |
| 1396 | + <Style Selector="ListBoxItem:selected Border.otbSprBox"> |
| 1397 | + <Setter Property="BorderBrush" Value="#89b4fa"/> |
| 1398 | + </Style> |
| 1399 | + </ListBox.Styles> |
1353 | 1400 | <ListBox.ContextMenu> |
1354 | 1401 | <ContextMenu x:Name="OtbItemContextMenu" Opening="OnOtbItemContextMenuOpening"> |
1355 | 1402 | <MenuItem Header="Remove Selected" x:Name="RemoveOtbSelectedMenuItem" Foreground="#f38ba8"/> |
|
1358 | 1405 | <ListBox.ItemTemplate> |
1359 | 1406 | <DataTemplate x:DataType="vm:ItemViewModel"> |
1360 | 1407 | <Grid ColumnDefinitions="38,Auto,*" Height="36" Margin="3,1"> |
1361 | | - <Border Background="#11111b" CornerRadius="4" Width="30" Height="30" |
| 1408 | + <Border Classes="otbSprBox" Background="#11111b" CornerRadius="4" Width="30" Height="30" |
| 1409 | + BorderThickness="2" |
1362 | 1410 | VerticalAlignment="Center" HorizontalAlignment="Center" ClipToBounds="True"> |
1363 | 1411 | <Image Source="{Binding Sprite}" Width="30" Height="30" |
1364 | 1412 | RenderOptions.BitmapInterpolationMode="None" Stretch="Uniform"/> |
|
1423 | 1471 | <StackPanel Orientation="Horizontal" Spacing="2"/> |
1424 | 1472 | </ItemsPanelTemplate> |
1425 | 1473 | </ListBox.ItemsPanel> |
| 1474 | + <ListBox.Styles> |
| 1475 | + <Style Selector="ListBoxItem"> |
| 1476 | + <Setter Property="Padding" Value="0"/> |
| 1477 | + <Setter Property="Margin" Value="0"/> |
| 1478 | + <Setter Property="MinWidth" Value="0"/> |
| 1479 | + <Setter Property="MinHeight" Value="0"/> |
| 1480 | + <Setter Property="Background" Value="Transparent"/> |
| 1481 | + </Style> |
| 1482 | + <Style Selector="Border.sprCell"> |
| 1483 | + <Setter Property="BorderBrush" Value="#313244"/> |
| 1484 | + </Style> |
| 1485 | + <Style Selector="ListBoxItem:selected"> |
| 1486 | + <Setter Property="Background" Value="Transparent"/> |
| 1487 | + </Style> |
| 1488 | + <Style Selector="ListBoxItem:pointerover"> |
| 1489 | + <Setter Property="Background" Value="Transparent"/> |
| 1490 | + </Style> |
| 1491 | + <Style Selector="ListBoxItem:selected /template/ ContentPresenter"> |
| 1492 | + <Setter Property="Background" Value="Transparent"/> |
| 1493 | + </Style> |
| 1494 | + <Style Selector="ListBoxItem:pointerover /template/ ContentPresenter"> |
| 1495 | + <Setter Property="Background" Value="Transparent"/> |
| 1496 | + </Style> |
| 1497 | + <Style Selector="ListBoxItem:selected Border.sprCell"> |
| 1498 | + <Setter Property="BorderBrush" Value="#89b4fa"/> |
| 1499 | + </Style> |
| 1500 | + </ListBox.Styles> |
1426 | 1501 | <ListBox.ItemTemplate> |
1427 | 1502 | <DataTemplate x:DataType="vm:SpriteViewModel"> |
1428 | | - <Border Width="38" Height="46" Margin="1" Background="#11111b" |
1429 | | - CornerRadius="3" BorderBrush="#313244" BorderThickness="1" |
| 1503 | + <Border Classes="sprCell" Width="38" Height="46" Margin="1" Background="#11111b" |
| 1504 | + CornerRadius="3" BorderThickness="2" |
1430 | 1505 | ToolTip.Tip="{Binding SpriteId}" |
1431 | 1506 | PointerPressed="OnRightSpritePointerPressed" |
1432 | 1507 | PointerMoved="OnRightSpritePointerMoved" |
|
0 commit comments