-
Notifications
You must be signed in to change notification settings - Fork 1
/
AddPluginWidget.cs
61 lines (48 loc) · 1.59 KB
/
AddPluginWidget.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xwt;
namespace FPlug
{
public class AddPluginWidget : Canvas, IHasPluginType, IHasCanvasBackend
{
public PluginType PluginType
{
get;
set;
}
public AddPluginWidget(PluginType type)
{
PluginType = type;
HeightRequest = PluginWidget.Size.Height;
WidthRequest = PluginWidget.Size.Width;
Margin = PluginWidget.Margin;
Cursor = CursorType.Hand;
Label l = new Label("Add new " + type.GetName());
//l.TextColor = type.GetColor();
l.TextAlignment = Alignment.Center;
AddChild(l, new Rectangle(0, 0, PluginWidget.Size.Width, PluginWidget.Size.Height));
BackgroundColor = type.GetBGColor();
if (App.InitDropShadow != null)
App.InitDropShadow(this);
if (App.InitOpacityAnimation != null)
{
Opacity = 0;
App.InitOpacityAnimation(this);
}
}
public Xwt.Backends.ICanvasBackend GetBackend()
{
return (Xwt.Backends.ICanvasBackend)BackendHost.Backend;
}
protected override void OnDraw(Xwt.Drawing.Context ctx, Rectangle dirtyRect)
{
base.OnDraw(ctx, dirtyRect);
//ctx.SetColor(PluginType.GetColor());
ctx.SetLineDash(0, 4d, 4d);
ctx.Rectangle(0, 0, PluginWidget.Size.Width, PluginWidget.Size.Height);
ctx.Stroke();
}
}
}