From 07caa47b2fdaf1f35f807d7df56387e7d6bcdad7 Mon Sep 17 00:00:00 2001 From: a-miscellaneous <96189996+a-miscellaneous@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:28:53 +0100 Subject: [PATCH 1/2] added colors for non-perfect matches, color subject to change Signed-off-by: a-miscellaneous <96189996+a-miscellaneous@users.noreply.github.com> --- GUI/src/main/kotlin/ui/components/diffScreen/Timeline.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GUI/src/main/kotlin/ui/components/diffScreen/Timeline.kt b/GUI/src/main/kotlin/ui/components/diffScreen/Timeline.kt index b160e86e..e4db6673 100644 --- a/GUI/src/main/kotlin/ui/components/diffScreen/Timeline.kt +++ b/GUI/src/main/kotlin/ui/components/diffScreen/Timeline.kt @@ -134,6 +134,8 @@ fun Timeline(navigator: FrameNavigation) { Color.Blue } else if (navigator.diffSequence[item] == AlignmentElement.INSERTION) { Color.Green + } else if (navigator.diffSequence[item] == AlignmentElement.MATCH) { + Color.Yellow } else { Color.Black }, From 9557e93ad3075b49bfe7f47fb8c5b1788dcfc384 Mon Sep 17 00:00:00 2001 From: a-miscellaneous <96189996+a-miscellaneous@users.noreply.github.com> Date: Thu, 25 Jan 2024 20:30:06 +0100 Subject: [PATCH 2/2] changed to when Signed-off-by: a-miscellaneous <96189996+a-miscellaneous@users.noreply.github.com> --- .../kotlin/ui/components/diffScreen/Timeline.kt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/GUI/src/main/kotlin/ui/components/diffScreen/Timeline.kt b/GUI/src/main/kotlin/ui/components/diffScreen/Timeline.kt index e4db6673..04214a96 100644 --- a/GUI/src/main/kotlin/ui/components/diffScreen/Timeline.kt +++ b/GUI/src/main/kotlin/ui/components/diffScreen/Timeline.kt @@ -130,14 +130,11 @@ fun Timeline(navigator: FrameNavigation) { } } .background( - if (navigator.diffSequence[item] == AlignmentElement.DELETION) { - Color.Blue - } else if (navigator.diffSequence[item] == AlignmentElement.INSERTION) { - Color.Green - } else if (navigator.diffSequence[item] == AlignmentElement.MATCH) { - Color.Yellow - } else { - Color.Black + when (navigator.diffSequence[item]) { + AlignmentElement.DELETION -> Color.Blue + AlignmentElement.INSERTION -> Color.Green + AlignmentElement.MATCH -> Color.Yellow + AlignmentElement.PERFECT -> Color.Black }, ), ) {