From 7e6f70e22bfe528bb37eb819374cdc2676cbaddc Mon Sep 17 00:00:00 2001 From: Damocles Date: Wed, 22 Apr 2026 21:36:32 +0200 Subject: [PATCH] fix widget color bar: use Spacer with background instead of border trick --- .../nova/android/widget/AgendaWidget.kt | 63 +++++++++---------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/app/src/main/java/space/darkest/nova/android/widget/AgendaWidget.kt b/app/src/main/java/space/darkest/nova/android/widget/AgendaWidget.kt index 4a04a3c..967d7a4 100644 --- a/app/src/main/java/space/darkest/nova/android/widget/AgendaWidget.kt +++ b/app/src/main/java/space/darkest/nova/android/widget/AgendaWidget.kt @@ -217,40 +217,37 @@ class AgendaWidget : GlanceAppWidget() { Spacer(GlanceModifier.width(8.dp)) - // color bar as left border - stretches with content automatically - Box( + // color indicator + Spacer( modifier = GlanceModifier - .defaultWeight() - .background(GlanceTheme.colors.primary) - .cornerRadius(4.dp), - ) { - Column( - modifier = GlanceModifier - .fillMaxWidth() - .padding(start = 3.dp) - .background(GlanceTheme.colors.widgetBackground), - ) { - Column(modifier = GlanceModifier.padding(start = 8.dp, top = 2.dp, bottom = 2.dp)) { - Text( - text = event.title, - style = TextStyle( - color = GlanceTheme.colors.onSurface, - fontSize = 13.sp, - fontWeight = FontWeight.Medium, - ), - maxLines = 2, - ) - if (event.location != null) { - Text( - text = event.location, - style = TextStyle( - color = GlanceTheme.colors.onSurfaceVariant, - fontSize = 11.sp, - ), - maxLines = 1, - ) - } - } + .width(3.dp) + .height(16.dp) + .cornerRadius(2.dp) + .background(GlanceTheme.colors.primary), + ) + + Spacer(GlanceModifier.width(8.dp)) + + // event details + Column(modifier = GlanceModifier.defaultWeight()) { + Text( + text = event.title, + style = TextStyle( + color = GlanceTheme.colors.onSurface, + fontSize = 13.sp, + fontWeight = FontWeight.Medium, + ), + maxLines = 2, + ) + if (event.location != null) { + Text( + text = event.location, + style = TextStyle( + color = GlanceTheme.colors.onSurfaceVariant, + fontSize = 11.sp, + ), + maxLines = 1, + ) } } }