Skip to content

Commit 23316aa

Browse files
committed
feat: add the infomation page.
1 parent 493ab5e commit 23316aa

File tree

8 files changed

+77
-5
lines changed

8 files changed

+77
-5
lines changed

src/models/Setting.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class Setting : INotifyPropertyChanged
1414

1515
public event PropertyChangedEventHandler? PropertyChanged;
1616

17-
private int maxIdleInterval = 20;
17+
private int maxIdleInterval = 50;
1818
private int maxSyncInterval = 3;
1919

2020
private string apiName;

src/pages/HistoryPage.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
VerticalAlignment="Top"
1212
JournalEntry.KeepAlive="False"
1313
mc:Ignorable="d">
14-
<Grid Margin="15,15,15,15" VerticalAlignment="Top">
14+
<Grid Margin="15" VerticalAlignment="Top">
1515
<Grid.RowDefinitions>
1616
<RowDefinition Height="Auto" />
1717
<RowDefinition Height="*" />
@@ -37,7 +37,7 @@
3737
MouseOverBackground="#07000000"
3838
ToolTip="Previous " />
3939

40-
<TextBlock
40+
<ui:TextBlock
4141
x:Name="PageNumber"
4242
Margin="10,0,10,0"
4343
VerticalAlignment="Center"

src/pages/HistoryPage.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
using System.Windows;
33
using Microsoft.Win32;
44
using Wpf.Ui.Controls;
5+
using Wpf.Ui.Appearance;
56

67
using LiveCaptionsTranslator.utils;
78
using LiveCaptionsTranslator.models;
9+
810
using TextBlock = System.Windows.Controls.TextBlock;
911

1012
namespace LiveCaptionsTranslator
@@ -21,6 +23,7 @@ public partial class HistoryPage : Page
2123
public HistoryPage()
2224
{
2325
InitializeComponent();
26+
ApplicationThemeManager.ApplySystemTheme();
2427

2528
Loaded += async (s, e) =>
2629
{

src/pages/InfoPage.xaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<Page
2+
x:Class="LiveCaptionsTranslator.InfoPage"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:LiveCaptionsTranslator"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
9+
Title="InfoPage"
10+
JournalEntry.KeepAlive="False"
11+
mc:Ignorable="d">
12+
<Grid Margin="10">
13+
<StackPanel>
14+
<TextBlock Text="We highly encourage all forms of contributions, such as code improvements and new features." />
15+
<TextBlock Text="You can submit Issues and Pull Requests on GitHub." />
16+
<Separator Margin="0,5,0,5" />
17+
<TextBlock Margin="0,0,0,3">
18+
<Run FontWeight="SemiBold" Text="Repository:" />
19+
<Hyperlink NavigateUri="https://github.com/SakiRinn/LiveCaptions-Translator" RequestNavigate="Hyperlink_RequestNavigate">
20+
<Run Text="https://github.com/SakiRinn/LiveCaptions-Translator" />
21+
</Hyperlink>
22+
</TextBlock>
23+
<TextBlock Margin="0,0,0,3">
24+
<Run FontWeight="SemiBold" Text="Maintainer:" />
25+
<Hyperlink NavigateUri="https://github.com/SakiRinn" RequestNavigate="Hyperlink_RequestNavigate">
26+
<Run Text="@SakiRinn" />
27+
</Hyperlink>
28+
<Run Text="(Author) and" />
29+
<Hyperlink NavigateUri="https://github.com/A-nony-mous" RequestNavigate="Hyperlink_RequestNavigate">
30+
<Run Text="@A-nony-mous" />
31+
</Hyperlink>
32+
</TextBlock>
33+
<TextBlock>
34+
<Run FontWeight="SemiBold" Text="Version:" />
35+
<Hyperlink NavigateUri="https://github.com/SakiRinn/LiveCaptions-Translator/releases" RequestNavigate="Hyperlink_RequestNavigate">
36+
<Run Text="1.4.1251.1800" />
37+
</Hyperlink>
38+
</TextBlock>
39+
</StackPanel>
40+
</Grid>
41+
</Page>

src/pages/InfoPage.xaml.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.Diagnostics;
2+
using System.Windows.Controls;
3+
using System.Windows.Navigation;
4+
using Wpf.Ui.Appearance;
5+
6+
namespace LiveCaptionsTranslator
7+
{
8+
public partial class InfoPage : Page
9+
{
10+
public InfoPage()
11+
{
12+
InitializeComponent();
13+
ApplicationThemeManager.ApplySystemTheme();
14+
}
15+
16+
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
17+
{
18+
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });
19+
e.Handled = true;
20+
}
21+
}
22+
}

src/pages/SettingPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
JournalEntry.KeepAlive="False"
1111
mc:Ignorable="d">
1212

13-
<Grid x:Name="PageGrid" Margin="15,15,15,15">
13+
<Grid Margin="15">
1414
<Grid.ColumnDefinitions>
1515
<ColumnDefinition Width="Auto" />
1616
<ColumnDefinition Width="Auto" />

src/windows/MainWindow.xaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@
105105
Icon="{ui:SymbolIcon History24}"
106106
NavigationCacheMode="Disabled"
107107
TargetPageType="{x:Type local:HistoryPage}" />
108+
<ui:NavigationViewItem
109+
Margin="0,3,0,0"
110+
Content="Info"
111+
FontFamily="Bahnschrift"
112+
Icon="{ui:SymbolIcon Info24}"
113+
NavigationCacheMode="Required"
114+
TargetPageType="{x:Type local:InfoPage}" />
108115
</ui:NavigationView.MenuItems>
109116
</ui:NavigationView>
110117
</Grid>

src/windows/OverlayWindow.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.ComponentModel;
2-
using System.Runtime.InteropServices;
32
using System.Text;
43
using System.Windows;
54
using System.Windows.Controls.Primitives;

0 commit comments

Comments
 (0)