|
8 | 8 | xmlns:userControls="clr-namespace:WDE.SmartScriptEditor.Avalonia.Editor.UserControls" |
9 | 9 | xmlns:models="clr-namespace:WDE.SmartScriptEditor.Models;assembly=WDE.SmartScriptEditor" |
10 | 10 | xmlns:viewModels1="clr-namespace:WDE.SmartScriptEditor.Editor.ViewModels;assembly=WDE.SmartScriptEditor" |
| 11 | + xmlns:views="clr-namespace:WDE.SmartScriptEditor.Avalonia.Editor.Views" |
11 | 12 | x:DataType="viewModels1:SmartScriptEditorViewModel" |
12 | 13 | mc:Ignorable="d" x:Name="Rooot" |
13 | 14 | Background="{DynamicResource SmartScripts.Background}" |
|
16 | 17 | <system:Boolean x:Key="FalseValue">False</system:Boolean> |
17 | 18 | <system:Boolean x:Key="TrueValue">True</system:Boolean> |
18 | 19 | <FloatToScaleTransformConverter x:Key="FloatToScaleTransformConverter" /> |
| 20 | + <views:ColorIdToNiceColorConverter x:Key="ColorIdToNiceColorConverter" /> |
19 | 21 | </UserControl.Resources> |
20 | 22 | <UserControl.KeyBindings> |
21 | 23 | <KeyBinding Gesture="Back" Command="{CompiledBinding DeleteSelected}" /> |
|
61 | 63 | > |
62 | 64 | <Panel> |
63 | 65 | <DockPanel> |
| 66 | + <DockPanel.ContextMenu> |
| 67 | + <ContextMenu> |
| 68 | + <MenuItem Command="{CompiledBinding NewActionAboveCommand}" IsVisible="{CompiledBinding AnySelected}" Header="New action above" /> |
| 69 | + <MenuItem Command="{CompiledBinding NewActionBelowCommand}" IsVisible="{CompiledBinding AnySelected}" Header="New action below" /> |
| 70 | + <Separator IsVisible="{CompiledBinding AnySelected}" /> |
| 71 | + <MenuItem IsVisible="{CompiledBinding AnySelected}" Command="{CompiledBinding NewEventAboveCommand}" Header="New event above" /> |
| 72 | + <MenuItem Command="{CompiledBinding NewEventBelowCommand}" Header="New event below" /> |
| 73 | + <Separator /> |
| 74 | + <MenuItem IsVisible="{CompiledBinding AnySelected}" Command="{CompiledBinding NewGroupAboveCommand}" Header="New group above" /> |
| 75 | + <MenuItem Command="{CompiledBinding NewGroupBelowCommand}" Header="New group below" /> |
| 76 | + <Separator /> |
| 77 | + <MenuItem Command="{CompiledBinding AddLinkCommand}" IsVisible="{CompiledBinding AnySelected}" Header="Add link" /> |
| 78 | + <MenuItem Command="{CompiledBinding EditConditionsCommand}" Header="Edit conditions" /> |
| 79 | + <MenuItem Command="{CompiledBinding DefineGlobalVariable}" Header="Define a global variable" /> |
| 80 | + <Separator /> |
| 81 | + <MenuItem Command="{CompiledBinding Copy}" Header="Copy" /> |
| 82 | + <MenuItem Command="{CompiledBinding Cut}" Header="Cut" /> |
| 83 | + <MenuItem Command="{CompiledBinding Paste}" Header="Paste" /> |
| 84 | + <Separator /> |
| 85 | + <MenuItem Command="{CompiledBinding DeleteSelected}" Header="Delete" /> |
| 86 | + </ContextMenu> |
| 87 | + </DockPanel.ContextMenu> |
64 | 88 | <userControls:VirtualizedSmartScriptPanel Background="Transparent" |
65 | | - Focusable="True" |
66 | | - DropGroups="{CompiledBinding OnDropGroups}" |
67 | | - DropItems="{CompiledBinding OnDropItems}" |
68 | | - DropActions="{CompiledBinding OnDropActions}" |
69 | | - DropConditions="{CompiledBinding OnDropConditions}" |
70 | | - Script="{CompiledBinding Script}" |
71 | | - Problems="{CompiledBinding ProblematicLines}" |
72 | | - HideComments="{CompiledBinding HideComments}" |
73 | | - HideConditions="{CompiledBinding HideConditions}" |
74 | | - DockPanel.Dock="Top"> |
75 | | - <userControls:VirtualizedSmartScriptPanel.ContextMenu> |
76 | | - <ContextMenu> |
77 | | - <MenuItem Command="{CompiledBinding NewActionAboveCommand}" IsVisible="{CompiledBinding AnySelected}" Header="New action above" /> |
78 | | - <MenuItem Command="{CompiledBinding NewActionBelowCommand}" IsVisible="{CompiledBinding AnySelected}" Header="New action below" /> |
79 | | - <Separator IsVisible="{CompiledBinding AnySelected}" /> |
80 | | - <MenuItem IsVisible="{CompiledBinding AnySelected}" Command="{CompiledBinding NewEventAboveCommand}" Header="New event above" /> |
81 | | - <MenuItem Command="{CompiledBinding NewEventBelowCommand}" Header="New event below" /> |
82 | | - <Separator /> |
83 | | - <MenuItem IsVisible="{CompiledBinding AnySelected}" Command="{CompiledBinding NewGroupAboveCommand}" Header="New group above" /> |
84 | | - <MenuItem Command="{CompiledBinding NewGroupBelowCommand}" Header="New group below" /> |
85 | | - <Separator /> |
86 | | - <MenuItem Command="{CompiledBinding EditConditionsCommand}" Header="Edit conditions" /> |
87 | | - <MenuItem Command="{CompiledBinding DefineGlobalVariable}" Header="Define a global variable" /> |
88 | | - <Separator /> |
89 | | - <MenuItem Command="{CompiledBinding Copy}" Header="Copy" /> |
90 | | - <MenuItem Command="{CompiledBinding Cut}" Header="Cut" /> |
91 | | - <MenuItem Command="{CompiledBinding Paste}" Header="Paste" /> |
92 | | - <Separator /> |
93 | | - <MenuItem Command="{CompiledBinding DeleteSelected}" Header="Delete" /> |
94 | | - </ContextMenu> |
95 | | - </userControls:VirtualizedSmartScriptPanel.ContextMenu> |
| 89 | + Focusable="True" |
| 90 | + DropGroups="{CompiledBinding OnDropGroups}" |
| 91 | + DropItems="{CompiledBinding OnDropItems}" |
| 92 | + DropActions="{CompiledBinding OnDropActions}" |
| 93 | + DropConditions="{CompiledBinding OnDropConditions}" |
| 94 | + Script="{CompiledBinding Script}" |
| 95 | + Problems="{CompiledBinding ProblematicLines}" |
| 96 | + HideComments="{CompiledBinding HideComments}" |
| 97 | + HideConditions="{CompiledBinding HideConditions}" |
| 98 | + DockPanel.Dock="Top"> |
96 | 99 | <userControls:VirtualizedSmartScriptPanel.EventItemTemplate> |
97 | 100 | <DataTemplate DataType="{x:Type models:SmartEvent}"> |
98 | 101 | <userControls:SmartEventView |
| 102 | + SpecialBackground="{CompiledBinding ColorId, Converter={StaticResource ColorIdToNiceColorConverter}}" |
99 | 103 | Selected="{CompiledBinding IsSelected, Mode=TwoWay}" |
100 | 104 | userControls:SmartScriptPanelLayout.Selected="{CompiledBinding IsSelected, Mode=TwoWay}" |
101 | 105 | DirectEditParameter="{Binding DataContext.DirectEditParameter, ElementName=Rooot}" |
|
109 | 113 | <userControls:VirtualizedSmartScriptPanel.ActionItemTemplate> |
110 | 114 | <DataTemplate DataType="{x:Type models:SmartAction}"> |
111 | 115 | <userControls:SmartActionView |
| 116 | + SpecialBackground="{CompiledBinding ColorId, Converter={StaticResource ColorIdToNiceColorConverter}}" |
112 | 117 | Indent="{CompiledBinding Indent}" |
113 | 118 | DirectEditParameter="{Binding DataContext.DirectEditParameter, ElementName=Rooot}" |
114 | 119 | DirectOpenParameter="{Binding DataContext.DirectOpenParameter, ElementName=Rooot}" |
|
123 | 128 | <userControls:VirtualizedSmartScriptPanel.ConditionItemTemplate> |
124 | 129 | <DataTemplate DataType="{x:Type models:SmartCondition}"> |
125 | 130 | <userControls:SmartConditionView |
| 131 | + SpecialBackground="{CompiledBinding ColorId, Converter={StaticResource ColorIdToNiceColorConverter}}" |
126 | 132 | DirectEditParameter="{Binding DataContext.DirectEditParameter, ElementName=Rooot}" |
127 | 133 | DeselectAllRequest="{Binding DataContext.DeselectAll, ElementName=Rooot}" |
128 | 134 | DeselectAllButConditionsRequest="{Binding DataContext.DeselectAllButConditions, ElementName=Rooot}" |
|
181 | 187 | Opacity="0.5" |
182 | 188 | Content="Add event" |
183 | 189 | Command="{CompiledBinding AddEvent}"> |
184 | | - <Button.ContextMenu> |
185 | | - <ContextMenu> |
186 | | - <MenuItem Header="Define global variable" |
187 | | - Command="{CompiledBinding DefineGlobalVariable}" /> |
188 | | - </ContextMenu> |
189 | | - </Button.ContextMenu> |
190 | 190 | </Button> |
191 | 191 | </DockPanel> |
192 | 192 | <userControls:SmartScriptOverlay |
|
0 commit comments