Pin header actions to the right edge and align material3 with floret-kit (#59)
This commit is contained in:
1 parent
1239342094
commit
ff4e68def4
3 files changed
+27
-20
No files matched your search
@@ -579,15 +579,20 @@ private fun CountCard(
|
||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
||||
) {
|
||||
Icon(style.icon, contentDescription = null)
|
||||
Text(
|
||||
style.label,
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.weight(1f, fill = false),
|
||||
)
|
||||
if (marked) IgnoredScopeMark(style.onContainer)
|
||||
Spacer(Modifier.weight(1f))
|
||||
Row(
|
||||
modifier = Modifier.weight(1f),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
||||
) {
|
||||
Text(
|
||||
style.label,
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.weight(1f, fill = false),
|
||||
)
|
||||
if (marked) IgnoredScopeMark(style.onContainer)
|
||||
}
|
||||
Text(count.toString(), style = MaterialTheme.typography.headlineSmall)
|
||||
}
|
||||
return@Surface
|
||||
@@ -1008,16 +1013,17 @@ internal fun SectionHeader(text: String, marked: Boolean = false, action: (@Comp
|
||||
),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Text(
|
||||
text = text,
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
modifier = Modifier.weight(1f, fill = false),
|
||||
)
|
||||
if (marked) {
|
||||
Spacer(Modifier.width(6.dp))
|
||||
IgnoredScopeMark()
|
||||
Row(modifier = Modifier.weight(1f), verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(
|
||||
text = text,
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
modifier = Modifier.weight(1f, fill = false),
|
||||
)
|
||||
if (marked) {
|
||||
Spacer(Modifier.width(6.dp))
|
||||
IgnoredScopeMark()
|
||||
}
|
||||
}
|
||||
Spacer(Modifier.weight(1f))
|
||||
action?.invoke()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.MenuDefaults
|
||||
import androidx.compose.material3.SelectableDropdownMenuItem
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -81,7 +82,7 @@ fun ViewSwitcher(
|
||||
DropdownMenuGroup(shapes = MenuDefaults.groupShape(0, 2)) {
|
||||
views.forEachIndexed { index, view ->
|
||||
val selected = view.id == activeViewId
|
||||
DropdownMenuItem(
|
||||
SelectableDropdownMenuItem(
|
||||
selected = selected,
|
||||
onClick = {
|
||||
open = false
|
||||
|
||||
@@ -11,7 +11,7 @@ composeBom = "2026.05.01"
|
||||
# Material 3 Expressive APIs currently live only in the 1.5 alpha line.
|
||||
# Pin explicitly to override the BOM (which ships stable 1.4.0).
|
||||
# Re-evaluate when 1.5.0 stable lands.
|
||||
material3 = "1.5.0-alpha26"
|
||||
material3 = "1.5.0-alpha29"
|
||||
datastore = "1.2.1"
|
||||
# Glance: kept on the same version as Calendula's widgets.
|
||||
glance = "1.2.0"
|
||||
|
||||
Reference in new issue
Block a user