-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix icon loading in IDE * Fix icon loading in standalone modules * Fix static analysis * SwingBridgeService will now wait 20 milliseconds before reading the theme and then will retry due to Swing possible race conditions. * Fixed SLC focus system, added right color for unfocused selected items in the LazyTree. * Partially fix icon mapping Something still isn't working well — icon states may need to be applied _after_ mapping, need to check as it breaks in those cases. Checkboxes and radio buttons also use the old UI icons, not sure why they don't get mapped. * Add fallback path for icon loading * Update project settings * Also load iconColorsOnSelection from theme * Fix crash in standalone sample * Clean up painter provider usage * Re-do icon tinting logic, better match Swing * Fix tree crashing in sample (see #114) Also reformat/cleanup after rebase on main --------- Co-authored-by: Lamberto Basti <[email protected]>
- Loading branch information
Showing
48 changed files
with
1,123 additions
and
604 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
core/src/main/kotlin/org/jetbrains/jewel/ClassLoaderProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.jetbrains.jewel | ||
|
||
interface ClassLoaderProvider { | ||
|
||
val classLoaders: List<ClassLoader> | ||
} |
119 changes: 0 additions & 119 deletions
119
core/src/main/kotlin/org/jetbrains/jewel/IntelliJSvgLoader.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 29 additions & 1 deletion
30
core/src/main/kotlin/org/jetbrains/jewel/IntelliJThemeIconData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,48 @@ | ||
package org.jetbrains.jewel | ||
|
||
import androidx.compose.runtime.Immutable | ||
import androidx.compose.ui.graphics.Color | ||
|
||
@Immutable | ||
interface IntelliJThemeIconData { | ||
|
||
val iconOverrides: Map<String, String> | ||
val colorPalette: Map<String, String> | ||
val selectionColorPalette: Map<String, String> | ||
|
||
fun selectionColorMapping() = | ||
selectionColorPalette.mapNotNull { (key, value) -> | ||
val keyColor = key.toColorOrNull() ?: return@mapNotNull null | ||
val valueColor = value.toColorOrNull() ?: return@mapNotNull null | ||
keyColor to valueColor | ||
}.toMap() | ||
} | ||
|
||
internal fun String.toColorOrNull() = | ||
lowercase() | ||
.removePrefix("#") | ||
.removePrefix("0x") | ||
.let { | ||
when (it.length) { | ||
3 -> "ff${it[0]}${it[0]}${it[1]}${it[1]}${it[2]}${it[2]}" | ||
4 -> "${it[0]}${it[0]}${it[1]}${it[1]}${it[2]}${it[2]}${it[3]}${it[3]}" | ||
6 -> "ff$it" | ||
8 -> it | ||
else -> null | ||
} | ||
} | ||
?.toLongOrNull(radix = 16) | ||
?.let { Color(it) } | ||
|
||
@Immutable | ||
object EmptyThemeIconData : IntelliJThemeIconData { | ||
|
||
override val iconOverrides: Map<String, String> = emptyMap() | ||
|
||
override val colorPalette: Map<String, String> = emptyMap() | ||
|
||
override fun toString() = "EmptyThemeIconData(iconOverrides=[], colorPalette=[])" | ||
override val selectionColorPalette: Map<String, String> = emptyMap() | ||
|
||
override fun toString() = | ||
"EmptyThemeIconData(iconOverrides=[], colorPalette=[], selectionColorPalette=[])" | ||
} |
Oops, something went wrong.