From ecb47dee846002968630fc350a8d902ea33d5578 Mon Sep 17 00:00:00 2001 From: Phap Dieu Duong Date: Fri, 1 Nov 2024 15:16:33 +0800 Subject: [PATCH] Tooltip in Crop, Color Picker tool: make it theme-aware --- Source/.editorconfig | 8 +- .../Tools/FrmColorPicker.Designer.cs | 236 ++++--- Source/ImageGlass/Tools/FrmColorPicker.cs | 4 +- Source/ImageGlass/Tools/FrmColorPicker.resx | 24 +- Source/ImageGlass/Tools/FrmCrop.Designer.cs | 656 +++++++++--------- Source/ImageGlass/Tools/FrmCrop.cs | 1 + Source/ImageGlass/Tools/FrmCrop.resx | 124 ++-- 7 files changed, 535 insertions(+), 518 deletions(-) diff --git a/Source/.editorconfig b/Source/.editorconfig index a4f94ed4d..c36c19508 100644 --- a/Source/.editorconfig +++ b/Source/.editorconfig @@ -22,7 +22,7 @@ dotnet_analyzer_diagnostic.category-Style.severity = none dotnet_diagnostic.CA1707.severity = none csharp_using_directive_placement = outside_namespace:silent csharp_prefer_simple_using_statement = true:suggestion -csharp_prefer_braces = when_multiline:silent +csharp_prefer_braces = false:silent csharp_style_namespace_declarations = file_scoped:silent csharp_style_prefer_method_group_conversion = true:silent csharp_style_prefer_top_level_statements = true:silent @@ -49,7 +49,7 @@ dotnet_diagnostic.CA2211.severity = none dotnet_diagnostic.IDE0008.severity = none csharp_prefer_system_threading_lock = true:suggestion csharp_style_inlined_variable_declaration = true:suggestion -csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_style_deconstructed_variable_declaration = false:suggestion csharp_style_var_for_built_in_types = false:silent csharp_style_var_when_type_is_apparent = false:silent csharp_style_var_elsewhere = false:silent @@ -139,8 +139,8 @@ end_of_line = crlf dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion dotnet_style_collection_initializer = true:suggestion dotnet_style_prefer_simplified_boolean_expressions = true:suggestion -dotnet_style_prefer_conditional_expression_over_assignment = true:silent -dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_prefer_conditional_expression_over_assignment = false:silent +dotnet_style_prefer_conditional_expression_over_return = false:silent dotnet_style_explicit_tuple_names = true:suggestion dotnet_style_prefer_inferred_tuple_names = true:suggestion dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion diff --git a/Source/ImageGlass/Tools/FrmColorPicker.Designer.cs b/Source/ImageGlass/Tools/FrmColorPicker.Designer.cs index 98b7eb66c..c01843939 100644 --- a/Source/ImageGlass/Tools/FrmColorPicker.Designer.cs +++ b/Source/ImageGlass/Tools/FrmColorPicker.Designer.cs @@ -28,9 +28,11 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmColorPicker)); TableLayout = new TableLayoutPanel(); + BtnCopyCIELab = new UI.ModernButton(); + TxtCIELAB = new UI.ModernTextBox(); + LblCIELAB = new UI.ModernLabel(); BtnSettings = new UI.ModernButton(); BtnCopyHsv = new UI.ModernButton(); BtnCopyHsl = new UI.ModernButton(); @@ -52,10 +54,7 @@ private void InitializeComponent() LblHsl = new UI.ModernLabel(); TxtLocation = new UI.ModernTextBox(); BtnCopyLocation = new UI.ModernButton(); - TooltipMain = new ToolTip(components); - LblCIELAB = new UI.ModernLabel(); - TxtCIELAB = new UI.ModernTextBox(); - BtnCopyCIELab = new UI.ModernButton(); + TooltipMain = new UI.ModernTooltip(); TableLayout.SuspendLayout(); PanColor.SuspendLayout(); SuspendLayout(); @@ -95,7 +94,7 @@ private void InitializeComponent() TableLayout.Location = new Point(0, 0); TableLayout.Margin = new Padding(0); TableLayout.Name = "TableLayout"; - TableLayout.Padding = new Padding(40); + TableLayout.Padding = new Padding(16, 13, 16, 13); TableLayout.RowCount = 8; TableLayout.RowStyles.Add(new RowStyle()); TableLayout.RowStyles.Add(new RowStyle()); @@ -105,20 +104,64 @@ private void InitializeComponent() TableLayout.RowStyles.Add(new RowStyle()); TableLayout.RowStyles.Add(new RowStyle()); TableLayout.RowStyles.Add(new RowStyle()); - TableLayout.Size = new Size(660, 640); + TableLayout.Size = new Size(257, 253); TableLayout.TabIndex = 0; // + // BtnCopyCIELab + // + BtnCopyCIELab.Anchor = AnchorStyles.Right; + BtnCopyCIELab.DarkMode = true; + BtnCopyCIELab.Image = (Image)resources.GetObject("BtnCopyCIELab.Image"); + BtnCopyCIELab.ImagePadding = 0; + BtnCopyCIELab.Location = new Point(240, 215); + BtnCopyCIELab.Margin = new Padding(4, 0, 0, 0); + BtnCopyCIELab.Name = "BtnCopyCIELab"; + BtnCopyCIELab.Padding = new Padding(3, 3, 3, 3); + BtnCopyCIELab.Size = new Size(31, 20); + BtnCopyCIELab.SvgIcon = UI.IconName.Copy; + BtnCopyCIELab.SystemIcon = null; + BtnCopyCIELab.TabIndex = 15; + BtnCopyCIELab.TextImageRelation = TextImageRelation.ImageBeforeText; + BtnCopyCIELab.Click += BtnCopyCIELab_Click; + // + // TxtCIELAB + // + TxtCIELAB.BackColor = Color.FromArgb(69, 73, 74); + TxtCIELAB.BorderStyle = BorderStyle.FixedSingle; + TxtCIELAB.DarkMode = true; + TxtCIELAB.Dock = DockStyle.Fill; + TxtCIELAB.ForeColor = Color.FromArgb(210, 210, 210); + TxtCIELAB.Location = new Point(74, 214); + TxtCIELAB.Margin = new Padding(0, 3, 0, 3); + TxtCIELAB.Name = "TxtCIELAB"; + TxtCIELAB.ReadOnly = true; + TxtCIELAB.Size = new Size(162, 23); + TxtCIELAB.TabIndex = 14; + // + // LblCIELAB + // + LblCIELAB.Anchor = AnchorStyles.Left; + LblCIELAB.AutoSize = true; + LblCIELAB.BackColor = Color.Transparent; + LblCIELAB.DarkMode = true; + LblCIELAB.Location = new Point(17, 218); + LblCIELAB.Margin = new Padding(1, 0, 1, 0); + LblCIELAB.Name = "LblCIELAB"; + LblCIELAB.Size = new Size(56, 15); + LblCIELAB.TabIndex = 13; + LblCIELAB.Text = "[CIELAB:]"; + // // BtnSettings // BtnSettings.Anchor = AnchorStyles.Top | AnchorStyles.Right; BtnSettings.DarkMode = true; BtnSettings.Image = (Image)resources.GetObject("BtnSettings.Image"); BtnSettings.ImagePadding = 0; - BtnSettings.Location = new Point(540, 40); - BtnSettings.Margin = new Padding(10, 0, 0, 10); + BtnSettings.Location = new Point(240, 13); + BtnSettings.Margin = new Padding(4, 0, 0, 3); BtnSettings.Name = "BtnSettings"; - BtnSettings.Padding = new Padding(8); - BtnSettings.Size = new Size(80, 60); + BtnSettings.Padding = new Padding(3, 3, 3, 3); + BtnSettings.Size = new Size(31, 20); BtnSettings.SvgIcon = UI.IconName.Setting; BtnSettings.SystemIcon = null; BtnSettings.TabIndex = 12; @@ -131,11 +174,11 @@ private void InitializeComponent() BtnCopyHsv.DarkMode = true; BtnCopyHsv.Image = (Image)resources.GetObject("BtnCopyHsv.Image"); BtnCopyHsv.ImagePadding = 0; - BtnCopyHsv.Location = new Point(540, 465); - BtnCopyHsv.Margin = new Padding(10, 0, 0, 0); + BtnCopyHsv.Location = new Point(240, 186); + BtnCopyHsv.Margin = new Padding(4, 0, 0, 0); BtnCopyHsv.Name = "BtnCopyHsv"; - BtnCopyHsv.Padding = new Padding(8); - BtnCopyHsv.Size = new Size(80, 60); + BtnCopyHsv.Padding = new Padding(3, 3, 3, 3); + BtnCopyHsv.Size = new Size(31, 20); BtnCopyHsv.SvgIcon = UI.IconName.Copy; BtnCopyHsv.SystemIcon = null; BtnCopyHsv.TabIndex = 11; @@ -148,11 +191,11 @@ private void InitializeComponent() BtnCopyHsl.DarkMode = true; BtnCopyHsl.Image = (Image)resources.GetObject("BtnCopyHsl.Image"); BtnCopyHsl.ImagePadding = 0; - BtnCopyHsl.Location = new Point(540, 395); - BtnCopyHsl.Margin = new Padding(10, 0, 0, 0); + BtnCopyHsl.Location = new Point(240, 157); + BtnCopyHsl.Margin = new Padding(4, 0, 0, 0); BtnCopyHsl.Name = "BtnCopyHsl"; - BtnCopyHsl.Padding = new Padding(8); - BtnCopyHsl.Size = new Size(80, 60); + BtnCopyHsl.Padding = new Padding(3, 3, 3, 3); + BtnCopyHsl.Size = new Size(31, 20); BtnCopyHsl.SvgIcon = UI.IconName.Copy; BtnCopyHsl.SystemIcon = null; BtnCopyHsl.TabIndex = 9; @@ -165,11 +208,11 @@ private void InitializeComponent() BtnCopyCmyk.DarkMode = true; BtnCopyCmyk.Image = (Image)resources.GetObject("BtnCopyCmyk.Image"); BtnCopyCmyk.ImagePadding = 0; - BtnCopyCmyk.Location = new Point(540, 325); - BtnCopyCmyk.Margin = new Padding(10, 0, 0, 0); + BtnCopyCmyk.Location = new Point(240, 128); + BtnCopyCmyk.Margin = new Padding(4, 0, 0, 0); BtnCopyCmyk.Name = "BtnCopyCmyk"; - BtnCopyCmyk.Padding = new Padding(8); - BtnCopyCmyk.Size = new Size(80, 60); + BtnCopyCmyk.Padding = new Padding(3, 3, 3, 3); + BtnCopyCmyk.Size = new Size(31, 20); BtnCopyCmyk.SvgIcon = UI.IconName.Copy; BtnCopyCmyk.SystemIcon = null; BtnCopyCmyk.TabIndex = 7; @@ -182,11 +225,11 @@ private void InitializeComponent() BtnCopyHex.DarkMode = true; BtnCopyHex.Image = (Image)resources.GetObject("BtnCopyHex.Image"); BtnCopyHex.ImagePadding = 0; - BtnCopyHex.Location = new Point(540, 255); - BtnCopyHex.Margin = new Padding(10, 0, 0, 0); + BtnCopyHex.Location = new Point(240, 99); + BtnCopyHex.Margin = new Padding(4, 0, 0, 0); BtnCopyHex.Name = "BtnCopyHex"; - BtnCopyHex.Padding = new Padding(8); - BtnCopyHex.Size = new Size(80, 60); + BtnCopyHex.Padding = new Padding(3, 3, 3, 3); + BtnCopyHex.Size = new Size(31, 20); BtnCopyHex.SvgIcon = UI.IconName.Copy; BtnCopyHex.SystemIcon = null; BtnCopyHex.TabIndex = 5; @@ -199,11 +242,11 @@ private void InitializeComponent() BtnCopyRgb.DarkMode = true; BtnCopyRgb.Image = (Image)resources.GetObject("BtnCopyRgb.Image"); BtnCopyRgb.ImagePadding = 0; - BtnCopyRgb.Location = new Point(540, 185); - BtnCopyRgb.Margin = new Padding(10, 0, 0, 0); + BtnCopyRgb.Location = new Point(240, 70); + BtnCopyRgb.Margin = new Padding(4, 0, 0, 0); BtnCopyRgb.Name = "BtnCopyRgb"; - BtnCopyRgb.Padding = new Padding(8); - BtnCopyRgb.Size = new Size(80, 60); + BtnCopyRgb.Padding = new Padding(3, 3, 3, 3); + BtnCopyRgb.Size = new Size(31, 20); BtnCopyRgb.SvgIcon = UI.IconName.Copy; BtnCopyRgb.SystemIcon = null; BtnCopyRgb.TabIndex = 3; @@ -217,11 +260,11 @@ private void InitializeComponent() TxtHsv.DarkMode = true; TxtHsv.Dock = DockStyle.Fill; TxtHsv.ForeColor = Color.FromArgb(210, 210, 210); - TxtHsv.Location = new Point(173, 470); - TxtHsv.Margin = new Padding(0, 10, 0, 10); + TxtHsv.Location = new Point(74, 185); + TxtHsv.Margin = new Padding(0, 3, 0, 3); TxtHsv.Name = "TxtHsv"; TxtHsv.ReadOnly = true; - TxtHsv.Size = new Size(342, 50); + TxtHsv.Size = new Size(162, 23); TxtHsv.TabIndex = 10; // // TxtHsl @@ -231,11 +274,11 @@ private void InitializeComponent() TxtHsl.DarkMode = true; TxtHsl.Dock = DockStyle.Fill; TxtHsl.ForeColor = Color.FromArgb(210, 210, 210); - TxtHsl.Location = new Point(173, 400); - TxtHsl.Margin = new Padding(0, 10, 0, 10); + TxtHsl.Location = new Point(74, 156); + TxtHsl.Margin = new Padding(0, 3, 0, 3); TxtHsl.Name = "TxtHsl"; TxtHsl.ReadOnly = true; - TxtHsl.Size = new Size(342, 50); + TxtHsl.Size = new Size(162, 23); TxtHsl.TabIndex = 8; // // TxtCmyk @@ -245,11 +288,11 @@ private void InitializeComponent() TxtCmyk.DarkMode = true; TxtCmyk.Dock = DockStyle.Fill; TxtCmyk.ForeColor = Color.FromArgb(210, 210, 210); - TxtCmyk.Location = new Point(173, 330); - TxtCmyk.Margin = new Padding(0, 10, 0, 10); + TxtCmyk.Location = new Point(74, 127); + TxtCmyk.Margin = new Padding(0, 3, 0, 3); TxtCmyk.Name = "TxtCmyk"; TxtCmyk.ReadOnly = true; - TxtCmyk.Size = new Size(342, 50); + TxtCmyk.Size = new Size(162, 23); TxtCmyk.TabIndex = 6; // // TxtHex @@ -259,11 +302,11 @@ private void InitializeComponent() TxtHex.DarkMode = true; TxtHex.Dock = DockStyle.Fill; TxtHex.ForeColor = Color.FromArgb(210, 210, 210); - TxtHex.Location = new Point(173, 260); - TxtHex.Margin = new Padding(0, 10, 0, 10); + TxtHex.Location = new Point(74, 98); + TxtHex.Margin = new Padding(0, 3, 0, 3); TxtHex.Name = "TxtHex"; TxtHex.ReadOnly = true; - TxtHex.Size = new Size(342, 50); + TxtHex.Size = new Size(162, 23); TxtHex.TabIndex = 4; // // TxtRgb @@ -273,11 +316,11 @@ private void InitializeComponent() TxtRgb.DarkMode = true; TxtRgb.Dock = DockStyle.Fill; TxtRgb.ForeColor = Color.FromArgb(210, 210, 210); - TxtRgb.Location = new Point(173, 190); - TxtRgb.Margin = new Padding(0, 10, 0, 10); + TxtRgb.Location = new Point(74, 69); + TxtRgb.Margin = new Padding(0, 3, 0, 3); TxtRgb.Name = "TxtRgb"; TxtRgb.ReadOnly = true; - TxtRgb.Size = new Size(342, 50); + TxtRgb.Size = new Size(162, 23); TxtRgb.TabIndex = 2; // // LblHsv @@ -286,9 +329,10 @@ private void InitializeComponent() LblHsv.AutoSize = true; LblHsv.BackColor = Color.Transparent; LblHsv.DarkMode = true; - LblHsv.Location = new Point(43, 472); + LblHsv.Location = new Point(17, 189); + LblHsv.Margin = new Padding(1, 0, 1, 0); LblHsv.Name = "LblHsv"; - LblHsv.Size = new Size(126, 45); + LblHsv.Size = new Size(47, 15); LblHsv.TabIndex = 6; LblHsv.Text = "[HSVA:]"; // @@ -298,10 +342,10 @@ private void InitializeComponent() LblLocation.AutoSize = true; LblLocation.BackColor = Color.Transparent; LblLocation.DarkMode = true; - LblLocation.Location = new Point(40, 122); + LblLocation.Location = new Point(16, 44); LblLocation.Margin = new Padding(0); LblLocation.Name = "LblLocation"; - LblLocation.Size = new Size(100, 45); + LblLocation.Size = new Size(38, 15); LblLocation.TabIndex = 1; LblLocation.Text = "[X, Y:]"; // @@ -312,10 +356,10 @@ private void InitializeComponent() TableLayout.SetColumnSpan(PanColor, 2); PanColor.Controls.Add(LblCursorLocation); PanColor.Dock = DockStyle.Fill; - PanColor.Location = new Point(40, 40); - PanColor.Margin = new Padding(0, 0, 0, 10); + PanColor.Location = new Point(16, 13); + PanColor.Margin = new Padding(0, 0, 0, 3); PanColor.Name = "PanColor"; - PanColor.Size = new Size(475, 60); + PanColor.Size = new Size(220, 21); PanColor.TabIndex = 0; // // LblCursorLocation @@ -325,8 +369,9 @@ private void InitializeComponent() LblCursorLocation.Dock = DockStyle.Fill; LblCursorLocation.ForeColor = Color.White; LblCursorLocation.Location = new Point(0, 0); + LblCursorLocation.Margin = new Padding(1, 0, 1, 0); LblCursorLocation.Name = "LblCursorLocation"; - LblCursorLocation.Size = new Size(473, 58); + LblCursorLocation.Size = new Size(218, 19); LblCursorLocation.TabIndex = 0; LblCursorLocation.TextAlign = ContentAlignment.MiddleCenter; // @@ -336,10 +381,10 @@ private void InitializeComponent() LblRgb.AutoSize = true; LblRgb.BackColor = Color.Transparent; LblRgb.DarkMode = true; - LblRgb.Location = new Point(40, 192); + LblRgb.Location = new Point(16, 73); LblRgb.Margin = new Padding(0); LblRgb.Name = "LblRgb"; - LblRgb.Size = new Size(127, 45); + LblRgb.Size = new Size(48, 15); LblRgb.TabIndex = 2; LblRgb.Text = "[RGBA:]"; // @@ -349,9 +394,10 @@ private void InitializeComponent() LblHex.AutoSize = true; LblHex.BackColor = Color.Transparent; LblHex.DarkMode = true; - LblHex.Location = new Point(43, 262); + LblHex.Location = new Point(17, 102); + LblHex.Margin = new Padding(1, 0, 1, 0); LblHex.Name = "LblHex"; - LblHex.Size = new Size(126, 45); + LblHex.Size = new Size(48, 15); LblHex.TabIndex = 3; LblHex.Text = "[HEXA:]"; // @@ -361,10 +407,10 @@ private void InitializeComponent() LblCmyk.AutoSize = true; LblCmyk.BackColor = Color.Transparent; LblCmyk.DarkMode = true; - LblCmyk.Location = new Point(40, 332); + LblCmyk.Location = new Point(16, 131); LblCmyk.Margin = new Padding(0); LblCmyk.Name = "LblCmyk"; - LblCmyk.Size = new Size(133, 45); + LblCmyk.Size = new Size(51, 15); LblCmyk.TabIndex = 4; LblCmyk.Text = "[CMYK:]"; // @@ -374,10 +420,10 @@ private void InitializeComponent() LblHsl.AutoSize = true; LblHsl.BackColor = Color.Transparent; LblHsl.DarkMode = true; - LblHsl.Location = new Point(40, 402); + LblHsl.Location = new Point(16, 160); LblHsl.Margin = new Padding(0); LblHsl.Name = "LblHsl"; - LblHsl.Size = new Size(124, 45); + LblHsl.Size = new Size(47, 15); LblHsl.TabIndex = 5; LblHsl.Text = "[HSLA:]"; // @@ -388,11 +434,11 @@ private void InitializeComponent() TxtLocation.DarkMode = true; TxtLocation.Dock = DockStyle.Fill; TxtLocation.ForeColor = Color.FromArgb(210, 210, 210); - TxtLocation.Location = new Point(173, 120); - TxtLocation.Margin = new Padding(0, 10, 0, 10); + TxtLocation.Location = new Point(74, 40); + TxtLocation.Margin = new Padding(0, 3, 0, 3); TxtLocation.Name = "TxtLocation"; TxtLocation.ReadOnly = true; - TxtLocation.Size = new Size(342, 50); + TxtLocation.Size = new Size(162, 23); TxtLocation.TabIndex = 0; // // BtnCopyLocation @@ -401,69 +447,33 @@ private void InitializeComponent() BtnCopyLocation.DarkMode = true; BtnCopyLocation.Image = (Image)resources.GetObject("BtnCopyLocation.Image"); BtnCopyLocation.ImagePadding = 0; - BtnCopyLocation.Location = new Point(540, 115); - BtnCopyLocation.Margin = new Padding(10, 0, 0, 0); + BtnCopyLocation.Location = new Point(240, 41); + BtnCopyLocation.Margin = new Padding(4, 0, 0, 0); BtnCopyLocation.Name = "BtnCopyLocation"; - BtnCopyLocation.Padding = new Padding(8); - BtnCopyLocation.Size = new Size(80, 60); + BtnCopyLocation.Padding = new Padding(3, 3, 3, 3); + BtnCopyLocation.Size = new Size(31, 20); BtnCopyLocation.SvgIcon = UI.IconName.Copy; BtnCopyLocation.SystemIcon = null; BtnCopyLocation.TabIndex = 1; BtnCopyLocation.TextImageRelation = TextImageRelation.ImageBeforeText; BtnCopyLocation.Click += BtnCopyLocation_Click; // - // LblLab - // - LblCIELAB.Anchor = AnchorStyles.Left; - LblCIELAB.AutoSize = true; - LblCIELAB.BackColor = Color.Transparent; - LblCIELAB.DarkMode = true; - LblCIELAB.Location = new Point(43, 542); - LblCIELAB.Name = "LblCIELAB"; - LblCIELAB.Size = new Size(123, 45); - LblCIELAB.TabIndex = 13; - LblCIELAB.Text = "[CIELAB:]"; - // - // TxtLab - // - TxtCIELAB.BackColor = Color.FromArgb(69, 73, 74); - TxtCIELAB.BorderStyle = BorderStyle.FixedSingle; - TxtCIELAB.DarkMode = true; - TxtCIELAB.Dock = DockStyle.Fill; - TxtCIELAB.ForeColor = Color.FromArgb(210, 210, 210); - TxtCIELAB.Location = new Point(173, 540); - TxtCIELAB.Margin = new Padding(0, 10, 0, 10); - TxtCIELAB.Name = "TxtLab"; - TxtCIELAB.ReadOnly = true; - TxtCIELAB.Size = new Size(342, 50); - TxtCIELAB.TabIndex = 14; - // - // BtnCopyLab + // TooltipMain // - BtnCopyCIELab.Anchor = AnchorStyles.Right; - BtnCopyCIELab.DarkMode = true; - BtnCopyCIELab.Image = (Image)resources.GetObject("BtnCopyCIELab.Image"); - BtnCopyCIELab.ImagePadding = 0; - BtnCopyCIELab.Location = new Point(540, 535); - BtnCopyCIELab.Margin = new Padding(10, 0, 0, 0); - BtnCopyCIELab.Name = "BtnCopyCIELab"; - BtnCopyCIELab.Padding = new Padding(8); - BtnCopyCIELab.Size = new Size(80, 60); - BtnCopyCIELab.SvgIcon = UI.IconName.Copy; - BtnCopyCIELab.SystemIcon = null; - BtnCopyCIELab.TabIndex = 15; - BtnCopyCIELab.TextImageRelation = TextImageRelation.ImageBeforeText; - BtnCopyCIELab.Click += BtnCopyCIELab_Click; + TooltipMain.AllPadding = 4; + TooltipMain.DarkMode = false; + TooltipMain.OwnerDraw = true; // // FrmColorPicker // - AutoScaleDimensions = new SizeF(18F, 45F); + AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; AutoSize = true; - ClientSize = new Size(660, 732); + ClientSize = new Size(257, 244); Controls.Add(TableLayout); FormBorderStyle = FormBorderStyle.FixedDialog; Location = new Point(0, 0); + Margin = new Padding(1, 1, 1, 1); Name = "FrmColorPicker"; Text = "[Color picker]"; TableLayout.ResumeLayout(false); @@ -498,9 +508,9 @@ private void InitializeComponent() private UI.ModernButton BtnCopyRgb; private UI.ModernLabel LblCursorLocation; private UI.ModernButton BtnSettings; - private ToolTip TooltipMain; private UI.ModernButton BtnCopyCIELab; private UI.ModernTextBox TxtCIELAB; private UI.ModernLabel LblCIELAB; + private UI.ModernTooltip TooltipMain; } } \ No newline at end of file diff --git a/Source/ImageGlass/Tools/FrmColorPicker.cs b/Source/ImageGlass/Tools/FrmColorPicker.cs index cce7065d1..951bbc0dc 100644 --- a/Source/ImageGlass/Tools/FrmColorPicker.cs +++ b/Source/ImageGlass/Tools/FrmColorPicker.cs @@ -68,6 +68,7 @@ protected override void ApplyTheme(bool darkMode, BackdropStyle? style = null) } TableLayout.BackColor = Config.Theme.ColorPalatte.AppBg; + TooltipMain.DarkMode = darkMode; base.ApplyTheme(darkMode, style); @@ -229,10 +230,9 @@ private void ShowPickedColor(Color? pickedColor, int x, int y) LblCursorLocation.ForeColor = color.InvertBlackOrWhite(); var alpha = Math.Round(color.A / 255f, 3); - var alphaText = string.Empty; // RGBA color ----------------------------------------------- - alphaText = Settings.ShowRgbWithAlpha ? $", {alpha}" : ""; + var alphaText = Settings.ShowRgbWithAlpha ? $", {alpha}" : ""; TxtRgb.Text = $"{color.R}, {color.G}, {color.B}{alphaText}"; // HEXA color ----------------------------------------------- diff --git a/Source/ImageGlass/Tools/FrmColorPicker.resx b/Source/ImageGlass/Tools/FrmColorPicker.resx index 7ebd643d2..5cfc84056 100644 --- a/Source/ImageGlass/Tools/FrmColorPicker.resx +++ b/Source/ImageGlass/Tools/FrmColorPicker.resx @@ -1,7 +1,7 @@  @@ -60,61 +120,41 @@ - iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAAHJSURBVFhHzZhBa8JAEIWlUPAgCIIQCAg9CIIg5CR4EApC - oSB4E4SC0P//F9T34mtJxqmmJpvNgw90Z3fmucnG3fTq6nQ6DUBiGCjcnlgUzMEn+H7ADizO5/NQw5sX - CozAhwo+A00mSldfSNYHKyVvgk3tGUQSztKhkLQpjmCiMv8TftWbEniJmyJTuWqSKS9RCJYqe1/oOAah - Z6oEJ0LlfaETb/QQ99QjOBFj2bgVgu+Fzm2zk42yEOAK9Aa0ye1KRWOVJ3lo9rjfXmQpX4VDp1MsUtnK - ZyszwZisZSs3tjXBmBx+TPER4XWIyagrq9GS0lhqGrvAlMamprELZDQ2M41dIDc2MY1dYEZj3E14wZhM - aIyHCy8Yk+tOAx/2JhCT4+//Jb4sTTAmm9wUhS88pHqdYjCVravQEGPnauFlfJWlq9DYhcfGQnbKQoCn - ZW9AGxxKm8SiEIx5r81kwxc68IWJNzAkK5W/L3Y0A0Oy/fMSWrEjBrRxlKOp8iqsIgxcmERNsq48U56Q - gBvJJv+yvsBc6etJl5aLgkm9YlXga4DsqUv3SEyK5NzxblTIM2DhW0huRvtKE1aaRT73aJTn0iJsS56f - nV7vAieR05+ZrX0UAAAAAElFTkSuQmCC + iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACoSURBVDhPY8AG/v//z/rv3z8JKOaACuM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