From 501dcb32357ba05fb918fe8234d30abbd9afcfe6 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Sun, 14 Apr 2024 15:46:02 +0200 Subject: [PATCH] Updates UI tweaks --- app/Updates.Designer.cs | 112 ++++++++++++++++++++++++++++++++++++---- app/Updates.cs | 3 ++ 2 files changed, 105 insertions(+), 10 deletions(-) diff --git a/app/Updates.Designer.cs b/app/Updates.Designer.cs index d72c08f5..80291320 100644 --- a/app/Updates.Designer.cs +++ b/app/Updates.Designer.cs @@ -42,12 +42,18 @@ namespace GHelper panelDriversTitle = new Panel(); labelDrivers = new Label(); pictureDrivers = new PictureBox(); + tableLayoutLegend = new TableLayoutPanel(); + labelLegendGreen = new Label(); + labelLegendGray = new Label(); + labelLegendRed = new Label(); + labelLegend = new Label(); ((System.ComponentModel.ISupportInitialize)pictureBios).BeginInit(); panelBiosTitle.SuspendLayout(); panelBios.SuspendLayout(); panelDrivers.SuspendLayout(); panelDriversTitle.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)pictureDrivers).BeginInit(); + tableLayoutLegend.SuspendLayout(); SuspendLayout(); // // tableBios @@ -99,14 +105,14 @@ namespace GHelper panelBiosTitle.Location = new Point(0, 0); panelBiosTitle.Margin = new Padding(4); panelBiosTitle.Name = "panelBiosTitle"; - panelBiosTitle.Size = new Size(1294, 62); + panelBiosTitle.Size = new Size(1236, 60); panelBiosTitle.TabIndex = 3; // // labelUpdates // labelUpdates.Anchor = AnchorStyles.Top | AnchorStyles.Right; labelUpdates.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); - labelUpdates.Location = new Point(848, 23); + labelUpdates.Location = new Point(919, 19); labelUpdates.Name = "labelUpdates"; labelUpdates.Size = new Size(245, 32); labelUpdates.TabIndex = 4; @@ -122,7 +128,7 @@ namespace GHelper buttonRefresh.FlatAppearance.BorderSize = 0; buttonRefresh.FlatStyle = FlatStyle.Flat; buttonRefresh.Image = Properties.Resources.icons8_refresh_32; - buttonRefresh.Location = new Point(1221, 14); + buttonRefresh.Location = new Point(1172, 11); buttonRefresh.Name = "buttonRefresh"; buttonRefresh.Secondary = true; buttonRefresh.Size = new Size(52, 46); @@ -134,11 +140,11 @@ namespace GHelper panelBios.AutoSize = true; panelBios.Controls.Add(tableBios); panelBios.Dock = DockStyle.Top; - panelBios.Location = new Point(0, 62); + panelBios.Location = new Point(0, 60); panelBios.Margin = new Padding(4); panelBios.Name = "panelBios"; panelBios.Padding = new Padding(20); - panelBios.Size = new Size(1294, 40); + panelBios.Size = new Size(1236, 40); panelBios.TabIndex = 4; // // panelDrivers @@ -146,11 +152,11 @@ namespace GHelper panelDrivers.AutoSize = true; panelDrivers.Controls.Add(tableDrivers); panelDrivers.Dock = DockStyle.Top; - panelDrivers.Location = new Point(0, 146); + panelDrivers.Location = new Point(0, 144); panelDrivers.Margin = new Padding(4); panelDrivers.Name = "panelDrivers"; panelDrivers.Padding = new Padding(20); - panelDrivers.Size = new Size(1294, 40); + panelDrivers.Size = new Size(1236, 40); panelDrivers.TabIndex = 6; // // tableDrivers @@ -175,10 +181,10 @@ namespace GHelper panelDriversTitle.Controls.Add(labelDrivers); panelDriversTitle.Controls.Add(pictureDrivers); panelDriversTitle.Dock = DockStyle.Top; - panelDriversTitle.Location = new Point(0, 102); + panelDriversTitle.Location = new Point(0, 100); panelDriversTitle.Margin = new Padding(4); panelDriversTitle.Name = "panelDriversTitle"; - panelDriversTitle.Size = new Size(1294, 44); + panelDriversTitle.Size = new Size(1236, 44); panelDriversTitle.TabIndex = 5; // // labelDrivers @@ -203,12 +209,91 @@ namespace GHelper pictureDrivers.TabIndex = 2; pictureDrivers.TabStop = false; // + // tableLayoutLegend + // + tableLayoutLegend.AutoSize = true; + tableLayoutLegend.AutoSizeMode = AutoSizeMode.GrowAndShrink; + tableLayoutLegend.ColumnCount = 4; + tableLayoutLegend.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 15.151515F)); + tableLayoutLegend.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 28.2828274F)); + tableLayoutLegend.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 28.2828274F)); + tableLayoutLegend.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 28.2828274F)); + tableLayoutLegend.Controls.Add(labelLegendGreen, 0, 0); + tableLayoutLegend.Controls.Add(labelLegendGray, 0, 0); + tableLayoutLegend.Controls.Add(labelLegendRed, 1, 0); + tableLayoutLegend.Controls.Add(labelLegend, 0, 0); + tableLayoutLegend.Dock = DockStyle.Bottom; + tableLayoutLegend.Location = new Point(0, 608); + tableLayoutLegend.Margin = new Padding(0); + tableLayoutLegend.Name = "tableLayoutLegend"; + tableLayoutLegend.Padding = new Padding(10, 0, 10, 20); + tableLayoutLegend.RowCount = 1; + tableLayoutLegend.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); + tableLayoutLegend.Size = new Size(1236, 82); + tableLayoutLegend.TabIndex = 7; + // + // labelLegendGreen + // + labelLegendGreen.AutoSize = true; + labelLegendGreen.BackColor = Color.Green; + labelLegendGreen.Dock = DockStyle.Top; + labelLegendGreen.ForeColor = Color.White; + labelLegendGreen.Location = new Point(547, 10); + labelLegendGreen.Margin = new Padding(10); + labelLegendGreen.Name = "labelLegendGreen"; + labelLegendGreen.Padding = new Padding(5); + labelLegendGreen.Size = new Size(323, 42); + labelLegendGreen.TabIndex = 4; + labelLegendGreen.Text = "Updated"; + // + // labelLegendGray + // + labelLegendGray.AutoSize = true; + labelLegendGray.BackColor = Color.Gray; + labelLegendGray.Dock = DockStyle.Top; + labelLegendGray.ForeColor = Color.White; + labelLegendGray.Location = new Point(204, 10); + labelLegendGray.Margin = new Padding(10); + labelLegendGray.Name = "labelLegendGray"; + labelLegendGray.Padding = new Padding(5); + labelLegendGray.Size = new Size(323, 42); + labelLegendGray.TabIndex = 3; + labelLegendGray.Text = "Can't check local version"; + // + // labelLegendRed + // + labelLegendRed.AutoSize = true; + labelLegendRed.BackColor = Color.Red; + labelLegendRed.Dock = DockStyle.Top; + labelLegendRed.ForeColor = Color.White; + labelLegendRed.Location = new Point(890, 10); + labelLegendRed.Margin = new Padding(10); + labelLegendRed.Name = "labelLegendRed"; + labelLegendRed.Padding = new Padding(5); + labelLegendRed.Size = new Size(326, 42); + labelLegendRed.TabIndex = 1; + labelLegendRed.Text = "Update Available"; + // + // labelLegend + // + labelLegend.AutoSize = true; + labelLegend.Dock = DockStyle.Top; + labelLegend.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelLegend.Location = new Point(20, 10); + labelLegend.Margin = new Padding(10); + labelLegend.Name = "labelLegend"; + labelLegend.Padding = new Padding(5); + labelLegend.Size = new Size(164, 42); + labelLegend.TabIndex = 0; + labelLegend.Text = "Legend"; + // // Updates // AutoScaleDimensions = new SizeF(192F, 192F); AutoScaleMode = AutoScaleMode.Dpi; AutoScroll = true; - ClientSize = new Size(1294, 690); + ClientSize = new Size(1236, 690); + Controls.Add(tableLayoutLegend); Controls.Add(panelDrivers); Controls.Add(panelDriversTitle); Controls.Add(panelBios); @@ -229,6 +314,8 @@ namespace GHelper panelDriversTitle.ResumeLayout(false); panelDriversTitle.PerformLayout(); ((System.ComponentModel.ISupportInitialize)pictureDrivers).EndInit(); + tableLayoutLegend.ResumeLayout(false); + tableLayoutLegend.PerformLayout(); ResumeLayout(false); PerformLayout(); } @@ -247,5 +334,10 @@ namespace GHelper private PictureBox pictureDrivers; private RButton buttonRefresh; private Label labelUpdates; + private TableLayoutPanel tableLayoutLegend; + private Label labelLegend; + private Label labelLegendRed; + private Label labelLegendGray; + private Label labelLegendGreen; } } \ No newline at end of file diff --git a/app/Updates.cs b/app/Updates.cs index 736c99fa..4f3bf8dc 100644 --- a/app/Updates.cs +++ b/app/Updates.cs @@ -54,6 +54,9 @@ namespace GHelper tableBios.Visible = false; tableDrivers.Visible = false; + labelLegendGreen.BackColor = colorEco; + labelLegendRed.BackColor = colorTurbo; + ClearTable(tableBios); ClearTable(tableDrivers);