{ border: ({ focused, disabled, - invalid, + validationState, }: { focused?: boolean; disabled?: boolean; - invalid?: boolean; + validationState?: "error" | "warning" | "valid"; } = {}) => { if (disabled) { return ( @@ -358,8 +358,11 @@ export class Theme
{ ) ); } - if (invalid) { - return this.commonColors.focusRing({ invalid: true, focused }); + if (validationState === "error" || validationState === "warning") { + return this.commonColors.focusRing({ + validationState, + focused, + }); } return focused ? theme.color("Component.focusedBorderColor") || @@ -376,13 +379,13 @@ export class Theme
{ // corresponding to JBUI.CurrentTheme.Focus https://github.com/JetBrains/intellij-community/blob/4a3c219eb390b90229bdde75e4abf11bc04e5e2a/platform/util/ui/src/com/intellij/util/ui/JBUI.java#LL1414C3-L1414C3 focusRing: ({ - invalid, + validationState, focused, }: { - invalid?: boolean; + validationState?: "error" | "warning" | "valid"; focused?: boolean; } = {}) => { - if (invalid) { + if (validationState === "error") { if (focused) { return ( theme.color("Component.errorFocusColor") || @@ -400,6 +403,24 @@ export class Theme
{
"#ebbcbc"
);
}
+ if (validationState === "warning") {
+ if (focused) {
+ return (
+ theme.color("Component.warningFocusColor") ||
+ theme.color(
+ "Focus.activeWarningBorderColor" as UnknownThemeProp<"Focus.activeWarningBorderColor">
+ ) ||
+ "#e2a53a"
+ );
+ }
+ return (
+ theme.color("Component.inactiveWarningFocusColor") ||
+ theme.color(
+ "Focus.inactiveWarningBorderColor" as UnknownThemeProp<"Focus.inactiveWarningBorderColor">
+ ) ||
+ "#ffd385"
+ );
+ }
return focused
? theme.color("Component.focusColor") ||
theme.color(
diff --git a/packages/jui/src/ToolWindowsImpl/ToolWindowSettingsIconMenu.tsx b/packages/jui/src/ToolWindowsImpl/ToolWindowSettingsIconMenu.tsx
index 296fdaa7..002e48d4 100644
--- a/packages/jui/src/ToolWindowsImpl/ToolWindowSettingsIconMenu.tsx
+++ b/packages/jui/src/ToolWindowsImpl/ToolWindowSettingsIconMenu.tsx
@@ -19,6 +19,7 @@ import {
MAXIMIZE_TOOL_WINDOW_ACTION_ID,
REMOVE_TOOL_WINDOW_FROM_SIDEBAR_ACTION_ID,
} from "./ToolWindowActionIds";
+import { MenuTriggerProps } from "@intellij-platform/core/Menu";
/**
* Tool window gear icon menu, with a set of default actions and some extra ones.
@@ -27,7 +28,7 @@ import {
export function ToolWindowSettingsIconMenu({
menuProps,
}: {
- menuProps: React.HTMLAttributes