mirror of
https://github.com/zs-yg/kortapp-z.git
synced 2025-12-06 16:10:42 +08:00
添加关于界面
This commit is contained in:
66
AboutForm.cs
Normal file
66
AboutForm.cs
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace AppStore
|
||||||
|
{
|
||||||
|
public class AboutForm : Form
|
||||||
|
{
|
||||||
|
public AboutForm()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.Text = "关于 kortapp-z";
|
||||||
|
this.Size = new Size(500, 400);
|
||||||
|
this.StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
this.FormBorderStyle = FormBorderStyle.FixedDialog;
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
|
||||||
|
// 添加应用图标
|
||||||
|
PictureBox logo = new PictureBox();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
logo.Image = Image.FromFile("img/png/kortapp-z.png");
|
||||||
|
logo.SizeMode = PictureBoxSizeMode.Zoom;
|
||||||
|
logo.Width = 200;
|
||||||
|
logo.Height = 200;
|
||||||
|
logo.Location = new Point((this.Width - logo.Width) / 2, 30);
|
||||||
|
this.Controls.Add(logo);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"无法加载应用图标: {ex.Message}");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加应用信息
|
||||||
|
Label infoLabel = new Label();
|
||||||
|
infoLabel.Text = "kortapp-z\n版本: 0.9.5\n一个简单、开源的应用商店\nkortapp-z是完全免费的基于.NET8和C++的软件";
|
||||||
|
infoLabel.Font = new Font("Microsoft YaHei", 12);
|
||||||
|
infoLabel.AutoSize = false;
|
||||||
|
infoLabel.Width = this.ClientSize.Width - 40;
|
||||||
|
infoLabel.Height = 100;
|
||||||
|
infoLabel.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
|
infoLabel.Location = new Point(
|
||||||
|
20,
|
||||||
|
logo.Bottom + 20
|
||||||
|
);
|
||||||
|
this.Controls.Add(infoLabel);
|
||||||
|
|
||||||
|
// 添加关闭按钮
|
||||||
|
Button closeButton = new Button();
|
||||||
|
closeButton.Text = "关闭";
|
||||||
|
closeButton.Width = 100;
|
||||||
|
closeButton.Height = 40;
|
||||||
|
closeButton.Location = new Point(
|
||||||
|
(this.Width - closeButton.Width) / 2,
|
||||||
|
infoLabel.Bottom + 30
|
||||||
|
);
|
||||||
|
closeButton.Click += (s, e) => this.Close();
|
||||||
|
this.Controls.Add(closeButton);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
44
MainForm.cs
44
MainForm.cs
@@ -17,6 +17,8 @@ namespace AppStore
|
|||||||
private Button btnDownloads = null!;
|
private Button btnDownloads = null!;
|
||||||
// 设置按钮
|
// 设置按钮
|
||||||
private Button btnSettings = null!;
|
private Button btnSettings = null!;
|
||||||
|
// 关于按钮
|
||||||
|
private Button btnAbout = null!;
|
||||||
// 内容显示面板
|
// 内容显示面板
|
||||||
private Panel contentPanel = null!;
|
private Panel contentPanel = null!;
|
||||||
|
|
||||||
@@ -95,6 +97,18 @@ namespace AppStore
|
|||||||
};
|
};
|
||||||
buttonPanel.Controls.Add(btnSettings);
|
buttonPanel.Controls.Add(btnSettings);
|
||||||
|
|
||||||
|
// 关于按钮
|
||||||
|
btnAbout = new Button();
|
||||||
|
btnAbout.Text = "关于";
|
||||||
|
btnAbout.Location = new Point(450, 0);
|
||||||
|
styleButton(btnAbout);
|
||||||
|
btnAbout.Click += (s, e) => {
|
||||||
|
Logger.Log("用户点击了'关于'按钮");
|
||||||
|
var aboutForm = new AboutForm();
|
||||||
|
aboutForm.ShowDialog();
|
||||||
|
};
|
||||||
|
buttonPanel.Controls.Add(btnAbout);
|
||||||
|
|
||||||
// 现代化内容区域
|
// 现代化内容区域
|
||||||
contentPanel = new Panel();
|
contentPanel = new Panel();
|
||||||
contentPanel.Dock = DockStyle.Fill;
|
contentPanel.Dock = DockStyle.Fill;
|
||||||
@@ -596,6 +610,36 @@ namespace AppStore
|
|||||||
"glance",
|
"glance",
|
||||||
"https://ghproxy.net/https://github.com/glanceapp/glance/releases/download/v0.8.4/glance-windows-amd64.zip",
|
"https://ghproxy.net/https://github.com/glanceapp/glance/releases/download/v0.8.4/glance-windows-amd64.zip",
|
||||||
"img/png/glance.png"));
|
"img/png/glance.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"openark",
|
||||||
|
"https://ghproxy.net/https://github.com/BlackINT3/OpenArk/releases/download/v1.3.8/OpenArk64.exe",
|
||||||
|
"img/png/openark.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"SSM",
|
||||||
|
"https://ghproxy.net/https://github.com/AlexanderPro/SmartSystemMenu/releases/download/v2.31.0/SmartSystemMenu_v2.31.0.zip",
|
||||||
|
"img/png/SSM.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"Ditto",
|
||||||
|
"https://ghproxy.net/https://github.com/sabrogden/Ditto/releases/download/3.24.246.0/DittoSetup_64bit_3_24_246_0.exe",
|
||||||
|
"img/png/Ditto.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"XDM",
|
||||||
|
"https://github.com/subhra74/xdm/releases/download/7.2.11/xdm-setup.msi",
|
||||||
|
"img/png/XDM.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"FDM",
|
||||||
|
"https://files2.freedownloadmanager.org/6/latest/fdm_x64_setup.exe",
|
||||||
|
"img/png/FDM.png"));
|
||||||
|
|
||||||
|
flowPanel.Controls.Add(CreateAppCard(
|
||||||
|
"ABDM",
|
||||||
|
"https://ghproxy.net/https://github.com/amir1376/ab-download-manager/releases/download/v1.6.4/ABDownloadManager_1.6.4_windows_x64.exe",
|
||||||
|
"img/png/ABDM.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private FlowLayoutPanel downloadsFlowPanel = new FlowLayoutPanel();
|
private FlowLayoutPanel downloadsFlowPanel = new FlowLayoutPanel();
|
||||||
|
|||||||
Reference in New Issue
Block a user