-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTrayWindow.xaml
171 lines (145 loc) · 6.7 KB
/
TrayWindow.xaml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?xml version="1.0" encoding="utf-8"?>
<Window
x:Class="Coder.Desktop.App.TrayWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Coder.Desktop.App"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="Coder">
<Window.SystemBackdrop>
<DesktopAcrylicBackdrop />
</Window.SystemBackdrop>
<StackPanel
Orientation="Vertical"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
Padding="20"
Spacing="10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="0"
Text="CoderVPN"
FontSize="18"
VerticalAlignment="Center" />
<ProgressRing
Grid.Column="1"
IsActive="{x:Bind GlobalToggleSwitch.IsOn, Mode=OneWay}"
Width="24"
Height="24"
Margin="10,0"
HorizontalAlignment="Right" />
<ToggleSwitch
x:Name="GlobalToggleSwitch"
Grid.Column="2"
OnContent=""
OffContent=""
Margin="0,0,-110,0"
HorizontalAlignment="Right" />
</Grid>
<local:HorizontalRule />
<TextBlock
Text="Workspaces"
FontWeight="semibold"
Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
<ItemsRepeater ItemsSource="{x:Bind Agents}">
<ItemsRepeater.Layout>
<StackLayout Orientation="Vertical" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<DataTemplate x:DataType="local:Agent">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<HyperlinkButton
Grid.Column="0"
Command="{x:Bind AgentHostnameButton_ClickCommand}"
Margin="-10,0,0,0"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left">
<StackPanel
Orientation="Horizontal"
HorizontalAlignment="Stretch"
Spacing="10">
<Canvas
HorizontalAlignment="Center"
VerticalAlignment="Center"
Height="14" Width="14"
Margin="0,1,0,0">
<Ellipse
Fill="{x:Bind StatusColor}"
Opacity="0.2"
Width="14"
Height="14"
Canvas.Left="0"
Canvas.Top="0" />
<Ellipse
Fill="{x:Bind StatusColor}"
Width="8"
Height="8"
VerticalAlignment="Center"
Canvas.Left="3"
Canvas.Top="3" />
</Canvas>
<!-- This cannot have any whitespace at all to avoid adding spaces between the elements, so it's populated from code instead -->
<!-- TODO: I couldn't get ellipsis to work without hardcoding a width here -->
<TextBlock
Loaded="{x:Bind AgentHostnameText_OnLoaded}"
VerticalAlignment="Center"
HorizontalAlignment="Stretch"
HorizontalTextAlignment="Left"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap"
Width="180" />
</StackPanel>
</HyperlinkButton>
<HyperlinkButton
Grid.Column="1"
x:Name="AgentHostnameCopyButton"
Command="{x:Bind AgentHostnameCopyButton_ClickCommand}"
CommandParameter="{Binding ElementName=AgentHostnameCopyButton}"
Margin="0,0,-10,0"
VerticalAlignment="Stretch">
<FontIcon
Glyph=""
FontSize="16"
Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
</HyperlinkButton>
</Grid>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
<HyperlinkButton
Margin="-10,0,-10,0"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
Click="ButtonBase_OnClick">
<TextBlock Text="Show more" Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
</HyperlinkButton>
<local:HorizontalRule />
<HyperlinkButton
Margin="-10,0,-10,0"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left">
<TextBlock Text="Create workspace" Foreground="{ThemeResource DefaultTextForegroundThemeBrush}" />
</HyperlinkButton>
<local:HorizontalRule />
<HyperlinkButton
Margin="-10,0,-10,0"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
Click="{x:Bind SignIn_Click}">
<TextBlock Text="Sign in" Foreground="{ThemeResource DefaultTextForegroundThemeBrush}" />
</HyperlinkButton>
<!-- For some strange reason, setting OpenCommand and ExitCommand here doesn't work, see .cs -->
<local:TrayIcon x:Name="TrayIcon" />
</StackPanel>
</Window>