Fix context menu style on SparkWindow

This commit is contained in:
Eric Harding committed 2017-12-18 10:48:20 -05:00
1 parent d3792fa2c8
commit 18abe69558
6 files changed
+47 -30

No files matched your search

+13
View File
@@ -486,6 +486,19 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
</DrawingImage.Drawing>
</DrawingImage>
<!-- 'menu' three dots -->
<DrawingImage x:Key="MenuIcon">
<DrawingImage.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing
Brush="Black"
Geometry="M23,14C24.10498,14 25,14.89502 25,16 25,17.10498 24.10498,18 23,18 21.89502,18 21,17.10498 21,16 21,14.89502 21.89502,14 23,14z M16,14C17.105,14 18,14.895 18,16 18,17.105 17.105,18 16,18 14.895,18 14,17.105 14,16 14,14.895 14.895,14 16,14z M9,14C10.105,14 11,14.895 11,16 11,17.105 10.105,18 9,18 7.8950005,18 7,17.105 7,16 7,14.895 7.8950005,14 9,14z M16,2C8.2799997,2 2,8.2800002 2,16 2,23.72 8.2799997,30 16,30 23.72,30 30,23.72 30,16 30,8.2800002 23.72,2 16,2z M16,0C24.822,0 32,7.178 32,16 32,24.822 24.822,32 16,32 7.1780005,32 0,24.822 0,16 0,7.178 7.1780005,0 16,0z" />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<!-- Pin
<Path Data="F1M3,11L3,7 0,7 0,6 1,6 1,1 1,0 6,0 6,1 6,6 7,6 7,7 4,7 4,11 3,11z M2,1L2,6 4,6 4,1 2,1z" />
Unpin
+2 -2
View File
@@ -80,9 +80,9 @@ namespace bts.spark
// Orders
public static SparkCommand CancelOrders =>
SparkCommand.create("Cancel Orders", Icons.CancelOrders, SparkTags.NotImplemented);
SparkCommand.create("Cancel Sells", Icons.CancelOrders, SparkTags.NotImplemented);
public static SparkCommand CancelBuyOrders =>
SparkCommand.create("Cancel Orders", Icons.CancelOrders, SparkTags.NotImplemented);
SparkCommand.create("Cancel Buys", Icons.CancelOrders, SparkTags.NotImplemented);
public static SparkCommand CancelSellOrders =>
SparkCommand.create("Cancel Orders", Icons.CancelOrders, SparkTags.NotImplemented);
+1 -1
View File
@@ -91,7 +91,7 @@
Fill="{DynamicResource StartMenuMouseOverBackground}"
Margin="-10 0 0 0"
/>
<BulletDecorator Grid.Column="1" Margin="5 10 0 10">
<BulletDecorator Grid.Column="1" Margin="5 10 20 10">
<BulletDecorator.Bullet>
<Image Name="launcher_menu_item_icon" Source="{TemplateBinding Icon}" Width="25" Height="25" />
</BulletDecorator.Bullet>
+1 -1
View File
@@ -63,7 +63,7 @@ namespace mbts.ui.shell
var content = new TabDocument(this, viewmodel);
var state = model.start_position();
if (state != null) {
viewmodel.host_id = state.host_id;
viewmodel.host_id = state.host_id ?? "";
}
var window = CreateWindow(content, state);
@@ -6,28 +6,31 @@
xmlns:local="clr-namespace:bts.view"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid x:Name="_grid">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid x:Name="_grid">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="0" /> <!-- gutter -->
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
</Grid>
<UserControl.ContextMenu>
<ContextMenu>
<ContextMenu.Resources>
<Image Source="{Binding icon}" x:Key="icon" x:Shared="False" />
</ContextMenu.Resources>
<ContextMenu.ItemContainerStyle>
<Style TargetType="MenuItem" x:Shared="False">
<!--<Setter Property="Icon" Value="{Binding icon}" />-->
<Setter Property="Icon" Value="{StaticResource icon}"></Setter>
<Setter Property="Header" Value="{Binding title}" />
<Setter Property="Command" Value="{Binding command}" />
</Style>
</ContextMenu.ItemContainerStyle>
</ContextMenu>
<Grid.ContextMenu>
<ContextMenu>
<ContextMenu.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="Icon" Value="{Binding icon}" />
<Setter Property="Header" Value="{Binding text}" />
<Setter Property="Command" Value="{Binding command}" />
</Style>
</ContextMenu.ItemContainerStyle>
</ContextMenu>
</Grid.ContextMenu>
</Grid>
</UserControl.ContextMenu>
</UserControl>
@@ -1,4 +1,5 @@
using bts.api;
using bts.spark;
using mbts.ui.controls;
using System;
using System.Collections.Generic;
@@ -18,10 +19,10 @@ using System.Windows.Shapes;
namespace bts.view {
public partial class SparkWindowView : UserControl {
SparkMenu _menu;
public SparkWindowView(IBus bus, IEnumerable<spark.SparkCommand> commands, UIElement content) {
public SparkWindowView(IBus bus, IEnumerable<SparkCommand> commands, UIElement content) {
InitializeComponent();
Grid.SetColumn(content, 1);
Grid.SetColumn(content, 2);
Grid.SetRowSpan(content, 2);
_grid.Children.Add(content);
@@ -31,7 +32,7 @@ namespace bts.view {
_grid.Children.Add(_menu);
if (ContextMenu != null) {
ContextMenu.ItemsSource = commands;
ContextMenu.ItemsSource = commands.Select(c => new SparkCommandVM(c, bus));
}
}
}