mirror of
https://github.com/zs-yg/kortapp-z.git
synced 2025-12-07 00:20:43 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a777991b8c | ||
|
|
e2c6c52b32 | ||
|
|
33089c39b6 | ||
|
|
45805178cc | ||
|
|
08a11f025a | ||
|
|
5bb3886bc5 | ||
|
|
ce5f964776 | ||
|
|
f52c7908d7 | ||
|
|
abcbf06493 | ||
|
|
f56bcb3627 | ||
|
|
f789c7904a | ||
|
|
e04709637c | ||
|
|
e39f976607 |
@@ -57,7 +57,7 @@ namespace AppStore
|
|||||||
|
|
||||||
// 初始化并添加应用信息
|
// 初始化并添加应用信息
|
||||||
infoLabel = new Label();
|
infoLabel = new Label();
|
||||||
infoLabel.Text = "kortapp-z\n版本: 1.2.0\n作者: zs-yg\n一个简单、开源的应用商店\nkortapp-z是完全免费\n基于.NET8和C/C++的软件";
|
infoLabel.Text = "kortapp-z\n版本: 1.2.4\n作者: zs-yg\n一个简单、开源的应用商店\nkortapp-z是完全免费\n基于.NET8和C/C++的软件";
|
||||||
infoLabel.Font = new Font("Microsoft YaHei", 12);
|
infoLabel.Font = new Font("Microsoft YaHei", 12);
|
||||||
infoLabel.AutoSize = false;
|
infoLabel.AutoSize = false;
|
||||||
infoLabel.Width = 300;
|
infoLabel.Width = 300;
|
||||||
|
|||||||
106
AppCard.cs
106
AppCard.cs
@@ -54,9 +54,23 @@ namespace AppStore
|
|||||||
this.Padding = new Padding(10);
|
this.Padding = new Padding(10);
|
||||||
|
|
||||||
// 异步初始化卡片路径和边框
|
// 异步初始化卡片路径和边框
|
||||||
|
// 预加载边框路径
|
||||||
Task.Run(() => {
|
Task.Run(() => {
|
||||||
InitializeCardPath();
|
InitializeCardPath();
|
||||||
InitializeBorder();
|
InitializeBorder();
|
||||||
|
|
||||||
|
// 确保在主线程注册事件
|
||||||
|
this.Invoke((MethodInvoker)(() => {
|
||||||
|
this.Paint += (sender, e) => {
|
||||||
|
if (BorderCache.IsEmpty)
|
||||||
|
{
|
||||||
|
Task.Run(() => {
|
||||||
|
InitializeBorder();
|
||||||
|
this.Invoke((MethodInvoker)(() => this.Invalidate()));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
// 应用图标 - 添加null检查
|
// 应用图标 - 添加null检查
|
||||||
@@ -187,52 +201,58 @@ namespace AppStore
|
|||||||
// 使用卡片尺寸作为缓存键
|
// 使用卡片尺寸作为缓存键
|
||||||
string cacheKey = $"{Width}_{Height}_10";
|
string cacheKey = $"{Width}_{Height}_10";
|
||||||
|
|
||||||
// 检查缓存中是否已有路径
|
// 双重检查锁模式确保线程安全
|
||||||
if (!BorderCache.TryGetValue(cacheKey, out var borderPath))
|
if (!BorderCache.TryGetValue(cacheKey, out var borderPath))
|
||||||
{
|
{
|
||||||
// 创建临时文件存储路径数据
|
lock (BorderCache)
|
||||||
string tempFile = Path.GetTempFileName();
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
// 配置C++程序启动参数
|
if (!BorderCache.TryGetValue(cacheKey, out borderPath))
|
||||||
ProcessStartInfo startInfo = new ProcessStartInfo
|
|
||||||
{
|
{
|
||||||
FileName = Path.Combine(Application.StartupPath, "resource", "border_renderer.exe"),
|
// 创建临时文件存储路径数据
|
||||||
Arguments = $"{Width} {Height} 10 \"{tempFile}\"", // 传递宽高和圆角半径
|
string tempFile = Path.GetTempFileName();
|
||||||
UseShellExecute = false, // 不显示命令行窗口
|
try
|
||||||
CreateNoWindow = true // 静默运行
|
|
||||||
};
|
|
||||||
|
|
||||||
// 启动C++程序计算路径
|
|
||||||
using (var process = Process.Start(startInfo))
|
|
||||||
{
|
|
||||||
process.WaitForExit();
|
|
||||||
|
|
||||||
// 检查计算结果
|
|
||||||
if (process.ExitCode == 0 && File.Exists(tempFile))
|
|
||||||
{
|
{
|
||||||
// 读取C++程序生成的路径点
|
// 配置C++程序启动参数
|
||||||
var lines = File.ReadAllLines(tempFile);
|
ProcessStartInfo startInfo = new ProcessStartInfo
|
||||||
PointF[] points = lines.Select(line => {
|
{
|
||||||
var parts = line.Split(','); // 解析坐标点
|
FileName = Path.Combine(Application.StartupPath, "resource", "border_renderer.exe"),
|
||||||
return new PointF(float.Parse(parts[0]), float.Parse(parts[1]));
|
Arguments = $"{Width} {Height} 10 \"{tempFile}\"", // 传递宽高和圆角半径
|
||||||
}).ToArray();
|
UseShellExecute = false, // 不显示命令行窗口
|
||||||
|
CreateNoWindow = true // 静默运行
|
||||||
// 创建GraphicsPath对象
|
};
|
||||||
borderPath = new System.Drawing.Drawing2D.GraphicsPath();
|
|
||||||
borderPath.AddLines(points); // 添加路径点
|
// 启动C++程序计算路径
|
||||||
|
using (var process = Process.Start(startInfo))
|
||||||
// 缓存路径对象
|
{
|
||||||
BorderCache.TryAdd(cacheKey, borderPath);
|
process.WaitForExit();
|
||||||
|
|
||||||
|
// 检查计算结果
|
||||||
|
if (process.ExitCode == 0 && File.Exists(tempFile))
|
||||||
|
{
|
||||||
|
// 读取C++程序生成的路径点
|
||||||
|
var lines = File.ReadAllLines(tempFile);
|
||||||
|
PointF[] points = lines.Select(line => {
|
||||||
|
var parts = line.Split(','); // 解析坐标点
|
||||||
|
return new PointF(float.Parse(parts[0]), float.Parse(parts[1]));
|
||||||
|
}).ToArray();
|
||||||
|
|
||||||
|
// 创建GraphicsPath对象
|
||||||
|
borderPath = new System.Drawing.Drawing2D.GraphicsPath();
|
||||||
|
borderPath.AddLines(points); // 添加路径点
|
||||||
|
|
||||||
|
// 缓存路径对象
|
||||||
|
BorderCache.TryAdd(cacheKey, borderPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
// 确保临时文件被删除
|
||||||
|
if (File.Exists(tempFile))
|
||||||
|
{
|
||||||
|
File.Delete(tempFile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
// 确保临时文件被删除
|
|
||||||
if (File.Exists(tempFile))
|
|
||||||
{
|
|
||||||
File.Delete(tempFile);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -243,6 +263,12 @@ namespace AppStore
|
|||||||
{
|
{
|
||||||
base.OnPaint(e);
|
base.OnPaint(e);
|
||||||
|
|
||||||
|
// 确保边框已初始化
|
||||||
|
if (BorderCache.IsEmpty)
|
||||||
|
{
|
||||||
|
InitializeBorder();
|
||||||
|
}
|
||||||
|
|
||||||
// 绘制背景
|
// 绘制背景
|
||||||
using (var brush = new SolidBrush(this.BackColor)) {
|
using (var brush = new SolidBrush(this.BackColor)) {
|
||||||
e.Graphics.FillRectangle(brush, this.ClientRectangle);
|
e.Graphics.FillRectangle(brush, this.ClientRectangle);
|
||||||
|
|||||||
27
MainForm.cs
27
MainForm.cs
@@ -710,7 +710,7 @@ namespace AppStore
|
|||||||
flowPanel.Margin = new Padding(0);
|
flowPanel.Margin = new Padding(0);
|
||||||
flowPanel.AutoSize = true;
|
flowPanel.AutoSize = true;
|
||||||
flowPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
flowPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
flowPanel.AutoScrollMinSize = new Size(0, 3550);
|
flowPanel.AutoScrollMinSize = new Size(0, 3800);//大概一行250像素
|
||||||
contentPanel.Controls.Add(flowPanel);
|
contentPanel.Controls.Add(flowPanel);
|
||||||
|
|
||||||
// 添加所有应用卡片并恢复位置
|
// 添加所有应用卡片并恢复位置
|
||||||
@@ -786,6 +786,11 @@ namespace AppStore
|
|||||||
"https://ghproxy.net/https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe",
|
"https://ghproxy.net/https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe",
|
||||||
"img/png/MSYS2.png"));
|
"img/png/MSYS2.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"OpenJDK by Azul JDKs",
|
||||||
|
"https://cdn.azul.com/zulu/bin/zulu21.42.19-ca-jdk21.0.7-win_x64.msi",
|
||||||
|
"img/png/Azul_JDKs.png"));
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
".NET SDK 8.0",
|
".NET SDK 8.0",
|
||||||
"https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/sdk-8.0.411-windows-x64-installer",
|
"https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/sdk-8.0.411-windows-x64-installer",
|
||||||
@@ -821,6 +826,16 @@ namespace AppStore
|
|||||||
"https://ghproxy.net/https://github.com/game1024/OpenSpeedy/releases/download/v1.7.1/OpenSpeedy-v1.7.1.zip",
|
"https://ghproxy.net/https://github.com/game1024/OpenSpeedy/releases/download/v1.7.1/OpenSpeedy-v1.7.1.zip",
|
||||||
"img/png/openspeedy.png"));
|
"img/png/openspeedy.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"Final2x",
|
||||||
|
"https://ghproxy.net/https://github.com/Tohrusky/Final2x/releases/download/2024-12-14/Final2x-windows-x64-setup.exe",
|
||||||
|
"img/png/Final2x.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"Pixpin",
|
||||||
|
"https://download.pixpin.cn/PixPin_2.0.0.3.exe",
|
||||||
|
"img/png/pixpin.png"));
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
"QuickLook",
|
"QuickLook",
|
||||||
"https://ghproxy.net/https://github.com/QL-Win/QuickLook/releases/download/4.0.2/QuickLook-4.0.2.exe",
|
"https://ghproxy.net/https://github.com/QL-Win/QuickLook/releases/download/4.0.2/QuickLook-4.0.2.exe",
|
||||||
@@ -1032,6 +1047,11 @@ namespace AppStore
|
|||||||
"https://ghproxy.cn/https://github.com/reactos/reactos/releases/download/0.4.15-release/ReactOS-0.4.15-release-1-gdbb43bbaeb2-x86-iso.zip",
|
"https://ghproxy.cn/https://github.com/reactos/reactos/releases/download/0.4.15-release/ReactOS-0.4.15-release-1-gdbb43bbaeb2-x86-iso.zip",
|
||||||
"img/png/ReactOS.png"));
|
"img/png/ReactOS.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"Ubuntu桌面发行版",
|
||||||
|
"https://releases.ubuntu.com/24.04/ubuntu-24.04.2-desktop-amd64.iso",
|
||||||
|
"img/png/Ubuntu.png"));
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
"typescript",
|
"typescript",
|
||||||
"https://ghproxy.net/https://github.com/microsoft/TypeScript/releases/download/v5.8.3/typescript-5.8.3.tgz",
|
"https://ghproxy.net/https://github.com/microsoft/TypeScript/releases/download/v5.8.3/typescript-5.8.3.tgz",
|
||||||
@@ -1042,6 +1062,11 @@ namespace AppStore
|
|||||||
"https://mirror.nju.edu.cn/gimp/gimp/v3.0/windows/gimp-3.0.4-setup.exe",
|
"https://mirror.nju.edu.cn/gimp/gimp/v3.0/windows/gimp-3.0.4-setup.exe",
|
||||||
"img/jpg/Gimp.jpg"));
|
"img/jpg/Gimp.jpg"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"ClamAV",
|
||||||
|
"https://www.clamav.net/downloads/production/clamav-1.4.3.win.x64.msi",
|
||||||
|
"img/png/ClamAV.png"));
|
||||||
|
|
||||||
flowPanel.Controls.Add(CreateAppCard(
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
"Shotcut",
|
"Shotcut",
|
||||||
"https://sourceforge.net/projects/shotcut/files/v25.05.11/shotcut-win64-250511.exe/download",
|
"https://sourceforge.net/projects/shotcut/files/v25.05.11/shotcut-win64-250511.exe/download",
|
||||||
|
|||||||
@@ -76,6 +76,10 @@ namespace AppStore
|
|||||||
private static readonly Color DarkText = Color.FromArgb(240, 240, 240);
|
private static readonly Color DarkText = Color.FromArgb(240, 240, 240);
|
||||||
private static readonly Color DarkButtonHover = Color.FromArgb(60, 60, 60);
|
private static readonly Color DarkButtonHover = Color.FromArgb(60, 60, 60);
|
||||||
private static readonly Color DarkButtonActive = Color.FromArgb(70, 70, 70);
|
private static readonly Color DarkButtonActive = Color.FromArgb(70, 70, 70);
|
||||||
|
private static readonly Color DarkBorder = Color.FromArgb(80, 80, 80);
|
||||||
|
|
||||||
|
// 浅色主题边框颜色
|
||||||
|
private static readonly Color LightBorder = Color.FromArgb(180, 180, 180);
|
||||||
|
|
||||||
public static event Action<ThemeMode> ThemeChanged = delegate {};
|
public static event Action<ThemeMode> ThemeChanged = delegate {};
|
||||||
|
|
||||||
@@ -108,6 +112,9 @@ namespace AppStore
|
|||||||
public static Color ButtonActiveColor =>
|
public static Color ButtonActiveColor =>
|
||||||
_currentTheme == ThemeMode.Light ? LightButtonActive : DarkButtonActive;
|
_currentTheme == ThemeMode.Light ? LightButtonActive : DarkButtonActive;
|
||||||
|
|
||||||
|
public static Color BorderColor =>
|
||||||
|
_currentTheme == ThemeMode.Light ? LightBorder : DarkBorder;
|
||||||
|
|
||||||
public static void ApplyTheme(Control control)
|
public static void ApplyTheme(Control control)
|
||||||
{
|
{
|
||||||
ApplyThemeToControl(control);
|
ApplyThemeToControl(control);
|
||||||
|
|||||||
@@ -17,21 +17,7 @@
|
|||||||
<h2>核心功能</h2>
|
<h2>核心功能</h2>
|
||||||
|
|
||||||
<article class="feature">
|
<article class="feature">
|
||||||
<h3>应用程序管理</h3>
|
<h3>目前没有什么东西,别看了,害羞(✿◡‿◡)
|
||||||
<p>批量安装、卸载(目前没有)和更新应用程序(目前没有),管理启动项(目前没有)。</p>
|
|
||||||
<p>优势:集中管理所有应用,节省时间,避免系统臃肿。</p>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
<article class="feature">
|
|
||||||
<h3>资源监控(之后可能在内置工具里有)</h3>
|
|
||||||
<p>实时监控CPU、内存、磁盘和网络使用情况。</p>
|
|
||||||
<p>优势:直观的图表展示,及时发现资源瓶颈。</p>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
<article class="feature">
|
|
||||||
<h3>文件管理(之后可能在内置工具里有)</h3>
|
|
||||||
<p>高级文件搜索、批量重命名和快速文件分类。</p>
|
|
||||||
<p>优势:提升文件管理效率,支持正则表达式搜索。</p>
|
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
BIN
img/png/Azul_JDKs.png
Normal file
BIN
img/png/Azul_JDKs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/png/ClamAV.png
Normal file
BIN
img/png/ClamAV.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
BIN
img/png/Final2x.png
Normal file
BIN
img/png/Final2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
BIN
img/png/Ubuntu.png
Normal file
BIN
img/png/Ubuntu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 853 B |
BIN
img/png/pixpin.png
Normal file
BIN
img/png/pixpin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 239 KiB |
@@ -2,7 +2,7 @@
|
|||||||
; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档!
|
; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档!
|
||||||
|
|
||||||
#define MyAppName "kortapp-z"
|
#define MyAppName "kortapp-z"
|
||||||
#define MyAppVersion "1.2.0"
|
#define MyAppVersion "1.2.4"
|
||||||
#define MyAppPublisher "zsyg"
|
#define MyAppPublisher "zsyg"
|
||||||
#define MyAppURL "https://github.com/zs-yg/kortapp-z"
|
#define MyAppURL "https://github.com/zs-yg/kortapp-z"
|
||||||
#define MyAppExeName "kortapp-z.exe"
|
#define MyAppExeName "kortapp-z.exe"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档!
|
; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档!
|
||||||
|
|
||||||
#define MyAppName "kortapp-z"
|
#define MyAppName "kortapp-z"
|
||||||
#define MyAppVersion "1.2.0"
|
#define MyAppVersion "1.2.4"
|
||||||
#define MyAppPublisher "zsyg"
|
#define MyAppPublisher "zsyg"
|
||||||
#define MyAppURL "https://github.com/zs-yg/kortapp-z"
|
#define MyAppURL "https://github.com/zs-yg/kortapp-z"
|
||||||
#define MyAppExeName "kortapp-z.exe"
|
#define MyAppExeName "kortapp-z.exe"
|
||||||
|
|||||||
20
logger.cs
20
logger.cs
@@ -75,5 +75,25 @@ namespace AppStore
|
|||||||
}
|
}
|
||||||
Log(warningMessage);
|
Log(warningMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void LogDebug(string message, Exception? ex = null)
|
||||||
|
{
|
||||||
|
string debugMessage = $"DEBUG: {message}";
|
||||||
|
if (ex != null)
|
||||||
|
{
|
||||||
|
debugMessage += $"\nException: {ex}\nStackTrace: {ex.StackTrace}";
|
||||||
|
}
|
||||||
|
Log(debugMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LogTip(string message, Exception? ex = null)
|
||||||
|
{
|
||||||
|
string tipMessage = $"TIP: {message}";
|
||||||
|
if (ex != null)
|
||||||
|
{
|
||||||
|
tipMessage += $"\nException: {ex}\nStackTrace: {ex.StackTrace}";
|
||||||
|
}
|
||||||
|
Log(tipMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user