mirror of
https://github.com/zs-yg/kortapp-z.git
synced 2025-12-07 00:20:43 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43027d7953 | ||
|
|
6d2711da08 |
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@@ -57,7 +51,7 @@ namespace AppStore
|
|||||||
|
|
||||||
// 初始化并添加应用信息
|
// 初始化并添加应用信息
|
||||||
infoLabel = new Label();
|
infoLabel = new Label();
|
||||||
infoLabel.Text = "kortapp-z\n版本: 1.2.6\n作者: zs-yg\n一个简单、开源的应用商店\nkortapp-z是完全免费\n基于.NET8和C/C++的软件";
|
infoLabel.Text = "kortapp-z\n版本: 1.2.7\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;
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@@ -59,10 +53,11 @@ namespace AppStore
|
|||||||
this.BackColor = ThemeManager.CurrentTheme == ThemeManager.ThemeMode.Light
|
this.BackColor = ThemeManager.CurrentTheme == ThemeManager.ThemeMode.Light
|
||||||
? Color.White
|
? Color.White
|
||||||
: Color.Black;
|
: Color.Black;
|
||||||
this.BorderStyle = BorderStyle.FixedSingle;
|
this.BorderStyle = BorderStyle.None; // 禁用默认边框
|
||||||
this.ForeColor = ThemeManager.CurrentTheme == ThemeManager.ThemeMode.Light
|
this.ForeColor = ThemeManager.CurrentTheme == ThemeManager.ThemeMode.Light
|
||||||
? Color.Black
|
? Color.Black
|
||||||
: Color.White;
|
: Color.White;
|
||||||
|
this.Paint += DownloadItem_Paint; // 添加自定义绘制
|
||||||
|
|
||||||
// 文件名标签
|
// 文件名标签
|
||||||
nameLabel = new Label();
|
nameLabel = new Label();
|
||||||
@@ -104,6 +99,17 @@ namespace AppStore
|
|||||||
nameLabel.Text = FileName;
|
nameLabel.Text = FileName;
|
||||||
progressBar.Value = Progress;
|
progressBar.Value = Progress;
|
||||||
statusLabel.Text = Status;
|
statusLabel.Text = Status;
|
||||||
|
this.Invalidate(); // 触发重绘
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DownloadItem_Paint(object sender, PaintEventArgs e)
|
||||||
|
{
|
||||||
|
// 自定义边框绘制
|
||||||
|
using (var pen = new Pen(ThemeManager.BorderColor, 1))
|
||||||
|
{
|
||||||
|
e.Graphics.DrawRectangle(pen,
|
||||||
|
new Rectangle(0, 0, this.Width - 1, this.Height - 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CancelBtn_Click(object sender, EventArgs e)
|
private void CancelBtn_Click(object sender, EventArgs e)
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
|||||||
45
MainForm.cs
45
MainForm.cs
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
#nullable enable
|
#nullable enable
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
@@ -132,6 +126,10 @@ namespace AppStore
|
|||||||
private Button btnAbout = null!;
|
private Button btnAbout = null!;
|
||||||
// 内容显示面板
|
// 内容显示面板
|
||||||
private Panel contentPanel = null!;
|
private Panel contentPanel = null!;
|
||||||
|
// 系统托盘图标
|
||||||
|
private NotifyIcon trayIcon = null!;
|
||||||
|
// 托盘右键菜单
|
||||||
|
private ContextMenuStrip trayMenu = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化窗体组件
|
/// 初始化窗体组件
|
||||||
@@ -146,6 +144,41 @@ namespace AppStore
|
|||||||
this.StartPosition = FormStartPosition.CenterScreen;
|
this.StartPosition = FormStartPosition.CenterScreen;
|
||||||
this.Icon = new Icon("img/ico/icon.ico"); // 设置窗体图标
|
this.Icon = new Icon("img/ico/icon.ico"); // 设置窗体图标
|
||||||
|
|
||||||
|
// 初始化系统托盘
|
||||||
|
trayMenu = new ContextMenuStrip();
|
||||||
|
trayMenu.Items.Add("打开", null, (s, e) => {
|
||||||
|
this.Show();
|
||||||
|
this.WindowState = FormWindowState.Normal;
|
||||||
|
});
|
||||||
|
trayMenu.Items.Add("退出", null, (s, e) => Application.Exit());
|
||||||
|
|
||||||
|
trayIcon = new NotifyIcon();
|
||||||
|
trayIcon.Text = "kortapp-z";
|
||||||
|
trayIcon.Icon = new Icon("img/ico/icon.ico");
|
||||||
|
trayIcon.ContextMenuStrip = trayMenu;
|
||||||
|
trayIcon.Visible = true;
|
||||||
|
trayIcon.DoubleClick += (s, e) => {
|
||||||
|
this.Show();
|
||||||
|
this.WindowState = FormWindowState.Normal;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 窗体最小化到托盘处理
|
||||||
|
this.Resize += (s, e) => {
|
||||||
|
if (this.WindowState == FormWindowState.Minimized)
|
||||||
|
{
|
||||||
|
this.Hide();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 窗体关闭按钮处理 - 隐藏到托盘而不是退出
|
||||||
|
this.FormClosing += (s, e) => {
|
||||||
|
if (e.CloseReason == CloseReason.UserClosing)
|
||||||
|
{
|
||||||
|
e.Cancel = true;
|
||||||
|
this.Hide();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 注册主题变更事件
|
// 注册主题变更事件
|
||||||
ThemeManager.ThemeChanged += (theme) =>
|
ThemeManager.ThemeChanged += (theme) =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档!
|
; 有关创建 Inno Setup 脚本文件的详细信息,请参阅帮助文档!
|
||||||
|
|
||||||
#define MyAppName "kortapp-z"
|
#define MyAppName "kortapp-z"
|
||||||
#define MyAppVersion "1.2.6"
|
#define MyAppVersion "1.2.7"
|
||||||
#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.6"
|
#define MyAppVersion "1.2.7"
|
||||||
#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"
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
// _ _
|
|
||||||
//| | _____ _ __| |_ __ _ _ __ _ __ ____
|
|
||||||
//| |/ / _ \| '__| __/ _` | '_ \| '_ \ ____|_ /
|
|
||||||
//| | (_) | | | || (_| | |_) | |_) |_____/ /
|
|
||||||
//|_|\_\___/|_| \__\__,_| .__/| .__/ /___|
|
|
||||||
// |_| |_|
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|||||||
Reference in New Issue
Block a user