Skip to content

Commit

Permalink
Tooltip in Crop, Color Picker tool: make it theme-aware
Browse files Browse the repository at this point in the history
  • Loading branch information
d2phap committed Nov 1, 2024
1 parent 0791ea8 commit ecb47de
Show file tree
Hide file tree
Showing 7 changed files with 535 additions and 518 deletions.
8 changes: 4 additions & 4 deletions Source/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
236 changes: 123 additions & 113 deletions Source/ImageGlass/Tools/FrmColorPicker.Designer.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Source/ImageGlass/Tools/FrmColorPicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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 -----------------------------------------------
Expand Down
24 changes: 12 additions & 12 deletions Source/ImageGlass/Tools/FrmColorPicker.resx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Microsoft ResX Schema
Version 2.0
Expand Down Expand Up @@ -48,7 +48,7 @@
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
Expand Down Expand Up @@ -118,10 +118,10 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="BtnCopyLab.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="BtnCopyCIELab.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
BMGDIAiC7/8KrTPpFuua1v4kDnxgk90dTZM1QR8VRTHL83yhmMu0G6FgCLbgAp4N3EAGhpsjeSpFbAZt
HEAoZboJCVyquxQYwgPLv5Jy7ULwWiWPIZWydiFgqRJcEEv5T2GC72zMMjbxAN+bCYP7WpBrTmJTCgNz
FeCDSOyM4ZDt35ej2BnDq5r0AY/K5F/LWRHR0MdRaCKmocuD/ouUhrEa9IkxjNSgTxIaslHbJp1jGjq3
Expand All @@ -133,7 +133,7 @@
<data name="BtnSettings.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
BMGDIAiC7/8KrTPpFuua1v4kDnxgk90dTZM1QR8VRTHL83yhmMu0G6FgCLbgAp4N3EAGhpsjeSpFbAZt
HEAoZboJCVyquxQYwgPLv5Jy7ULwWiWPIZWydiFgqRJcEEv5T2GC72zMMjbxAN+bCYP7WpBrTmJTCgNz
FeCDSOyM4ZDt35ej2BnDq5r0AY/K5F/LWRHR0MdRaCKmocuD/ouUhrEa9IkxjNSgTxIaslHbJp1jGjq3
Expand All @@ -145,7 +145,7 @@
<data name="BtnCopyHsv.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
BMGDIAiC7/8KrTPpFuua1v4kDnxgk90dTZM1QR8VRTHL83yhmMu0G6FgCLbgAp4N3EAGhpsjeSpFbAZt
HEAoZboJCVyquxQYwgPLv5Jy7ULwWiWPIZWydiFgqRJcEEv5T2GC72zMMjbxAN+bCYP7WpBrTmJTCgNz
FeCDSOyM4ZDt35ej2BnDq5r0AY/K5F/LWRHR0MdRaCKmocuD/ouUhrEa9IkxjNSgTxIaslHbJp1jGjq3
Expand All @@ -157,7 +157,7 @@
<data name="BtnCopyHsl.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
BMGDIAiC7/8KrTPpFuua1v4kDnxgk90dTZM1QR8VRTHL83yhmMu0G6FgCLbgAp4N3EAGhpsjeSpFbAZt
HEAoZboJCVyquxQYwgPLv5Jy7ULwWiWPIZWydiFgqRJcEEv5T2GC72zMMjbxAN+bCYP7WpBrTmJTCgNz
FeCDSOyM4ZDt35ej2BnDq5r0AY/K5F/LWRHR0MdRaCKmocuD/ouUhrEa9IkxjNSgTxIaslHbJp1jGjq3
Expand All @@ -169,7 +169,7 @@
<data name="BtnCopyCmyk.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
BMGDIAiC7/8KrTPpFuua1v4kDnxgk90dTZM1QR8VRTHL83yhmMu0G6FgCLbgAp4N3EAGhpsjeSpFbAZt
HEAoZboJCVyquxQYwgPLv5Jy7ULwWiWPIZWydiFgqRJcEEv5T2GC72zMMjbxAN+bCYP7WpBrTmJTCgNz
FeCDSOyM4ZDt35ej2BnDq5r0AY/K5F/LWRHR0MdRaCKmocuD/ouUhrEa9IkxjNSgTxIaslHbJp1jGjq3
Expand All @@ -181,7 +181,7 @@
<data name="BtnCopyHex.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
BMGDIAiC7/8KrTPpFuua1v4kDnxgk90dTZM1QR8VRTHL83yhmMu0G6FgCLbgAp4N3EAGhpsjeSpFbAZt
HEAoZboJCVyquxQYwgPLv5Jy7ULwWiWPIZWydiFgqRJcEEv5T2GC72zMMjbxAN+bCYP7WpBrTmJTCgNz
FeCDSOyM4ZDt35ej2BnDq5r0AY/K5F/LWRHR0MdRaCKmocuD/ouUhrEa9IkxjNSgTxIaslHbJp1jGjq3
Expand All @@ -193,7 +193,7 @@
<data name="BtnCopyRgb.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
BMGDIAiC7/8KrTPpFuua1v4kDnxgk90dTZM1QR8VRTHL83yhmMu0G6FgCLbgAp4N3EAGhpsjeSpFbAZt
HEAoZboJCVyquxQYwgPLv5Jy7ULwWiWPIZWydiFgqRJcEEv5T2GC72zMMjbxAN+bCYP7WpBrTmJTCgNz
FeCDSOyM4ZDt35ej2BnDq5r0AY/K5F/LWRHR0MdRaCKmocuD/ouUhrEa9IkxjNSgTxIaslHbJp1jGjq3
Expand All @@ -205,7 +205,7 @@
<data name="BtnCopyLocation.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFISURBVEhLvZbNCsIwEISLJw8FwZMgFDwIhYLQk9CDIAie
BMGDIAiC7/8KrTPpFuua1v4kDnxgk90dTZM1QR8VRTHL83yhmMu0G6FgCLbgAp4N3EAGhpsjeSpFbAZt
HEAoZboJCVyquxQYwgPLv5Jy7ULwWiWPIZWydiFgqRJcEEv5T2GC72zMMjbxAN+bCYP7WpBrTmJTCgNz
FeCDSOyM4ZDt35ej2BnDq5r0AY/K5F/LWRHR0MdRaCKmocuD/ouUhrEa9IkxjNSgTxIaslHbJp1jGjq3
Expand All @@ -215,6 +215,6 @@
</value>
</data>
<metadata name="TooltipMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
<value>26, 20</value>
</metadata>
</root>
Loading

0 comments on commit ecb47de

Please sign in to comment.