Skip to content

Commit a95efe6

Browse files
committed
move buttons to popup menu
1 parent 50b358d commit a95efe6

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

Plugins/All placements/All placements/All placements.cs

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,20 @@ public class Allplacements : Plugin
2121
const string WebViewUrl = "https://ctrader.com";
2222

2323
protected override void OnStart()
24+
{
25+
var icon = new SvgIcon(@"
26+
<svg class='w-6 h-6 text-gray-800 dark:text-white' aria-hidden='true' xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill='none' viewBox='0 0 24 24'>
27+
<path stroke='#BFBFBF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M11 6.5h2M11 18h2m-7-5v-2m12 2v-2M5 8h2a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1Zm0 12h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1Zm12 0h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1Zm0-12h2a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1Z'/>
28+
</svg>
29+
");
30+
Commands.Add(CommandType.ChartContainerToolbar, OnIconClicked, icon);
31+
}
32+
33+
private CommandResult OnIconClicked(CommandArgs args)
2434
{
2535
var buttonStyle = new Style();
2636
buttonStyle.Set(ControlProperty.Margin, new Thickness(0, 5, 0, 0));
2737
buttonStyle.Set(ControlProperty.Width, 150);
28-
29-
var block = Asp.SymbolTab.AddBlock("All placements");
30-
block.IsExpanded = true;
31-
block.IsDetachable = false;
3238
var stackPanel = new StackPanel();
3339

3440
var showMessageBoxButton = new Button{Text = "show MessageBox", Style = buttonStyle};
@@ -119,9 +125,18 @@ protected override void OnStart()
119125
chart.ZoomLevel = 10;
120126
}
121127
};
122-
stackPanel.AddChild(customizeActiveChartButton);
123-
124-
block.Child = stackPanel;
128+
stackPanel.AddChild(customizeActiveChartButton);
129+
130+
var border = new Border();
131+
border.Padding = 5;
132+
border.BackgroundColor = "#1A1A1A";
133+
border.CornerRadius = 3;
134+
border.BorderThickness = 1;
135+
border.BorderColor = "525252";
136+
border.Child = stackPanel;
137+
border.Width = 170;
138+
border.Height = 190;
139+
return new CommandResult(border);
125140
}
126141
}
127142
}

0 commit comments

Comments
 (0)