This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
MainWindow.xaml
174 lines (169 loc) · 8.82 KB
/
MainWindow.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
172
173
174
<Window x:Class="QuickShare.Desktop.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:QuickShare.Desktop"
mc:Ignorable="d"
Loaded="Window_Loaded"
Activated="Window_Activated"
MouseDown="Window_MouseDown"
MouseMove="Window_MouseMove"
Closing="Window_Closing"
Title="Roamit"
Height="400"
Width="300"
AllowsTransparency="True"
Background="#01000000"
ShowInTaskbar="False"
ResizeMode="NoResize"
WindowStyle="None">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/ControlTemplates/ScrollBar.xaml" />
</ResourceDictionary.MergedDictionaries>
<Storyboard x:Key="PaneOpenStoryboard">
<DoubleAnimation Storyboard.TargetName="MainGridContent"
Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)"
Duration="0:0:0.2" From="40" To="0">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseOut" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="MainGridContent"
Storyboard.TargetProperty="Opacity"
Duration="0:0:0.2" From="0" To="1">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseOut" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
<Storyboard x:Key="PaneCloseStoryboard">
<DoubleAnimation Storyboard.TargetName="MainGridContent"
Storyboard.TargetProperty="Opacity"
Duration="0:0:0.05" From="1" To="0">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseOut" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
<Style TargetType="ListView">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}">
<ScrollViewer x:Name="ScrollViewer" ManipulationBoundaryFeedback="ScrollViewer_ManipulationBoundaryFeedback">
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Window.Resources>
<Border x:Name="MainContainer"
BorderBrush="{DynamicResource ResourceKey=BorderColor}"
BorderThickness="0.5">
<Border.RenderTransform>
<TranslateTransform Y="0" />
</Border.RenderTransform>
<Grid x:Name="MainGrid">
<Grid x:Name="MainGridContent">
<Grid.RenderTransform>
<TranslateTransform />
</Grid.RenderTransform>
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="40" />
<ColumnDefinition Width="40" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="Clipboard history"
FontFamily="Segoe UI"
Margin="8"
Foreground="{DynamicResource ResourceKey=TextColor}"
FontSize="18"
FontWeight="Light" />
<Button ToolTip="Open app" Grid.Column="1" Style="{StaticResource ThemedButton}" Click="OpenApp_Click">
<Button.Content>
<Image Source="{DynamicResource ResourceKey=AppIcon}"
Width="24" />
</Button.Content>
</Button>
<Button ToolTip="Settings" Grid.Column="2" Style="{StaticResource ThemedButton}" Click="Settings_Click">
<Button.Content>
<Image Source="{DynamicResource ResourceKey=SettingsIcon}"
Width="20" />
</Button.Content>
</Button>
</Grid>
<StackPanel x:Name="NotSignedIn"
Grid.Row="1"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<TextBlock Text="Please sign in to enable universal clipboard."
Foreground="{DynamicResource ResourceKey=TextColor}"
TextWrapping="Wrap"
Margin="0,0,0,16" />
<Button Content="Sign in"
HorizontalAlignment="Center"
Width="100"
Height="32"
Click="SignIn_Click" />
</StackPanel>
<Grid Grid.Row="1" x:Name="ActivityContainer">
<TextBlock x:Name="NoClipboardActivity"
Foreground="{DynamicResource ResourceKey=TextColor}"
Text="No clipboard activity yet."
FontSize="13"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Opacity="0.5"/>
<ListView x:Name="ClipboardActivity"
Background="Transparent"
BorderBrush="Transparent"
Padding="4,4,4,0"
HorizontalContentAlignment="Stretch"
ScrollViewer.PanningMode="VerticalOnly"
ScrollViewer.CanContentScroll="False"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectionChanged="ClipboardActivity_SelectionChanged"
Visibility="Collapsed">
<ListView.ItemTemplate>
<DataTemplate>
<Grid Background="{DynamicResource ResourceKey=ListItemBackgroundColor}"
Cursor="Hand"
Margin="0,2,0,2">
<StackPanel HorizontalAlignment="Stretch"
Margin="8,8,8,8"
MaxWidth="{Binding ActualWidth, ElementName=ClipboardActivity, Mode=OneWay}">
<TextBlock Text="{Binding DisplayText}"
FontSize="13"
Foreground="{DynamicResource ResourceKey=TextColor}"
TextWrapping="Wrap" />
<TextBlock Text="{Binding CopyDateString}"
Margin="0,4,0,0"
Foreground="{DynamicResource ResourceKey=TextColor}"
Opacity="0.6"
HorizontalAlignment="Right" />
</StackPanel>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
</ListView.ItemContainerStyle>
</ListView>
</Grid>
</Grid>
</Grid>
</Border>
</Window>