From e10cc4d6762fa99e9fb2dd0a59aa10da9e300bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Wed, 24 Sep 2025 09:48:45 +0300 Subject: [PATCH] Fix comments place in FormColors Needed for https://github.com/eclipse-platform/eclipse.platform.ui/pull/3309 to proceed as automating it is not feasible as per https://github.com/eclipse-platform/eclipse.platform.ui/pull/3309/files#r2373662916 . --- .../src/org/eclipse/ui/forms/FormColors.java | 79 ++++++++++--------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/FormColors.java b/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/FormColors.java index 2614b573659..d47f6da6103 100644 --- a/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/FormColors.java +++ b/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/FormColors.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 202 IBM Corporation and others. + * Copyright (c) 2000, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -519,30 +519,30 @@ private void createTitleBarOutlineColors() { // title bar outline - border color RGB tbBorder = getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW); RGB bg = getImpliedBackground().getRGB(); - // Group 1 - // Rule: If at least 2 of the RGB values are equal to or between 180 and - // 255, then apply specified opacity for Group 1 - // Examples: Vista, XP Silver, Wn High Con #2 - // Keyline = TITLE_BACKGROUND @ 70% Opacity over LIST_BACKGROUND - if (testTwoPrimaryColors(tbBorder, 179, 256)) + if (testTwoPrimaryColors(tbBorder, 179, 256)) { + // Group 1 + // Rule: If at least 2 of the RGB values are equal to or between 180 and + // 255, then apply specified opacity for Group 1 + // Examples: Vista, XP Silver, Wn High Con #2 + // Keyline = TITLE_BACKGROUND @ 70% Opacity over LIST_BACKGROUND tbBorder = blend(tbBorder, bg, 70); - // Group 2 - // Rule: If at least 2 of the RGB values are equal to or between 121 and - // 179, then apply specified opacity for Group 2 - // Examples: XP Olive, OSX Graphite, Linux GTK, Wn High Con Black + } else if (testTwoPrimaryColors(tbBorder, 120, 180)) { + // Group 2 + // Rule: If at least 2 of the RGB values are equal to or between 121 and + // 179, then apply specified opacity for Group 2 + // Examples: XP Olive, OSX Graphite, Linux GTK, Wn High Con Black - // Keyline = TITLE_BACKGROUND @ 50% Opacity over LIST_BACKGROUND - else if (testTwoPrimaryColors(tbBorder, 120, 180)) + // Keyline = TITLE_BACKGROUND @ 50% Opacity over LIST_BACKGROUND tbBorder = blend(tbBorder, bg, 50); - // Group 3 - // Rule: Everything else - // Examples: XP Default, Wn Classic Standard, Wn Marine, Wn Plum, OSX - // Aqua, Wn High Con White, Wn High Con #1 + } else { + // Group 3 + // Rule: Everything else + // Examples: XP Default, Wn Classic Standard, Wn Marine, Wn Plum, OSX + // Aqua, Wn High Con White, Wn High Con #1 - // Keyline = TITLE_BACKGROUND @ 30% Opacity over LIST_BACKGROUND - else { + // Keyline = TITLE_BACKGROUND @ 30% Opacity over LIST_BACKGROUND tbBorder = blend(tbBorder, bg, 30); } createColor(FormColors.TB_BORDER, tbBorder); @@ -586,32 +586,33 @@ private void createFormHeaderKeylineColors() { // H_BOTTOM_KEYLINE1 createColor(IFormColors.H_BOTTOM_KEYLINE1, new RGB(255, 255, 255)); - // H_BOTTOM_KEYLINE2 - // Group 1 - // Rule: If at least 2 of the RGB values are equal to or between 180 and - // 255, then apply specified opacity for Group 1 - // Examples: Vista, XP Silver, Wn High Con #2 - // Keyline = TITLE_BACKGROUND @ 70% Opacity over LIST_BACKGROUND - if (testTwoPrimaryColors(titleBg, 179, 256)) + if (testTwoPrimaryColors(titleBg, 179, 256)) { + // H_BOTTOM_KEYLINE2 + // Group 1 + // Rule: If at least 2 of the RGB values are equal to or between 180 and + // 255, then apply specified opacity for Group 1 + // Examples: Vista, XP Silver, Wn High Con #2 + // Keyline = TITLE_BACKGROUND @ 70% Opacity over LIST_BACKGROUND keyline2 = blend(titleBg, bg, 70); - // Group 2 - // Rule: If at least 2 of the RGB values are equal to or between 121 and - // 179, then apply specified opacity for Group 2 - // Examples: XP Olive, OSX Graphite, Linux GTK, Wn High Con Black - // Keyline = TITLE_BACKGROUND @ 50% Opacity over LIST_BACKGROUND - else if (testTwoPrimaryColors(titleBg, 120, 180)) + } else if (testTwoPrimaryColors(titleBg, 120, 180)) { + // Group 2 + // Rule: If at least 2 of the RGB values are equal to or between 121 and + // 179, then apply specified opacity for Group 2 + // Examples: XP Olive, OSX Graphite, Linux GTK, Wn High Con Black + // Keyline = TITLE_BACKGROUND @ 50% Opacity over LIST_BACKGROUND keyline2 = blend(titleBg, bg, 50); - // Group 3 - // Rule: If at least 2 of the RGB values are equal to or between 0 and - // 120, then apply specified opacity for Group 3 - // Examples: XP Default, Wn Classic Standard, Wn Marine, Wn Plum, OSX - // Aqua, Wn High Con White, Wn High Con #1 + } else { + // Group 3 + // Rule: If at least 2 of the RGB values are equal to or between 0 and + // 120, then apply specified opacity for Group 3 + // Examples: XP Default, Wn Classic Standard, Wn Marine, Wn Plum, OSX + // Aqua, Wn High Con White, Wn High Con #1 - // Keyline = TITLE_BACKGROUND @ 30% Opacity over LIST_BACKGROUND - else + // Keyline = TITLE_BACKGROUND @ 30% Opacity over LIST_BACKGROUND keyline2 = blend(titleBg, bg, 30); + } // H_BOTTOM_KEYLINE2 createColor(IFormColors.H_BOTTOM_KEYLINE2, keyline2); }