-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
313 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- | ||
- Copyright (C) 2023 Prevter | ||
- | ||
- This program is free software: you can redistribute it and/or modify | ||
- it under the terms of the GNU General Public License as published by | ||
- the Free Software Foundation, either version 3 of the License, or | ||
- (at your option) any later version. | ||
- | ||
- This program is distributed in the hope that it will be useful, | ||
- but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
- GNU General Public License for more details. | ||
- | ||
- You should have received a copy of the GNU General Public License | ||
- along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
--> | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
> | ||
<Geometry x:Key="AboutIcon"> | ||
M482.906-269.333q17.427 0 29.594-12.25 12.166-12.25 12.166-30.084v-166.667q0-17.183-12.283-29.424Q500.099-520 482.673-520q-17.427 0-29.717 12.242-12.289 12.241-12.289 29.424v166.667q0 17.834 12.406 30.084 12.407 12.25 29.833 12.25Zm-3.035-337.333q17.796 0 29.962-11.833Q522-630.332 522-647.824q0-18.809-12.021-30.825-12.021-12.017-29.792-12.017-18.52 0-30.354 11.841Q438-666.984 438-648.508q0 17.908 12.038 29.875 12.038 11.967 29.833 11.967Zm.001 547.999q-87.157 0-163.841-33.353-76.684-33.354-133.671-90.34-56.986-56.987-90.34-133.808-33.353-76.821-33.353-164.165 0-87.359 33.412-164.193 33.413-76.834 90.624-134.057 57.211-57.224 133.757-89.987t163.578-32.763q87.394 0 164.429 32.763 77.034 32.763 134.117 90 57.082 57.237 89.916 134.292 32.833 77.056 32.833 164.49 0 87.433-32.763 163.67-32.763 76.236-89.987 133.308-57.223 57.073-134.261 90.608-77.037 33.535-164.45 33.535Z | ||
</Geometry> | ||
</ResourceDictionary> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
<!-- | ||
- Copyright (C) 2023 Prevter | ||
- | ||
- This program is free software: you can redistribute it and/or modify | ||
- it under the terms of the GNU General Public License as published by | ||
- the Free Software Foundation, either version 3 of the License, or | ||
- (at your option) any later version. | ||
- | ||
- This program is distributed in the hope that it will be useful, | ||
- but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
- GNU General Public License for more details. | ||
- | ||
- You should have received a copy of the GNU General Public License | ||
- along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
--> | ||
<Window x:Class="FloatTool.Views.AboutWindow" | ||
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:FloatTool" | ||
mc:Ignorable="d" | ||
WindowStartupLocation="CenterScreen" | ||
WindowStyle="None" | ||
AllowsTransparency="True" ResizeMode="NoResize" | ||
Background="Transparent" d:DesignHeight="400" | ||
Title="{DynamicResource m_About}" Height="450" Width="400"> | ||
<Window.Effect> | ||
<DropShadowEffect BlurRadius="3" ShadowDepth="3" Opacity="0.5"/> | ||
</Window.Effect> | ||
<Border Margin="4,4,4,4" BorderBrush="{DynamicResource WindowBorder}" BorderThickness="1" Background="{DynamicResource SettingsBackground}" CornerRadius="8"> | ||
<Grid> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="40"/> | ||
<RowDefinition/> | ||
</Grid.RowDefinitions> | ||
<Rectangle Grid.Row="0" Grid.ColumnSpan="2" Fill="{DynamicResource SettingsTopBarBackground}" RadiusX="8" RadiusY="8"/> | ||
|
||
<TextBlock Text="{DynamicResource m_About}" | ||
VerticalAlignment="Center" | ||
Foreground="{DynamicResource SettingsTopBarForeground}" | ||
FontSize="22" | ||
Margin="10,0,0,0"/> | ||
|
||
<StackPanel Orientation="Horizontal" | ||
HorizontalAlignment="Right"> | ||
<Button Style="{DynamicResource TopButton}" | ||
Click="WindowButton_Click"> | ||
<Path Width ="20" | ||
Stretch="Uniform" | ||
Stroke="{DynamicResource TopBarButtonsColor}" | ||
Fill="{DynamicResource TopBarButtonsColor}" | ||
Data="{DynamicResource CloseIcon}"/> | ||
</Button> | ||
</StackPanel> | ||
|
||
<Grid Grid.Row="1"> | ||
<StackPanel Grid.Column="0" Grid.Row="0" Margin="10,10,10,10"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto"/> | ||
<ColumnDefinition Width="*"/> | ||
</Grid.ColumnDefinitions> | ||
|
||
<Image Source="/Assets/Icon.png" Width="100" HorizontalAlignment="Left" Margin="0,0,20,20"/> | ||
|
||
<StackPanel Grid.Column="1" HorizontalAlignment="Left"> | ||
<TextBlock Text="FloatTool" | ||
Foreground="{DynamicResource SettingsMainForeground}" | ||
FontSize="22" | ||
Margin="0,0,0,10"/> | ||
<TextBlock | ||
Foreground="{DynamicResource SettingsMainForeground}" | ||
FontSize="16" | ||
Margin="0,0,0,5"> | ||
<Run Text="{DynamicResource m_Version}"/> | ||
<Run Text="{Binding CurrentVersion}"/> | ||
</TextBlock> | ||
<TextBlock | ||
Foreground="{DynamicResource SettingsMainForeground}" | ||
FontSize="16" | ||
Margin="0,0,0,5"> | ||
<Hyperlink NavigateUri="{Binding AuthorUrl}" | ||
RequestNavigate="Hyperlink_CheckUpdates"> | ||
<Run Text="{DynamicResource m_CheckUpdates}"/> | ||
</Hyperlink> | ||
</TextBlock> | ||
</StackPanel> | ||
</Grid> | ||
|
||
<TextBlock | ||
Foreground="{DynamicResource SettingsMainForeground}" | ||
FontSize="16" | ||
Margin="0,0,0,5"> | ||
<Run Text="{DynamicResource m_Author}"/> | ||
<Hyperlink NavigateUri="{Binding AuthorUrl}" | ||
RequestNavigate="Hyperlink_RequestNavigate"> | ||
Prevter | ||
</Hyperlink> | ||
</TextBlock> | ||
<TextBlock | ||
Foreground="{DynamicResource SettingsMainForeground}" | ||
FontSize="16" | ||
Margin="0,0,0,5"> | ||
<Run Text="{DynamicResource m_DiscordServer}"/> | ||
<Hyperlink NavigateUri="https://discord.gg/RM9VrzMfhP" | ||
RequestNavigate="Hyperlink_RequestNavigate"> | ||
discord.gg/RM9VrzMfhP | ||
</Hyperlink> | ||
</TextBlock> | ||
<TextBlock | ||
Foreground="{DynamicResource SettingsMainForeground}" | ||
FontSize="16" | ||
Margin="0,0,0,5"> | ||
<Run Text="{DynamicResource m_License}"/> | ||
<Hyperlink NavigateUri="https://www.gnu.org/licenses/gpl-3.0-standalone.html" | ||
RequestNavigate="Hyperlink_RequestNavigate"> | ||
GNU General Public License v3.0 | ||
</Hyperlink> | ||
</TextBlock> | ||
<TextBlock | ||
Foreground="{DynamicResource SettingsMainForeground}" | ||
FontSize="16" | ||
Margin="0,0,0,5"> | ||
<Run Text="{DynamicResource m_SourceCode}"/> | ||
<Hyperlink NavigateUri="https://github.com/prevter/floattool" | ||
RequestNavigate="Hyperlink_RequestNavigate"> | ||
GitHub | ||
</Hyperlink> | ||
</TextBlock> | ||
<TextBlock | ||
Foreground="{DynamicResource SettingsMainForeground}" | ||
FontSize="16" | ||
Margin="0,0,0,5"> | ||
<Run Text="{DynamicResource m_UsedLibraries}"/> | ||
<LineBreak/> | ||
• <Hyperlink NavigateUri="https://www.newtonsoft.com/json" | ||
RequestNavigate="Hyperlink_RequestNavigate"> | ||
Newtonsoft.Json | ||
</Hyperlink><LineBreak/> | ||
• <Hyperlink NavigateUri="https://logging.apache.org/log4net/" | ||
RequestNavigate="Hyperlink_RequestNavigate"> | ||
log4net | ||
</Hyperlink><LineBreak/> | ||
• <Hyperlink NavigateUri="https://www.nuget.org/packages/MdXaml_migfree" | ||
RequestNavigate="Hyperlink_RequestNavigate"> | ||
MdXaml_migfree | ||
</Hyperlink><LineBreak/> | ||
• <Hyperlink NavigateUri="https://www.nuget.org/packages/DiscordRichPresence" | ||
RequestNavigate="Hyperlink_RequestNavigate"> | ||
DiscordRichPresence | ||
</Hyperlink> | ||
</TextBlock> | ||
</StackPanel> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</Border> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
using FloatTool.Common; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Navigation; | ||
using System.Windows.Shapes; | ||
|
||
namespace FloatTool.Views | ||
{ | ||
public sealed class AboutData | ||
{ | ||
public string AuthorUrl { get; set; } = Utils.HOME_URL[..Utils.HOME_URL.LastIndexOf('/')]; | ||
public string CurrentVersion { get; set; } = AppHelpers.VersionCode; | ||
} | ||
|
||
/// <summary> | ||
/// Interaction logic for AboutWindow.xaml | ||
/// </summary> | ||
public partial class AboutWindow : Window | ||
{ | ||
public AboutWindow() | ||
{ | ||
DataContext = new AboutData(); | ||
|
||
InitializeComponent(); | ||
} | ||
|
||
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) | ||
{ | ||
base.OnMouseLeftButtonDown(e); | ||
if (e.GetPosition(this).Y < 40) DragMove(); | ||
} | ||
|
||
private void WindowButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Close(); | ||
} | ||
|
||
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) | ||
{ | ||
Process.Start(new ProcessStartInfo { FileName = e.Uri.ToString(), UseShellExecute = true }); | ||
} | ||
|
||
private void Hyperlink_CheckUpdates(object sender, RequestNavigateEventArgs e) | ||
{ | ||
Task.Factory.StartNew(() => | ||
{ | ||
var update = Utils.CheckForUpdates().Result; | ||
if (update != null && update.TagName != AppHelpers.VersionCode) | ||
{ | ||
Dispatcher.Invoke(new Action(() => | ||
{ | ||
Logger.Info("New version available"); | ||
var updateWindow = new UpdateWindow(update) | ||
{ | ||
Owner = this | ||
}; | ||
updateWindow.ShowDialog(); | ||
})); | ||
} | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.