mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[JEWEL-1290] DefaultBanner Should not Hardcode Padding
closes https://github.com/JetBrains/intellij-community/pull/3466 (cherry picked from commit eb08e9e97f5826f128a09714d04e11c8ed1eaf94) (cherry picked from commit 20876635a7c17f6f45f1b42b654b6a6f41ec82d4) IJ-MR-211495 GitOrigin-RevId: 8111038cfcbfde9d45e72bf38af041f02c110739
This commit is contained in:
committed by
intellij-monorepo-bot
parent
743346a50c
commit
40da5d76a7
+13
-2
@@ -65,6 +65,7 @@ public fun Banners(modifier: Modifier = Modifier) {
|
||||
GroupHeader("Default banner (aka editor banners)")
|
||||
|
||||
DefaultInformationBanner(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
style = JewelTheme.defaultBannerStyle.information,
|
||||
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
|
||||
linkActions = {
|
||||
@@ -74,6 +75,7 @@ public fun Banners(modifier: Modifier = Modifier) {
|
||||
)
|
||||
|
||||
DefaultInformationBanner(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
style = JewelTheme.defaultBannerStyle.information,
|
||||
iconActions = {
|
||||
iconAction(
|
||||
@@ -91,6 +93,7 @@ public fun Banners(modifier: Modifier = Modifier) {
|
||||
)
|
||||
|
||||
DefaultInformationBanner(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
style = JewelTheme.defaultBannerStyle.information,
|
||||
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
|
||||
icon = null,
|
||||
@@ -100,32 +103,40 @@ public fun Banners(modifier: Modifier = Modifier) {
|
||||
},
|
||||
)
|
||||
|
||||
DefaultInformationBanner(style = JewelTheme.defaultBannerStyle.information, text = LONG_IPSUM)
|
||||
DefaultInformationBanner(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
style = JewelTheme.defaultBannerStyle.information,
|
||||
text = LONG_IPSUM,
|
||||
)
|
||||
|
||||
DefaultInformationBanner(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
style = JewelTheme.defaultBannerStyle.information,
|
||||
text = LONG_IPSUM,
|
||||
icon = null,
|
||||
)
|
||||
|
||||
DefaultInformationBanner(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
style = JewelTheme.defaultBannerStyle.information,
|
||||
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
|
||||
)
|
||||
|
||||
DefaultSuccessBanner(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
|
||||
style = JewelTheme.defaultBannerStyle.success,
|
||||
)
|
||||
|
||||
DefaultWarningBanner(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
|
||||
style = JewelTheme.defaultBannerStyle.warning,
|
||||
)
|
||||
|
||||
DefaultErrorBanner(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt",
|
||||
modifier = Modifier,
|
||||
icon = { Icon(AllIconsKeys.General.BalloonError, null) },
|
||||
linkActions = {
|
||||
action("Action A", onClick = { clickLabel = "Error default Action A clicked" })
|
||||
|
||||
+19
-2
@@ -6,6 +6,7 @@ import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.IntrinsicSize
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.RowScope
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
@@ -186,6 +187,10 @@ public fun DefaultInformationBanner(
|
||||
*
|
||||
* This banner is primarily used to display persistent messages without interrupting the workflow.
|
||||
*
|
||||
* **Note:** The [content] slot does not support subcomposition-based composables (e.g., `BoxWithConstraints`, lazy
|
||||
* layouts), because the banner uses `Modifier.width(IntrinsicSize.Max)` internally. Subcomposition-based layouts cannot
|
||||
* report intrinsic measurements and will throw at runtime.
|
||||
*
|
||||
* **Guidelines:** [on IJP SDK webhelp](https://plugins.jetbrains.com/docs/intellij/banner.html)
|
||||
*
|
||||
* **Swing equivalent:**
|
||||
@@ -376,6 +381,10 @@ public fun DefaultSuccessBanner(
|
||||
*
|
||||
* Use this banner to provide clear, visual feedback of a completed or successful action.
|
||||
*
|
||||
* **Note:** The [content] slot does not support subcomposition-based composables (e.g., `BoxWithConstraints`, lazy
|
||||
* layouts), because the banner uses `Modifier.width(IntrinsicSize.Max)` internally. Subcomposition-based layouts cannot
|
||||
* report intrinsic measurements and will throw at runtime.
|
||||
*
|
||||
* **Guidelines:** [on IJP SDK webhelp](https://plugins.jetbrains.com/docs/intellij/banner.html)
|
||||
*
|
||||
* **Swing equivalent:**
|
||||
@@ -563,6 +572,10 @@ public fun DefaultWarningBanner(
|
||||
*
|
||||
* Use this banner to make users aware of potential issues without stopping their flow.
|
||||
*
|
||||
* **Note:** The [content] slot does not support subcomposition-based composables (e.g., `BoxWithConstraints`, lazy
|
||||
* layouts), because the banner uses `Modifier.width(IntrinsicSize.Max)` internally. Subcomposition-based layouts cannot
|
||||
* report intrinsic measurements and will throw at runtime.
|
||||
*
|
||||
* **Guidelines:** [on IJP SDK webhelp](https://plugins.jetbrains.com/docs/intellij/banner.html)
|
||||
*
|
||||
* **Swing equivalent:**
|
||||
@@ -747,6 +760,10 @@ public fun DefaultErrorBanner(
|
||||
*
|
||||
* Use this banner to provide high-visibility error messages requiring immediate user attention.
|
||||
*
|
||||
* **Note:** The [content] slot does not support subcomposition-based composables (e.g., `BoxWithConstraints`, lazy
|
||||
* layouts), because the banner uses `Modifier.width(IntrinsicSize.Max)` internally. Subcomposition-based layouts cannot
|
||||
* report intrinsic measurements and will throw at runtime.
|
||||
*
|
||||
* **Guidelines:** [on IJP SDK webhelp](https://plugins.jetbrains.com/docs/intellij/banner.html)
|
||||
*
|
||||
* **Swing equivalent:**
|
||||
@@ -850,10 +867,10 @@ private fun DefaultBannerImpl(
|
||||
modifier: Modifier = Modifier,
|
||||
content: @Composable (() -> Unit),
|
||||
) {
|
||||
Column(modifier = modifier) {
|
||||
Column(modifier = modifier.width(IntrinsicSize.Max)) {
|
||||
Divider(orientation = Orientation.Horizontal, color = style.colors.border, modifier = Modifier.fillMaxWidth())
|
||||
Row(
|
||||
modifier = Modifier.background(style.colors.background).padding(10.dp),
|
||||
modifier = Modifier.background(style.colors.background).padding(style.metrics.padding),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
if (icon != null) {
|
||||
|
||||
@@ -205,7 +205,7 @@ internal class SwingComparisonTabPanel : BorderLayoutPanel() {
|
||||
.align(AlignY.CENTER)
|
||||
|
||||
compose {
|
||||
Box(Modifier.width(400.dp)) {
|
||||
Box {
|
||||
DefaultInformationBanner(
|
||||
text = DevkitComposeBundle.message("jewel.compose.banners"),
|
||||
iconActions = {
|
||||
|
||||
Reference in New Issue
Block a user