-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.axaml
More file actions
107 lines (99 loc) · 6.5 KB
/
Copy pathMainWindow.axaml
File metadata and controls
107 lines (99 loc) · 6.5 KB
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
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ctl="clr-namespace:BrainFuel.Controls"
xmlns:vm="clr-namespace:BrainFuel.ViewModels"
x:Class="BrainFuel.MainWindow"
x:DataType="vm:MainViewModel"
Title="BrainFuel"
Width="350" Height="190"
CanResize="False"
ShowInTaskbar="False"
WindowDecorations="None"
Topmost="True"
Background="Transparent"
TransparencyLevelHint="AcrylicBlur"
WindowStartupLocation="Manual">
<Window.Styles>
<Style Selector="Button.ghost">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Padding" Value="8,3"/>
<Setter Property="CornerRadius" Value="8"/>
</Style>
<Style Selector="Button.ghost:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource HoverOverlay}"/>
<Setter Property="CornerRadius" Value="8"/>
</Style>
<Style Selector="Button.ghost:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource HoverOverlay}"/>
<Setter Property="CornerRadius" Value="8"/>
</Style>
</Window.Styles>
<Border x:Name="CardBorder"
BorderBrush="{DynamicResource CardBorder}"
BorderThickness="1"
PointerPressed="Card_PointerPressed">
<Border.ContextMenu>
<ContextMenu>
<MenuItem Header="{DynamicResource MenuRefresh}" Click="Refresh_Click"/>
<MenuItem Header="{DynamicResource MenuSettings}" Click="Settings_Click"/>
<Separator/>
<MenuItem Header="{DynamicResource MenuHide}" Click="Hide_Click"/>
<MenuItem Header="{DynamicResource MenuQuit}" Click="Quit_Click"/>
</ContextMenu>
</Border.ContextMenu>
<Grid>
<!-- semi-transparent background layer (opacity slider; content stays full-opacity) -->
<Border Background="{DynamicResource CardBg}" Opacity="{Binding CardOpacity}"/>
<Border Padding="18">
<Grid ColumnDefinitions="124, *">
<ctl:UsageRing Grid.Column="0"
Width="120" Height="120"
HorizontalAlignment="Center"
VerticalAlignment="Center"
TrackBrush="{DynamicResource RingTrack}"
WeeklyBrush="{DynamicResource RingWeekly}"
HourlyBrush="{DynamicResource RingHourly}"
WeeklyProgress="{Binding WeeklyProgress}"
HourlyProgress="{Binding HourlyProgress}"/>
<StackPanel Grid.Column="1" Margin="16,0,0,0" Spacing="9" VerticalAlignment="Center">
<!-- refresh button (displays last refresh, click to refresh) -->
<Button Classes="ghost" HorizontalAlignment="Right" Click="Refresh_Click">
<StackPanel Orientation="Horizontal" Spacing="4">
<TextBlock Text="↻" FontSize="13" Foreground="{DynamicResource TextMuted}"/>
<TextBlock Text="{Binding RefreshAgoText}" FontSize="11" Foreground="{DynamicResource TextMuted}"/>
</StackPanel>
</Button>
<!-- 5-hour window -->
<StackPanel Spacing="3" HorizontalAlignment="Right">
<TextBlock Text="{Binding HourlyPercentText}"
FontSize="23" FontWeight="Bold" Foreground="{DynamicResource TextPrimary}"
HorizontalAlignment="Right"/>
<StackPanel Orientation="Horizontal" Spacing="5" HorizontalAlignment="Right">
<Ellipse Width="6" Height="6" Fill="{DynamicResource RingHourly}" VerticalAlignment="Center"/>
<TextBlock Text="{DynamicResource LblHourly}" FontSize="11" Foreground="{DynamicResource TextSecondary}" VerticalAlignment="Center"/>
<PathIcon Width="11" Height="11" Margin="10,0,2,0" Foreground="{DynamicResource TextMuted}"
Data="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/>
<TextBlock Text="{Binding HourlySubText}" FontSize="11" Foreground="{DynamicResource TextSecondary}" VerticalAlignment="Center"/>
</StackPanel>
</StackPanel>
<Border Height="1" Width="130" Background="{DynamicResource Separator}" Margin="0,1" HorizontalAlignment="Right"/>
<!-- weekly -->
<StackPanel Spacing="3" HorizontalAlignment="Right">
<TextBlock Text="{Binding WeeklyPercentText}"
FontSize="23" FontWeight="Bold" Foreground="{DynamicResource TextPrimary}"
HorizontalAlignment="Right"/>
<StackPanel Orientation="Horizontal" Spacing="5" HorizontalAlignment="Right">
<Ellipse Width="6" Height="6" Fill="{DynamicResource RingWeekly}" VerticalAlignment="Center"/>
<TextBlock Text="{DynamicResource LblWeekly}" FontSize="11" Foreground="{DynamicResource TextSecondary}" VerticalAlignment="Center"/>
<PathIcon Width="11" Height="11" Margin="10,0,2,0" Foreground="{DynamicResource TextMuted}"
Data="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/>
<TextBlock Text="{Binding WeeklySubText}" FontSize="11" Foreground="{DynamicResource TextSecondary}" VerticalAlignment="Center"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
</Border>
</Grid>
</Border>
</Window>