跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

提交记录
修改UI/Controls/Charts/Charts.cs+4 −1看文件
@@ -724,7 +724,10 @@ namespace UI.Controls.Charts
724724
725725 isRendering = false;
726726 var searchBox = GetTemplateChild("ASearchBox") as InputBox;
727删除: searchBox.TextChanged += SearchBox_TextChanged;
727新增: if(searchBox != null)
728新增: {
729新增: searchBox.TextChanged += SearchBox_TextChanged;
730新增: }
728731
729732 _listView.MouseLeftButtonUp += _listView_MouseLeftButtonUp;
730733 _listView.MouseRightButtonUp += _listView_MouseRightButtonUp;
修改UI/Controls/Charts/ChartsItemTypeRadar.cs+5 −4看文件
@@ -276,8 +276,9 @@ namespace UI.Controls.Charts
276276 var dataPoint = new Ellipse();
277277 dataPoint.Width = 5;
278278 dataPoint.Height = 5;
279删除: dataPoint.Fill = UI.Base.Color.Colors.GetFromString("#2b20d9");
280删除: dataPoint.Stroke = UI.Base.Color.Colors.GetFromString("#2b20d9");
279新增:
280新增: dataPoint.Fill = UI.Base.Color.Colors.GetFromString(StateData.ThemeColor);
281新增: dataPoint.Stroke = UI.Base.Color.Colors.GetFromString(StateData.ThemeColor);
281282 dataPoint.StrokeThickness = 1;
282283 Canvas.SetLeft(dataPoint, x - dataPoint.Width / 2);
283284 Canvas.SetTop(dataPoint, y - dataPoint.Width / 2);
@@ -285,8 +286,8 @@ namespace UI.Controls.Charts
285286 }
286287
287288 var p = new Polygon();
288删除: p.Stroke = UI.Base.Color.Colors.GetFromString("#2b20d9");
289删除: p.Fill = UI.Base.Color.Colors.GetFromString("#2b20d9", .3);
289新增: p.Stroke = UI.Base.Color.Colors.GetFromString(StateData.ThemeColor);
290新增: p.Fill = UI.Base.Color.Colors.GetFromString(StateData.ThemeColor, .3);
290291 p.StrokeThickness = 1;
291292 p.HorizontalAlignment = HorizontalAlignment.Left;
292293 p.VerticalAlignment = VerticalAlignment.Center;
修改UI/Resources/Themes/Dark.xaml+14 −12看文件
@@ -8,7 +8,7 @@
88 <Color x:Key="ThemeColor">#FF8780F7</Color>
99
1010 <!--鼠标经过背景颜色-->
11删除: <Color x:Key="HoverBackgroundColor">#CC383838</Color>
11新增: <Color x:Key="HoverBackgroundColor">#4d4d4d</Color>
1212
1313 <!--【通用笔刷】-->
1414 <!--主题颜色笔刷-->
@@ -16,8 +16,8 @@
1616 <!---鼠标经过背景颜色-->
1717 <SolidColorBrush x:Key="HoverBackgroundBrush" Color="{StaticResource HoverBackgroundColor}" />
1818 <!--标准背景颜色-->
19删除: <SolidColorBrush x:Key="StandardBackgroundBrush" Color="#7F777777" />
20删除: <SolidColorBrush x:Key="StandardBackgroundBrush2" Color="#646464" />
19新增: <SolidColorBrush x:Key="StandardBackgroundBrush" Color="#3e3e3e" />
20新增: <SolidColorBrush x:Key="StandardBackgroundBrush2" Color="#3e3e3e" />
2121
2222 <!--【窗口】-->
2323 <SolidColorBrush x:Key="StandardTextBrush" Color="#ffffff" />
@@ -41,7 +41,9 @@
4141 <SolidColorBrush x:Key="NavUnselectedTextBrush" Color="{StaticResource NavUnselectedTextColor}" />
4242
4343 <!--设置面板-->
44删除: <Color x:Key="SettingPanelBorderColor">#525050</Color>
44新增: <Color x:Key="SettingPanelBgColor">#323232</Color>
45新增: <SolidColorBrush x:Key="SettingPanelBgBrush" Color="{StaticResource SettingPanelBgColor}" />
46新增: <Color x:Key="SettingPanelBorderColor">#232323</Color>
4547 <SolidColorBrush x:Key="SettingPanelBorderBrush" Color="{StaticResource SettingPanelBorderColor}" />
4648 <Color x:Key="SettingPanelSpliteLineColor">#706f6f</Color>
4749 <SolidColorBrush x:Key="SettingPanelSpliteLineBrush" Color="{StaticResource SettingPanelSpliteLineColor}" />
@@ -55,12 +57,12 @@
5557 <SolidColorBrush x:Key="DefaultTextBrush" Color="{StaticResource DefaultTextColor}" />
5658
5759 <!--列表-->
58删除: <Color x:Key="ListItemIconBgColor">#7F777777</Color>
60新增: <Color x:Key="ListItemIconBgColor">#3e3e3e</Color>
5961 <SolidColorBrush x:Key="ListItemIconBgBrush" Color="{StaticResource ListItemIconBgColor}" />
6062
61删除: <Color x:Key="BaseListItemBgColor">#6e6e6e</Color>
63新增: <Color x:Key="BaseListItemBgColor">#3e3e3e</Color>
6264 <SolidColorBrush x:Key="BaseListItemBgBrush" Color="{StaticResource BaseListItemBgColor}" />
63删除: <Color x:Key="BaseListItemHoverBgColor">#3d3d3d</Color>
65新增: <Color x:Key="BaseListItemHoverBgColor">#4d4d4d</Color>
6466
6567 <!--日期选择控件-->
6668 <Color x:Key="DatePickerItemBgColor">#5A5A5A</Color>
@@ -73,7 +75,7 @@
7375 <!--弹出层边框-->
7476 <Color x:Key="PopupBorderColor">#3c3b3b</Color>
7577 <SolidColorBrush x:Key="PopupBorderBrush" Color="{StaticResource PopupBorderColor}" />
76删除: <Color x:Key="PopupBackgroundColor">#646464</Color>
78新增: <Color x:Key="PopupBackgroundColor">#2B2B2B</Color>
7779 <SolidColorBrush x:Key="PopupBackgroundBrush" Color="{StaticResource PopupBackgroundColor}" />
7880
7981 <!--标题栏按钮-->
@@ -97,16 +99,16 @@
9799 <SolidColorBrush x:Key="CategoryAppNumBgBrush" Color="{StaticResource CategoryAppNumBgColor}" />
98100
99101 <!--输入框-->
100删除: <Color x:Key="InputBoxBgColor">#646464</Color>
102新增: <Color x:Key="InputBoxBgColor">#3e3e3e</Color>
101103 <SolidColorBrush x:Key="InputBoxBgBrush" Color="{StaticResource InputBoxBgColor}" />
102删除: <Color x:Key="InputBoxHoverColor">#383838</Color>
104新增: <Color x:Key="InputBoxHoverColor">#4d4d4d</Color>
103105 <SolidColorBrush x:Key="InputBoxHoverBrush" Color="{StaticResource InputBoxHoverColor}" />
104106 <Color x:Key="InputBoxFocusedBgColor">#4F4E4E</Color>
105107 <SolidColorBrush x:Key="InputBoxFocusedBgBrush" Color="{StaticResource InputBoxFocusedBgColor}" />
106108
107109 <!--expander-->
108删除: <Color x:Key="ExpanderBgColor">#4F4F4F</Color>
110新增: <Color x:Key="ExpanderBgColor">#323232</Color>
109111 <SolidColorBrush x:Key="ExpanderBgBrush" Color="{StaticResource ExpanderBgColor}" />
110删除: <Color x:Key="ExpanderContentBgColor">#7e7e7e</Color>
112新增: <Color x:Key="ExpanderContentBgColor">#2e2e2e</Color>
111113 <SolidColorBrush x:Key="ExpanderContentBgBrush" Color="{StaticResource ExpanderContentBgColor}" />
112114</ResourceDictionary>
文件末尾没有换行
修改UI/Resources/Themes/Light.xaml+2 −0看文件
@@ -39,6 +39,8 @@
3939 <SolidColorBrush x:Key="NavUnselectedTextBrush" Color="{StaticResource NavUnselectedTextColor}" />
4040
4141 <!--设置面板-->
42新增: <Color x:Key="SettingPanelBgColor">#ffffff</Color>
43新增: <SolidColorBrush x:Key="SettingPanelBgBrush" Color="{StaticResource SettingPanelBgColor}" />
4244 <Color x:Key="SettingPanelBorderColor">#ededed</Color>
4345 <SolidColorBrush x:Key="SettingPanelBorderBrush" Color="{StaticResource SettingPanelBorderColor}" />
4446 <Color x:Key="SettingPanelSpliteLineColor">#ededed</Color>
修改UI/Servicers/ThemeServicer.cs+4 −0看文件
@@ -127,11 +127,15 @@ namespace UI.Servicers
127127 /// </summary>
128128 private void UpdateThemeColor()
129129 {
130新增:
130131 var config = appConfig.GetConfig();
131132 if (string.IsNullOrEmpty(config.General.ThemeColor))
132133 {
134新增: StateData.ThemeColor = ((System.Windows.Media.Color)Application.Current.Resources["ThemeColor"]).ToString();
133135 return;
134136 }
137新增:
138新增: StateData.ThemeColor = config.General.ThemeColor;
135139 Application.Current.Resources["ThemeColor"] = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString(config.General.ThemeColor);
136140 Application.Current.Resources["ThemeBrush"] = UI.Base.Color.Colors.GetFromString(config.General.ThemeColor);
137141 }
新增UI/StateData.cs+13 −0看文件
@@ -0,0 +1,13 @@
1新增:using System;
2新增:using System.Collections.Generic;
3新增:using System.Linq;
4新增:using System.Text;
5新增:using System.Threading.Tasks;
6新增:
7新增:namespace UI
8新增:{
9新增: internal static class StateData
10新增: {
11新增: internal static string ThemeColor { get; set; }
12新增: }
13新增:}
修改UI/Themes/SettingPanel/SettingPanel.xaml+1 −1看文件
@@ -6,7 +6,7 @@
66 <Setter Property="SnapsToDevicePixels"
77 Value="true" />
88
9删除: <Setter Property="Background" Value="{DynamicResource StandardBackgroundBrush}"/>
9新增: <Setter Property="Background" Value="{DynamicResource SettingPanelBgBrush}"/>
1010 <Setter Property="BorderBrush" Value="{DynamicResource SettingPanelBorderBrush}"/>
1111 <Setter Property="SpliteLineBrush" Value="{DynamicResource SettingPanelSpliteLineBrush}"/>
1212 <Setter Property="Template">
修改UI/UI.csproj+1 −0看文件
@@ -203,6 +203,7 @@
203203 <Compile Include="Servicers\IThemeServicer.cs" />
204204 <Compile Include="Servicers\MainServicer.cs" />
205205 <Compile Include="Servicers\ThemeServicer.cs" />
206新增: <Compile Include="StateData.cs" />
206207 <Compile Include="ViewModels\CategoryAppListPageVM.cs" />
207208 <Compile Include="ViewModels\CategoryPageVM.cs" />
208209 <Compile Include="ViewModels\ChartPageVM.cs" />
修改UI/Views/ChartPage.xaml+6 −6看文件
@@ -48,7 +48,7 @@
4848 <ColumnDefinition Width="*"/>
4949 <ColumnDefinition Width="*"/>
5050 </Grid.ColumnDefinitions>
51删除: <Border Margin="0,5,0,0" Background="{DynamicResource StandardBackgroundBrush}" Padding="10" CornerRadius="10">
51新增: <Border Margin="0,5,0,0" Background="{DynamicResource SettingPanelBgBrush}" Padding="10" CornerRadius="10">
5252 <Grid>
5353 <Grid.ColumnDefinitions>
5454 <ColumnDefinition Width="auto"/>
@@ -77,7 +77,7 @@
7777 </Grid>
7878 </Grid>
7979 </Border>
80删除: <Border Grid.Column="1" Margin="20,5,0,0" Background="{DynamicResource StandardBackgroundBrush}" Padding="10" CornerRadius="10">
80新增: <Border Grid.Column="1" Margin="20,5,0,0" Background="{DynamicResource SettingPanelBgBrush}" Padding="10" CornerRadius="10">
8181 <Grid>
8282 <Grid.ColumnDefinitions>
8383 <ColumnDefinition Width="auto"/>
@@ -107,7 +107,7 @@
107107 </Grid>
108108 </Grid>
109109 </Border>
110删除: <Border Grid.Column="2" Margin="20,5,0,0" Background="{DynamicResource StandardBackgroundBrush}" Padding="10" CornerRadius="10">
110新增: <Border Grid.Column="2" Margin="20,5,0,0" Background="{DynamicResource SettingPanelBgBrush}" Padding="10" CornerRadius="10">
111111 <Grid>
112112 <Grid.ColumnDefinitions>
113113 <ColumnDefinition Width="auto"/>
@@ -148,7 +148,7 @@
148148 </Grid.RowDefinitions>
149149 <!--<TextBlock Text="时段" Foreground="#5c5c5c" FontSize="15" Margin="0,20,0,5"/>-->
150150
151删除: <Border Grid.Row="1" Margin="0,20,0,0" Width="680" HorizontalAlignment="Left" Background="{DynamicResource StandardBackgroundBrush}" Padding="20" CornerRadius="10">
151新增: <Border Grid.Row="1" Margin="0,20,0,0" Width="680" HorizontalAlignment="Left" Background="{DynamicResource SettingPanelBgBrush}" Padding="20" CornerRadius="10">
152152 <StackPanel >
153153 <select:Select Height="30" IsShowIcon="False" SelectedItem="{Binding ChartDataMode,Mode=TwoWay}" Options="{Binding ChartDataModeOptions}"/>
154154 <charts:Charts Height="310" ColumnSelectedIndex="{Binding ColumnSelectedIndex,Mode=TwoWay}" IsShowTotal="False" DataMaximum="{Binding DataMaximum}" NameIndexStart="{Binding NameIndexStart}" ChartsType="Column" Data="{Binding Data}" IsCanColumnSelect="{Binding IsCanColumnSelect}"/>
@@ -186,7 +186,7 @@
186186 </Grid.RowDefinitions>
187187
188188 <TextBlock Text="分类" Foreground="#5c5c5c" FontSize="15" Margin="0,20,0,5"/>
189删除: <Border Margin="0,5,0,0" Grid.Row="1" Background="{DynamicResource StandardBackgroundBrush}" Padding="20" CornerRadius="10">
189新增: <Border Margin="0,5,0,0" Grid.Row="1" Background="{DynamicResource SettingPanelBgBrush}" Padding="20" CornerRadius="10">
190190 <charts:Charts Margin="10,20,10,10" Height="230" Width="230" ChartsType="Radar" Data="{Binding RadarData}"/>
191191
192192 </Border>
@@ -200,7 +200,7 @@
200200 </Grid.RowDefinitions>
201201
202202 <TextBlock Text="最为频繁" Foreground="#5c5c5c" FontSize="15" Margin="0,20,0,5"/>
203删除: <Border Grid.Row="1" Margin="0,5,0,0" Background="{DynamicResource StandardBackgroundBrush}" Padding="20" CornerRadius="10">
203新增: <Border Grid.Row="1" Margin="0,5,0,0" Background="{DynamicResource SettingPanelBgBrush}" Padding="20" CornerRadius="10">
204204 <charts:Charts ItemMenu="{Binding AppContextMenu}" Data="{Binding TopData}" ChartsType="HorizontalA" ClickCommand="{Binding ToDetailCommand}" IsCanScroll="False"/>
205205 </Border>
206206 </Grid>
修改UI/Views/DetailPage.xaml+7 −7看文件
@@ -19,7 +19,7 @@
1919 <TextBlock Text="查看" FontSize="18" Margin="0,0,0,20"/>
2020
2121 <Border
22删除: Background="{DynamicResource StandardBackgroundBrush}"
22新增: Background="{DynamicResource SettingPanelBgBrush}"
2323 CornerRadius="12"
2424 Padding="0,20">
2525 <Border.ContextMenu>
@@ -132,7 +132,7 @@
132132 <StackPanel Margin="10,0,0,0">
133133 <TextBlock Text="时段" Foreground="#5c5c5c" FontSize="14" Margin="0,20,0,0"/>
134134 <Tabbar:Tabbar Data="{Binding TabbarData}" SelectedIndex="{Binding TabbarSelectedIndex,Mode=TwoWay}" Width="180" HorizontalAlignment="Left"/>
135删除: <Border Margin="0,15,0,0" Width="680" HorizontalAlignment="Left" Background="{DynamicResource StandardBackgroundBrush}" Padding="20,10" CornerRadius="10">
135新增: <Border Margin="0,15,0,0" Width="680" HorizontalAlignment="Left" Background="{DynamicResource SettingPanelBgBrush}" Padding="20,10" CornerRadius="10">
136136 <StackPanel>
137137
138138
@@ -171,7 +171,7 @@
171171 <TextBlock Text="每月" Foreground="#5c5c5c" FontSize="14" Margin="0,20,0,0"/>
172172
173173 <Border
174删除: Background="{DynamicResource StandardBackgroundBrush}"
174新增: Background="{DynamicResource SettingPanelBgBrush}"
175175 CornerRadius="12"
176176 Padding="20,20"
177177 Margin="0,10,0,0">
@@ -192,7 +192,7 @@
192192 <StackPanel Grid.Column="1" >
193193 <Border Padding="15" CornerRadius="10" BorderThickness="0">
194194 <Border.Background>
195删除: <SolidColorBrush Color="{DynamicResource ThemeColor}" Opacity=".02"/>
195新增: <SolidColorBrush Color="{DynamicResource ThemeColor}" Opacity=".08"/>
196196 </Border.Background>
197197 <Border.BorderBrush>
198198 <SolidColorBrush Color="{DynamicResource ThemeColor}" Opacity=".5"/>
@@ -208,12 +208,12 @@
208208 <TextBlock Grid.Row="1" Margin="0,5,0,0" FontSize="14"><Run Text="{Binding LongDay}"/>
209209 </TextBlock>
210210 </Grid>
211删除: <base:Icon IconType="DateTimeMirrored" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="30" Foreground="{DynamicResource ThemeBrush}" Opacity=".1"/>
211新增: <base:Icon IconType="DateTimeMirrored" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="30" Foreground="{DynamicResource ThemeBrush}" Opacity=".5"/>
212212 </Grid>
213213 </Border>
214214 <Border Margin="0,10,0,0" Padding="15" CornerRadius="10" BorderThickness="0">
215215 <Border.Background>
216删除: <SolidColorBrush Color="{DynamicResource ThemeColor}" Opacity=".02"/>
216新增: <SolidColorBrush Color="{DynamicResource ThemeColor}" Opacity=".08"/>
217217 </Border.Background>
218218 <Border.BorderBrush>
219219 <SolidColorBrush Color="{DynamicResource ThemeColor}" Opacity=".5"/>
@@ -229,7 +229,7 @@
229229 <TextBlock Foreground="{DynamicResource DefaultTextBrush}" Grid.Row="1" Margin="0,10,0,0" FontSize="24"><Run Text="{Binding Ratio}"/>
230230 </TextBlock>
231231 </Grid>
232删除: <base:Icon IconType="ReportDocument" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="30" Foreground="{DynamicResource ThemeBrush}" Opacity=".1"/>
232新增: <base:Icon IconType="ReportDocument" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="30" Foreground="{DynamicResource ThemeBrush}" Opacity=".5"/>
233233 </Grid>
234234 </Border>
235235
修改UI/Views/SettingPage.xaml+3 −3看文件
@@ -48,7 +48,7 @@
4848
4949 <StackPanel Margin="0,10,0,0">
5050 <TextBlock Text="删除数据" Foreground="#f54f4e" FontSize="14"/>
51删除: <Border Background="{DynamicResource StandardBackgroundBrush}" Padding="20" CornerRadius="6" Margin="0,10,0,0" BorderBrush="{DynamicResource CardBorder}" BorderThickness="1">
51新增: <Border Background="{DynamicResource SettingPanelBgBrush}" Padding="20" CornerRadius="6" Margin="0,10,0,0" BorderBrush="{DynamicResource SettingPanelBorderBrush}" BorderThickness="1">
5252 <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
5353 <TextBlock Text="从" VerticalAlignment="Center"/>
5454 <select:DateSelect Date="{Binding DelDataStartMonthDate,Mode=TwoWay}" Margin="10,0" SelectType="Month"/>
@@ -58,7 +58,7 @@
5858 </StackPanel>
5959 </Border>
6060 <TextBlock Text="导出数据" FontSize="14" Margin="0,15,0,0"/>
61删除: <Border Background="{DynamicResource StandardBackgroundBrush}" Padding="20" CornerRadius="6" Margin="0,10,0,0" BorderBrush="{DynamicResource CardBorder}" BorderThickness="1">
61新增: <Border Background="{DynamicResource SettingPanelBgBrush}" Padding="20" CornerRadius="6" Margin="0,10,0,0" BorderBrush="{DynamicResource SettingPanelBorderBrush}" BorderThickness="1">
6262 <StackPanel>
6363 <TextBlock Text="导出为xlsx和csv格式,需要注意:没有设置分类的应用数据不会被导出。" Foreground="#989CA1" FontSize="12"/>
6464 <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
@@ -74,7 +74,7 @@
7474 </TabItem>
7575 <TabItem Foreground="{DynamicResource StandardTextBrush}">
7676 <!--关于-->
77删除: <Border Background="{DynamicResource StandardBackgroundBrush}" Padding="20" CornerRadius="6">
77新增: <Border Background="{DynamicResource SettingPanelBgBrush}" Padding="20" CornerRadius="6">
7878 <StackPanel HorizontalAlignment="Left">
7979 <Image Width="25" Source="/Resources/Icons/tai.ico" HorizontalAlignment="Left"/>
8080 <StackPanel Orientation="Horizontal" Margin="0,10,0,0">