From a675c70a38b5b285aba35c1ab22f66dca9d4a192 Mon Sep 17 00:00:00 2001 From: rookiestyle Date: Sat, 21 Jan 2023 11:38:55 +0100 Subject: [PATCH] Rework OTP setup UI Closes #122 --- src/KeePassOTPSetup.Designer.cs | 224 ++++++++++++++++---------------- src/KeePassOTPSetup.cs | 14 +- src/Properties/AssemblyInfo.cs | 6 +- version.info | 2 +- 4 files changed, 130 insertions(+), 116 deletions(-) diff --git a/src/KeePassOTPSetup.Designer.cs b/src/KeePassOTPSetup.Designer.cs index 1fe9268..0043b85 100644 --- a/src/KeePassOTPSetup.Designer.cs +++ b/src/KeePassOTPSetup.Designer.cs @@ -50,20 +50,21 @@ private void InitializeComponent() this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.tcSetup = new System.Windows.Forms.TabControl(); this.tpSetup = new System.Windows.Forms.TabPage(); - this.gIssuerLabel = new System.Windows.Forms.GroupBox(); - this.bLabelFromEntry = new System.Windows.Forms.Button(); - this.bIssuerFromEntry = new System.Windows.Forms.Button(); - this.tbLabel = new System.Windows.Forms.TextBox(); - this.tbIssuer = new System.Windows.Forms.TextBox(); - this.lLabel = new System.Windows.Forms.Label(); - this.lIssuer = new System.Windows.Forms.Label(); this.gQRHelp = new System.Windows.Forms.GroupBox(); this.pbQR = new System.Windows.Forms.PictureBox(); this.lQRCodeScanScreenLabel = new System.Windows.Forms.Label(); + this.pbSearchScreen = new System.Windows.Forms.PictureBox(); this.lQRCodeDragDropLabel = new System.Windows.Forms.Label(); this.tpRecovery = new System.Windows.Forms.TabPage(); this.tbRecovery = new System.Windows.Forms.TextBox(); this.tpAdvanced = new System.Windows.Forms.TabPage(); + this.gIssuerLabel = new System.Windows.Forms.GroupBox(); + this.bLabelFromEntry = new System.Windows.Forms.Button(); + this.bIssuerFromEntry = new System.Windows.Forms.Button(); + this.tbLabel = new System.Windows.Forms.TextBox(); + this.tbIssuer = new System.Windows.Forms.TextBox(); + this.lLabel = new System.Windows.Forms.Label(); + this.lIssuer = new System.Windows.Forms.Label(); this.gTime = new System.Windows.Forms.GroupBox(); this.totpTimeCorrectionValue = new System.Windows.Forms.Label(); this.lTime = new System.Windows.Forms.Label(); @@ -87,18 +88,17 @@ private void InitializeComponent() this.lLength = new System.Windows.Forms.Label(); this.lType = new System.Windows.Forms.Label(); this.cbAdvanced = new System.Windows.Forms.CheckBox(); - this.pbSearchScreen = new System.Windows.Forms.PictureBox(); this.gSeed.SuspendLayout(); this.tcSetup.SuspendLayout(); this.tpSetup.SuspendLayout(); - this.gIssuerLabel.SuspendLayout(); this.gQRHelp.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pbQR)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbSearchScreen)).BeginInit(); this.tpRecovery.SuspendLayout(); this.tpAdvanced.SuspendLayout(); + this.gIssuerLabel.SuspendLayout(); this.gTime.SuspendLayout(); this.gOTP.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbSearchScreen)).BeginInit(); this.SuspendLayout(); // // gSeed @@ -174,7 +174,7 @@ private void InitializeComponent() // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonOK.Location = new System.Drawing.Point(562, 781); + this.buttonOK.Location = new System.Drawing.Point(562, 607); this.buttonOK.Margin = new System.Windows.Forms.Padding(5); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(178, 46); @@ -186,7 +186,7 @@ private void InitializeComponent() // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(770, 781); + this.buttonCancel.Location = new System.Drawing.Point(770, 607); this.buttonCancel.Margin = new System.Windows.Forms.Padding(5); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(178, 46); @@ -203,98 +203,21 @@ private void InitializeComponent() this.tcSetup.Location = new System.Drawing.Point(9, 8); this.tcSetup.Name = "tcSetup"; this.tcSetup.SelectedIndex = 0; - this.tcSetup.Size = new System.Drawing.Size(938, 743); + this.tcSetup.Size = new System.Drawing.Size(938, 599); this.tcSetup.TabIndex = 1; // // tpSetup // - this.tpSetup.Controls.Add(this.gIssuerLabel); this.tpSetup.Controls.Add(this.gQRHelp); this.tpSetup.Controls.Add(this.gSeed); this.tpSetup.Location = new System.Drawing.Point(10, 48); this.tpSetup.Name = "tpSetup"; this.tpSetup.Padding = new System.Windows.Forms.Padding(3); - this.tpSetup.Size = new System.Drawing.Size(918, 685); + this.tpSetup.Size = new System.Drawing.Size(918, 541); this.tpSetup.TabIndex = 0; this.tpSetup.Text = "tabPage1"; this.tpSetup.UseVisualStyleBackColor = true; // - // gIssuerLabel - // - this.gIssuerLabel.Controls.Add(this.bLabelFromEntry); - this.gIssuerLabel.Controls.Add(this.bIssuerFromEntry); - this.gIssuerLabel.Controls.Add(this.tbLabel); - this.gIssuerLabel.Controls.Add(this.tbIssuer); - this.gIssuerLabel.Controls.Add(this.lLabel); - this.gIssuerLabel.Controls.Add(this.lIssuer); - this.gIssuerLabel.Dock = System.Windows.Forms.DockStyle.Top; - this.gIssuerLabel.Location = new System.Drawing.Point(3, 532); - this.gIssuerLabel.Name = "gIssuerLabel"; - this.gIssuerLabel.Size = new System.Drawing.Size(912, 174); - this.gIssuerLabel.TabIndex = 905; - this.gIssuerLabel.TabStop = false; - this.gIssuerLabel.Text = "groupBox1"; - // - // bLabelFromEntry - // - this.bLabelFromEntry.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.bLabelFromEntry.AutoEllipsis = true; - this.bLabelFromEntry.Location = new System.Drawing.Point(656, 95); - this.bLabelFromEntry.Margin = new System.Windows.Forms.Padding(5); - this.bLabelFromEntry.Name = "bLabelFromEntry"; - this.bLabelFromEntry.Size = new System.Drawing.Size(230, 46); - this.bLabelFromEntry.TabIndex = 105; - this.bLabelFromEntry.Text = "OK"; - this.bLabelFromEntry.UseVisualStyleBackColor = true; - this.bLabelFromEntry.Click += new System.EventHandler(this.bLabelFromEntry_Click); - // - // bIssuerFromEntry - // - this.bIssuerFromEntry.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.bIssuerFromEntry.AutoEllipsis = true; - this.bIssuerFromEntry.Location = new System.Drawing.Point(656, 40); - this.bIssuerFromEntry.Margin = new System.Windows.Forms.Padding(5); - this.bIssuerFromEntry.Name = "bIssuerFromEntry"; - this.bIssuerFromEntry.Size = new System.Drawing.Size(230, 46); - this.bIssuerFromEntry.TabIndex = 103; - this.bIssuerFromEntry.Text = "OK"; - this.bIssuerFromEntry.UseVisualStyleBackColor = true; - this.bIssuerFromEntry.Click += new System.EventHandler(this.bIssuerFromEntry_Click); - // - // tbLabel - // - this.tbLabel.Location = new System.Drawing.Point(178, 100); - this.tbLabel.Name = "tbLabel"; - this.tbLabel.Size = new System.Drawing.Size(458, 38); - this.tbLabel.TabIndex = 104; - this.tbLabel.TextChanged += new System.EventHandler(this.UpdateIssuerLabel); - // - // tbIssuer - // - this.tbIssuer.Location = new System.Drawing.Point(180, 45); - this.tbIssuer.Name = "tbIssuer"; - this.tbIssuer.Size = new System.Drawing.Size(456, 38); - this.tbIssuer.TabIndex = 102; - this.tbIssuer.TextChanged += new System.EventHandler(this.UpdateIssuerLabel); - // - // lLabel - // - this.lLabel.AutoSize = true; - this.lLabel.Location = new System.Drawing.Point(14, 107); - this.lLabel.Name = "lLabel"; - this.lLabel.Size = new System.Drawing.Size(93, 32); - this.lLabel.TabIndex = 1; - this.lLabel.Text = "label2"; - // - // lIssuer - // - this.lIssuer.AutoSize = true; - this.lIssuer.Location = new System.Drawing.Point(16, 52); - this.lIssuer.Name = "lIssuer"; - this.lIssuer.Size = new System.Drawing.Size(93, 32); - this.lIssuer.TabIndex = 0; - this.lIssuer.Text = "label1"; - // // gQRHelp // this.gQRHelp.Controls.Add(this.pbQR); @@ -336,6 +259,20 @@ private void InitializeComponent() this.lQRCodeScanScreenLabel.Text = "N/A"; this.lQRCodeScanScreenLabel.Click += new System.EventHandler(this.bSearchScreen_Click); // + // pbSearchScreen + // + this.pbSearchScreen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.pbSearchScreen.InitialImage = null; + this.pbSearchScreen.Location = new System.Drawing.Point(17, 190); + this.pbSearchScreen.Margin = new System.Windows.Forms.Padding(5); + this.pbSearchScreen.Name = "pbSearchScreen"; + this.pbSearchScreen.Size = new System.Drawing.Size(124, 124); + this.pbSearchScreen.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbSearchScreen.TabIndex = 415; + this.pbSearchScreen.TabStop = false; + this.pbSearchScreen.Click += new System.EventHandler(this.bSearchScreen_Click); + this.pbSearchScreen.MouseHover += new System.EventHandler(this.bSearchScreen_MouseHover); + // // lQRCodeDragDropLabel // this.lQRCodeDragDropLabel.AutoSize = true; @@ -355,7 +292,7 @@ private void InitializeComponent() this.tpRecovery.Location = new System.Drawing.Point(10, 48); this.tpRecovery.Name = "tpRecovery"; this.tpRecovery.Padding = new System.Windows.Forms.Padding(3); - this.tpRecovery.Size = new System.Drawing.Size(918, 685); + this.tpRecovery.Size = new System.Drawing.Size(918, 511); this.tpRecovery.TabIndex = 1; this.tpRecovery.Text = "Recovery"; this.tpRecovery.UseVisualStyleBackColor = true; @@ -372,16 +309,95 @@ private void InitializeComponent() // // tpAdvanced // + this.tpAdvanced.Controls.Add(this.gIssuerLabel); this.tpAdvanced.Controls.Add(this.gTime); this.tpAdvanced.Controls.Add(this.gOTP); this.tpAdvanced.Controls.Add(this.cbAdvanced); this.tpAdvanced.Location = new System.Drawing.Point(10, 48); this.tpAdvanced.Name = "tpAdvanced"; this.tpAdvanced.Padding = new System.Windows.Forms.Padding(3); - this.tpAdvanced.Size = new System.Drawing.Size(918, 685); + this.tpAdvanced.Size = new System.Drawing.Size(918, 511); this.tpAdvanced.TabIndex = 2; this.tpAdvanced.Text = "tpAdvanced"; this.tpAdvanced.UseVisualStyleBackColor = true; + this.tpAdvanced.Enter += new System.EventHandler(this.tpAdvanced_Enter); + this.tpAdvanced.Leave += new System.EventHandler(this.tpAdvanced_Leave); + // + // gIssuerLabel + // + this.gIssuerLabel.Controls.Add(this.bLabelFromEntry); + this.gIssuerLabel.Controls.Add(this.bIssuerFromEntry); + this.gIssuerLabel.Controls.Add(this.tbLabel); + this.gIssuerLabel.Controls.Add(this.tbIssuer); + this.gIssuerLabel.Controls.Add(this.lLabel); + this.gIssuerLabel.Controls.Add(this.lIssuer); + this.gIssuerLabel.Dock = System.Windows.Forms.DockStyle.Top; + this.gIssuerLabel.Location = new System.Drawing.Point(3, 506); + this.gIssuerLabel.Name = "gIssuerLabel"; + this.gIssuerLabel.Size = new System.Drawing.Size(912, 174); + this.gIssuerLabel.TabIndex = 905; + this.gIssuerLabel.TabStop = false; + this.gIssuerLabel.Text = "groupBox1"; + // + // bLabelFromEntry + // + this.bLabelFromEntry.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.bLabelFromEntry.AutoEllipsis = true; + this.bLabelFromEntry.Location = new System.Drawing.Point(656, 95); + this.bLabelFromEntry.Margin = new System.Windows.Forms.Padding(5); + this.bLabelFromEntry.Name = "bLabelFromEntry"; + this.bLabelFromEntry.Size = new System.Drawing.Size(230, 46); + this.bLabelFromEntry.TabIndex = 105; + this.bLabelFromEntry.Text = "OK"; + this.bLabelFromEntry.UseVisualStyleBackColor = true; + this.bLabelFromEntry.Click += new System.EventHandler(this.bLabelFromEntry_Click); + // + // bIssuerFromEntry + // + this.bIssuerFromEntry.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.bIssuerFromEntry.AutoEllipsis = true; + this.bIssuerFromEntry.Location = new System.Drawing.Point(656, 40); + this.bIssuerFromEntry.Margin = new System.Windows.Forms.Padding(5); + this.bIssuerFromEntry.Name = "bIssuerFromEntry"; + this.bIssuerFromEntry.Size = new System.Drawing.Size(230, 46); + this.bIssuerFromEntry.TabIndex = 103; + this.bIssuerFromEntry.Text = "OK"; + this.bIssuerFromEntry.UseVisualStyleBackColor = true; + this.bIssuerFromEntry.Click += new System.EventHandler(this.bIssuerFromEntry_Click); + // + // tbLabel + // + this.tbLabel.Location = new System.Drawing.Point(178, 100); + this.tbLabel.Name = "tbLabel"; + this.tbLabel.Size = new System.Drawing.Size(458, 38); + this.tbLabel.TabIndex = 104; + this.tbLabel.TextChanged += new System.EventHandler(this.UpdateIssuerLabel); + // + // tbIssuer + // + this.tbIssuer.Location = new System.Drawing.Point(180, 45); + this.tbIssuer.Name = "tbIssuer"; + this.tbIssuer.Size = new System.Drawing.Size(456, 38); + this.tbIssuer.TabIndex = 102; + this.tbIssuer.TextChanged += new System.EventHandler(this.UpdateIssuerLabel); + // + // lLabel + // + this.lLabel.AutoSize = true; + this.lLabel.Location = new System.Drawing.Point(14, 107); + this.lLabel.Name = "lLabel"; + this.lLabel.Size = new System.Drawing.Size(93, 32); + this.lLabel.TabIndex = 1; + this.lLabel.Text = "label2"; + // + // lIssuer + // + this.lIssuer.AutoSize = true; + this.lIssuer.Location = new System.Drawing.Point(16, 52); + this.lIssuer.Name = "lIssuer"; + this.lIssuer.Size = new System.Drawing.Size(93, 32); + this.lIssuer.TabIndex = 0; + this.lIssuer.Text = "label1"; // // gTime // @@ -644,27 +660,13 @@ private void InitializeComponent() this.cbAdvanced.UseVisualStyleBackColor = true; this.cbAdvanced.CheckedChanged += new System.EventHandler(this.cbAdvanced_CheckedChanged); // - // pbSearchScreen - // - this.pbSearchScreen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.pbSearchScreen.InitialImage = null; - this.pbSearchScreen.Location = new System.Drawing.Point(17, 190); - this.pbSearchScreen.Margin = new System.Windows.Forms.Padding(5); - this.pbSearchScreen.Name = "pbSearchScreen"; - this.pbSearchScreen.Size = new System.Drawing.Size(124, 124); - this.pbSearchScreen.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pbSearchScreen.TabIndex = 415; - this.pbSearchScreen.TabStop = false; - this.pbSearchScreen.Click += new System.EventHandler(this.bSearchScreen_Click); - this.pbSearchScreen.MouseHover += new System.EventHandler(this.bSearchScreen_MouseHover); - // // KeePassOTPSetup // this.AcceptButton = this.buttonOK; this.AutoScaleDimensions = new System.Drawing.SizeF(16F, 31F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(956, 840); + this.ClientSize = new System.Drawing.Size(956, 666); this.Controls.Add(this.tcSetup); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); @@ -682,20 +684,20 @@ private void InitializeComponent() this.gSeed.PerformLayout(); this.tcSetup.ResumeLayout(false); this.tpSetup.ResumeLayout(false); - this.gIssuerLabel.ResumeLayout(false); - this.gIssuerLabel.PerformLayout(); this.gQRHelp.ResumeLayout(false); this.gQRHelp.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pbQR)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbSearchScreen)).EndInit(); this.tpRecovery.ResumeLayout(false); this.tpRecovery.PerformLayout(); this.tpAdvanced.ResumeLayout(false); this.tpAdvanced.PerformLayout(); + this.gIssuerLabel.ResumeLayout(false); + this.gIssuerLabel.PerformLayout(); this.gTime.ResumeLayout(false); this.gTime.PerformLayout(); this.gOTP.ResumeLayout(false); this.gOTP.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pbSearchScreen)).EndInit(); this.ResumeLayout(false); } diff --git a/src/KeePassOTPSetup.cs b/src/KeePassOTPSetup.cs index 79e8326..42fdfba 100644 --- a/src/KeePassOTPSetup.cs +++ b/src/KeePassOTPSetup.cs @@ -703,5 +703,17 @@ private void bSearchScreen_MouseHover(object sender, EventArgs e) { toolTip1.Show(PluginTranslate.ReadScreenForQRCode, pbSearchScreen); } - } + + private void tpAdvanced_Leave(object sender, EventArgs e) + { + tcSetup.Height -= gIssuerLabel.Height; + this.Height -= gIssuerLabel.Height; + } + + private void tpAdvanced_Enter(object sender, EventArgs e) + { + tcSetup.Height += gIssuerLabel.Height; + this.Height += gIssuerLabel.Height; + } + } } \ No newline at end of file diff --git a/src/Properties/AssemblyInfo.cs b/src/Properties/AssemblyInfo.cs index 0471114..c0079b7 100644 --- a/src/Properties/AssemblyInfo.cs +++ b/src/Properties/AssemblyInfo.cs @@ -11,7 +11,7 @@ [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCompany ("rookiestyle")] [assembly: AssemblyProduct ("KeePass Plugin")] -[assembly: AssemblyCopyright("Copyright 2021 - 2022")] +[assembly: AssemblyCopyright("Copyright 2021 - 2023")] [assembly: AssemblyTrademark ("")] [assembly: AssemblyCulture ("")] // Setting ComVisible to false makes the types in this assembly not visible @@ -30,5 +30,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.6.2")] -[assembly: AssemblyFileVersion("1.6.2")] +[assembly: AssemblyVersion("1.6.3")] +[assembly: AssemblyFileVersion("1.6.3")] diff --git a/version.info b/version.info index 1537adc..b0d994c 100644 --- a/version.info +++ b/version.info @@ -1,5 +1,5 @@ : -KeePassOTP:1.6.2 +KeePassOTP:1.6.3 KeePassOTP!de:23 KeePassOTP!fr:7 KeePassOTP!nl:3