From 9828ecfcd4b93ff0c2d348a77fd4940c598a0bd2 Mon Sep 17 00:00:00 2001 From: Laurence Luo Date: Sun, 14 Jul 2024 22:30:20 +0800 Subject: [PATCH] Update --- KindleMate2/FrmAboutBox.Designer.cs | 27 +++--- KindleMate2/FrmAboutBox.cs | 1 + KindleMate2/FrmBookRename.Designer.cs | 4 +- KindleMate2/FrmMain.Designer.cs | 32 ++++--- KindleMate2/FrmMain.cs | 8 +- KindleMate2/FrmMain.resx | 10 +-- KindleMate2/frmProgress.Designer.cs | 55 ++++++++++++ KindleMate2/frmProgress.cs | 17 ++++ KindleMate2/frmProgress.resx | 120 ++++++++++++++++++++++++++ 9 files changed, 238 insertions(+), 36 deletions(-) create mode 100644 KindleMate2/frmProgress.Designer.cs create mode 100644 KindleMate2/frmProgress.cs create mode 100644 KindleMate2/frmProgress.resx diff --git a/KindleMate2/FrmAboutBox.Designer.cs b/KindleMate2/FrmAboutBox.Designer.cs index 077b63e..0d07d02 100644 --- a/KindleMate2/FrmAboutBox.Designer.cs +++ b/KindleMate2/FrmAboutBox.Designer.cs @@ -84,11 +84,12 @@ private void InitializeComponent() { // lblPath.AutoEllipsis = true; lblPath.AutoSize = true; - lblPath.LinkBehavior = LinkBehavior.HoverUnderline; + lblPath.LinkBehavior = LinkBehavior.AlwaysUnderline; + lblPath.LinkColor = Color.Black; lblPath.Location = new Point(253, 130); lblPath.MaximumSize = new Size(464, 0); lblPath.Name = "lblPath"; - lblPath.Size = new Size(0, 31); + lblPath.Size = new Size(0, 28); lblPath.TabIndex = 26; lblPath.LinkClicked += LblPath_LinkClicked; // @@ -99,7 +100,7 @@ private void InitializeComponent() { lblVersion.Margin = new Padding(3, 0, 0, 0); lblVersion.MaximumSize = new Size(0, 37); lblVersion.Name = "lblVersion"; - lblVersion.Size = new Size(0, 31); + lblVersion.Size = new Size(0, 28); lblVersion.TabIndex = 0; lblVersion.TextAlign = ContentAlignment.MiddleLeft; // @@ -110,7 +111,7 @@ private void InitializeComponent() { lblVersionText.Margin = new Padding(20, 0, 6, 0); lblVersionText.MaximumSize = new Size(0, 37); lblVersionText.Name = "lblVersionText"; - lblVersionText.Size = new Size(62, 31); + lblVersionText.Size = new Size(54, 28); lblVersionText.TabIndex = 1; lblVersionText.Text = "版本"; lblVersionText.TextAlign = ContentAlignment.MiddleLeft; @@ -122,7 +123,7 @@ private void InitializeComponent() { lblCopyrightText.Margin = new Padding(20, 0, 6, 0); lblCopyrightText.MaximumSize = new Size(0, 37); lblCopyrightText.Name = "lblCopyrightText"; - lblCopyrightText.Size = new Size(62, 31); + lblCopyrightText.Size = new Size(54, 28); lblCopyrightText.TabIndex = 29; lblCopyrightText.Text = "版权"; lblCopyrightText.TextAlign = ContentAlignment.MiddleLeft; @@ -134,7 +135,7 @@ private void InitializeComponent() { lblCopyright.Margin = new Padding(3, 0, 0, 0); lblCopyright.MaximumSize = new Size(0, 37); lblCopyright.Name = "lblCopyright"; - lblCopyright.Size = new Size(0, 31); + lblCopyright.Size = new Size(0, 28); lblCopyright.TabIndex = 21; lblCopyright.TextAlign = ContentAlignment.MiddleLeft; // @@ -144,7 +145,7 @@ private void InitializeComponent() { lblPathText.Location = new Point(169, 130); lblPathText.Margin = new Padding(20, 0, 6, 0); lblPathText.Name = "lblPathText"; - lblPathText.Size = new Size(62, 32); + lblPathText.Size = new Size(75, 32); lblPathText.TabIndex = 25; lblPathText.Text = "程序路径"; // @@ -154,7 +155,7 @@ private void InitializeComponent() { lblDatabaseText.Location = new Point(169, 162); lblDatabaseText.Margin = new Padding(20, 0, 6, 0); lblDatabaseText.Name = "lblDatabaseText"; - lblDatabaseText.Size = new Size(62, 32); + lblDatabaseText.Size = new Size(75, 28); lblDatabaseText.TabIndex = 26; lblDatabaseText.Text = "数据库"; // @@ -187,7 +188,7 @@ private void InitializeComponent() { lblDatabase.AutoSize = true; lblDatabase.Location = new Point(253, 162); lblDatabase.Name = "lblDatabase"; - lblDatabase.Size = new Size(0, 31); + lblDatabase.Size = new Size(0, 28); lblDatabase.TabIndex = 32; // // flowLayoutPanel @@ -200,7 +201,7 @@ private void InitializeComponent() { flowLayoutPanel.Location = new Point(149, 18); flowLayoutPanel.Margin = new Padding(0); flowLayoutPanel.Name = "flowLayoutPanel"; - flowLayoutPanel.Size = new Size(268, 32); + flowLayoutPanel.Size = new Size(238, 32); flowLayoutPanel.TabIndex = 33; // // lblProductName @@ -212,7 +213,7 @@ private void InitializeComponent() { lblProductName.Margin = new Padding(18, 0, 0, 0); lblProductName.MaximumSize = new Size(0, 37); lblProductName.Name = "lblProductName"; - lblProductName.Size = new Size(212, 37); + lblProductName.Size = new Size(186, 37); lblProductName.TabIndex = 19; lblProductName.Text = "Kindle Mate"; lblProductName.TextAlign = ContentAlignment.MiddleLeft; @@ -222,10 +223,10 @@ private void InitializeComponent() { lblGen.AutoSize = true; lblGen.Font = new Font("微软雅黑", 12F, FontStyle.Bold, GraphicsUnit.Point, 134); lblGen.ForeColor = Color.Red; - lblGen.Location = new Point(230, 0); + lblGen.Location = new Point(204, 0); lblGen.Margin = new Padding(0); lblGen.Name = "lblGen"; - lblGen.Size = new Size(38, 42); + lblGen.Size = new Size(34, 37); lblGen.TabIndex = 20; lblGen.Text = "2"; lblGen.TextAlign = ContentAlignment.MiddleLeft; diff --git a/KindleMate2/FrmAboutBox.cs b/KindleMate2/FrmAboutBox.cs index 3edeaf3..ede7ee7 100644 --- a/KindleMate2/FrmAboutBox.cs +++ b/KindleMate2/FrmAboutBox.cs @@ -11,6 +11,7 @@ public FrmAboutBox() { if (_staticData.IsDarkTheme()) { _ = new DarkModeCS(this, false); + lblPath.LinkColor = Color.White; } } diff --git a/KindleMate2/FrmBookRename.Designer.cs b/KindleMate2/FrmBookRename.Designer.cs index c0118e9..300ef2a 100644 --- a/KindleMate2/FrmBookRename.Designer.cs +++ b/KindleMate2/FrmBookRename.Designer.cs @@ -124,7 +124,7 @@ private void InitializeComponent() { txtAuthor.Dock = DockStyle.Fill; txtAuthor.Location = new Point(3, 115); txtAuthor.Name = "txtAuthor"; - txtAuthor.Size = new Size(526, 27); + txtAuthor.Size = new Size(526, 35); txtAuthor.TabIndex = 6; txtAuthor.TextChanged += TxtAuthor_TextChanged; // @@ -133,7 +133,7 @@ private void InitializeComponent() { txtBook.Dock = DockStyle.Fill; txtBook.Location = new Point(3, 35); txtBook.Name = "txtBook"; - txtBook.Size = new Size(526, 27); + txtBook.Size = new Size(526, 35); txtBook.TabIndex = 7; txtBook.TextChanged += TxtBook_TextChanged; // diff --git a/KindleMate2/FrmMain.Designer.cs b/KindleMate2/FrmMain.Designer.cs index 002a6dd..01dc289 100644 --- a/KindleMate2/FrmMain.Designer.cs +++ b/KindleMate2/FrmMain.Designer.cs @@ -25,7 +25,7 @@ protected override void Dispose(bool disposing) { private void InitializeComponent() { components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain)); - DataGridViewCellStyle dataGridViewCellStyle1 = new DataGridViewCellStyle(); + DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle(); menuStrip = new MenuStrip(); menuFile = new ToolStripMenuItem(); menuRefresh = new ToolStripMenuItem(); @@ -409,13 +409,13 @@ private void InitializeComponent() { menuClippings.ImageScalingSize = new Size(28, 28); menuClippings.Items.AddRange(new ToolStripItem[] { menuClippingsRefresh, menuClippingsCopy, menuClippingsDelete }); menuClippings.Name = "menuClippings"; - menuClippings.Size = new Size(271, 144); + menuClippings.Size = new Size(127, 106); // // menuClippingsRefresh // menuClippingsRefresh.Name = "menuClippingsRefresh"; menuClippingsRefresh.ShortcutKeyDisplayString = ""; - menuClippingsRefresh.Size = new Size(270, 34); + menuClippingsRefresh.Size = new Size(126, 34); menuClippingsRefresh.Text = Strings.Refresh; menuClippingsRefresh.Click += MenuClippingsRefresh_Click; // @@ -423,7 +423,7 @@ private void InitializeComponent() { // menuClippingsCopy.Name = "menuClippingsCopy"; menuClippingsCopy.ShortcutKeyDisplayString = ""; - menuClippingsCopy.Size = new Size(270, 34); + menuClippingsCopy.Size = new Size(126, 34); menuClippingsCopy.Text = Strings.Copy; menuClippingsCopy.Click += ClippingMenuCopy_Click; // @@ -431,7 +431,7 @@ private void InitializeComponent() { // menuClippingsDelete.Name = "menuClippingsDelete"; menuClippingsDelete.ShortcutKeyDisplayString = ""; - menuClippingsDelete.Size = new Size(270, 34); + menuClippingsDelete.Size = new Size(126, 34); menuClippingsDelete.Text = Strings.Delete; menuClippingsDelete.Click += ClippingMenuDelete_Click; // @@ -548,14 +548,14 @@ private void InitializeComponent() { dataGridView.BorderStyle = BorderStyle.None; dataGridView.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText; dataGridView.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single; - dataGridViewCellStyle1.Alignment = DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = SystemColors.Window; - dataGridViewCellStyle1.Font = new Font("微软雅黑", 9F, FontStyle.Regular, GraphicsUnit.Point, 134); - dataGridViewCellStyle1.ForeColor = SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = DataGridViewTriState.False; - dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle2.Alignment = DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = SystemColors.Window; + dataGridViewCellStyle2.Font = new Font("微软雅黑", 9F, FontStyle.Regular, GraphicsUnit.Point, 134); + dataGridViewCellStyle2.ForeColor = SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = DataGridViewTriState.False; + dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; dataGridView.ColumnHeadersHeight = 46; dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; dataGridView.ContextMenuStrip = menu; @@ -729,10 +729,14 @@ private void InitializeComponent() { // progressBar // progressBar.Alignment = ToolStripItemAlignment.Right; + progressBar.AutoSize = false; progressBar.Enabled = false; progressBar.Margin = new Padding(100, 5, 100, 5); + progressBar.MarqueeAnimationSpeed = 50; progressBar.Name = "progressBar"; - progressBar.Size = new Size(200, 26); + progressBar.Overflow = ToolStripItemOverflow.Never; + progressBar.Size = new Size(300, 26); + progressBar.Step = 1; progressBar.Style = ProgressBarStyle.Marquee; progressBar.TextDirection = ToolStripTextDirection.Vertical270; progressBar.Visible = false; diff --git a/KindleMate2/FrmMain.cs b/KindleMate2/FrmMain.cs index b186b6a..35fa322 100644 --- a/KindleMate2/FrmMain.cs +++ b/KindleMate2/FrmMain.cs @@ -38,6 +38,8 @@ public partial class FrmMain : Form { private int _selectedIndex; + private Form _frmProgress = new frmProgress(); + public FrmMain() { InitializeComponent(); @@ -1294,7 +1296,7 @@ private void SetProgressBar(bool isShow) { progressBar.Enabled = isShow; progressBar.Visible = isShow; Enabled = !isShow; - } +} private void MenuImportKindleMate_Click(object sender, EventArgs e) { var fileDialog = new OpenFileDialog { @@ -2057,7 +2059,9 @@ private void MenuListRefresh_Click(object sender, EventArgs e) { } private void FrmMain_FormClosing(object sender, FormClosingEventArgs e) { - _staticData.CommitTransaction(); + try { + _staticData.CommitTransaction(); + } catch { } } } } \ No newline at end of file diff --git a/KindleMate2/FrmMain.resx b/KindleMate2/FrmMain.resx index 97c875c..fc55dc5 100644 --- a/KindleMate2/FrmMain.resx +++ b/KindleMate2/FrmMain.resx @@ -124,6 +124,9 @@ 1021, 17 + + 480, 17 + 798, 17 @@ -135,7 +138,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQE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AE7Af8BwwGIATsB/wHDAYgBOwH/AcMB iAE7Af8BwwGIATsB/wHDAYgBOwH/AmMBXwHaAycBOgMnAToCYwFfAdoBwwGIATsB/wHDAYgBOwH/AcMB @@ -432,9 +435,6 @@ AAGAAQABMAQACw== - - 480, 17 - 1376, 17 diff --git a/KindleMate2/frmProgress.Designer.cs b/KindleMate2/frmProgress.Designer.cs new file mode 100644 index 0000000..631f3ab --- /dev/null +++ b/KindleMate2/frmProgress.Designer.cs @@ -0,0 +1,55 @@ +namespace KindleMate2 { + partial class frmProgress { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { + progressBar = new ProgressBar(); + SuspendLayout(); + // + // progressBar + // + progressBar.Dock = DockStyle.Fill; + progressBar.Location = new Point(0, 0); + progressBar.Name = "progressBar"; + progressBar.Size = new Size(612, 29); + progressBar.Style = ProgressBarStyle.Marquee; + progressBar.TabIndex = 0; + // + // frmProgress + // + AutoScaleMode = AutoScaleMode.None; + ClientSize = new Size(612, 29); + Controls.Add(progressBar); + FormBorderStyle = FormBorderStyle.None; + Name = "frmProgress"; + StartPosition = FormStartPosition.CenterParent; + Text = "frmProgress"; + TopMost = true; + ResumeLayout(false); + } + + #endregion + + private ProgressBar progressBar; + } +} \ No newline at end of file diff --git a/KindleMate2/frmProgress.cs b/KindleMate2/frmProgress.cs new file mode 100644 index 0000000..e44fb39 --- /dev/null +++ b/KindleMate2/frmProgress.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace KindleMate2 { + public partial class frmProgress : Form { + public frmProgress() { + InitializeComponent(); + } + } +} diff --git a/KindleMate2/frmProgress.resx b/KindleMate2/frmProgress.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/KindleMate2/frmProgress.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file