From 576c345d356bfed6c8c69558b66bf8b6351e19cc Mon Sep 17 00:00:00 2001 From: Ivan Morgillo Date: Tue, 20 Aug 2024 11:12:20 +0200 Subject: [PATCH] Migrate TitleBarView to new Icon API (#546) * remove unnecessary class specification reference https://github.com/JetBrains/jewel/pull/546#pullrequestreview-2246071308 Signed-off-by: Ivan Morgillo * iterate on TitleBarView icons Signed-off-by: Ivan Morgillo * iterate on TitleBarView icon using PainterHints Signed-off-by: Ivan Morgillo * remove unused TitleBarView 20x20 icons Signed-off-by: Ivan Morgillo * Revert "remove unused TitleBarView 20x20 icons" This reverts commit fd872e26748021fcad263996a1b2f3048b9dbe53. --------- Signed-off-by: Ivan Morgillo --- .../samples/standalone/view/TitleBarView.kt | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/TitleBarView.kt b/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/TitleBarView.kt index 5bcedb06f..2274a5f7d 100644 --- a/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/TitleBarView.kt +++ b/samples/standalone/src/main/kotlin/org/jetbrains/jewel/samples/standalone/view/TitleBarView.kt @@ -92,30 +92,30 @@ fun DecoratedWindowScope.TitleBarView() { when (MainViewModel.theme) { IntUiThemes.Light -> Icon( - "icons/lightTheme@20x20.svg", - "Themes", - StandaloneSampleIcons::class.java, + key = StandaloneSampleIcons.themeLight, + contentDescription = "Light", + hints = arrayOf(Size(20)), ) IntUiThemes.LightWithLightHeader -> Icon( - "icons/lightWithLightHeaderTheme@20x20.svg", - "Themes", - StandaloneSampleIcons::class.java, + key = StandaloneSampleIcons.themeLightWithLightHeader, + contentDescription = "Light with light header", + hints = arrayOf(Size(20)), ) IntUiThemes.Dark -> Icon( - "icons/darkTheme@20x20.svg", - "Themes", - StandaloneSampleIcons::class.java, + key = StandaloneSampleIcons.themeDark, + contentDescription = "Dark", + hints = arrayOf(Size(20)), ) IntUiThemes.System -> Icon( - "icons/systemTheme@20x20.svg", - "Themes", - StandaloneSampleIcons::class.java, + key = StandaloneSampleIcons.themeSystem, + contentDescription = "System", + hints = arrayOf(Size(20)), ) } }