From ebd300bd45cc3126a5c8f5f5fdf7b5ed43c1f789 Mon Sep 17 00:00:00 2001 From: Qichen Liu Date: Thu, 16 Nov 2023 10:53:18 +0100 Subject: [PATCH] Fix: the second color 1. does not get copied when teradic/monochromatic is selected 2. gets copied twice when analogous/complementary is selected --- src/window.vala | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/window.vala b/src/window.vala index c57f618..8b57b78 100644 --- a/src/window.vala +++ b/src/window.vala @@ -515,18 +515,16 @@ namespace Colorway { string export_txt = ""; export_txt += box.hex + "\n"; - - switch (color_rule_dropdown.get_selected ()) { - case 2: - export_txt += sbox.hex + "\n"; - break; - default: - export_txt += tbox.hex + "\n"; - break; + export_txt += sbox.hex + "\n"; + + uint selected = color_rule_dropdown.get_selected (); + if (selected == 2) { + export_txt += tbox.hex + "\n"; + } else if (selected >= 3) { + export_txt += tbox.hex + "\n"; + export_txt += ubox.hex + "\n"; } - export_txt += ubox.hex + "\n"; - // Put this ext_txt in clipboard var display = Gdk.Display.get_default (); unowned var clipboard = display.get_clipboard (); @@ -572,4 +570,4 @@ namespace Colorway { about.present (); } } -} +}