From c255980dc6f0230cb19cfe77b1a4c9d7cfba992a Mon Sep 17 00:00:00 2001 From: Avii Date: Sat, 8 Aug 2026 18:22:36 +0200 Subject: [PATCH] 1786206156 --- dashboard/ui/main.slint | 65 ++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/dashboard/ui/main.slint b/dashboard/ui/main.slint index 164cee4..af81f7c 100644 --- a/dashboard/ui/main.slint +++ b/dashboard/ui/main.slint @@ -18,6 +18,8 @@ import { Switch, MaterialStyleMetrics, MaterialPalette, + ElevatedButton, + FilledButton, } from "material/material.slint"; import { Icons } from "material/ui/icons/icons.slint"; @@ -97,32 +99,49 @@ component LightTile inherits Rectangle { in property light; callback clicked(); - TouchArea { - clicked => { - clicked(); - } + if light.on: FilledButton { + width: 100%; + text: light.name; + enabled: light.available; + // background: light.on; + clicked => root.clicked(); } - HorizontalLayout { - spacing: MaterialStyleMetrics.padding_8; - Text { - text: light.name; - height: 32px; - vertical-alignment: center; - horizontal-alignment: right; - // font-weight: light.on ? 700 : 500; - color: light.on ? MaterialPalette.primary : MaterialPalette.secondary; - font-size: 18px; - } - - sw := Switch { - width: 48px; - height: 32px; - enabled: light.available; - checked: light.on; - checked_state_changed(checked) => { root.clicked() } - } + if !light.on: ElevatedButton { + width: 100%; + text: light.name; + enabled: light.available; + // background: light.on; + clicked => root.clicked(); } + + // HorizontalLayout { + + // TouchArea { + // clicked => { + // clicked(); + // } + // } + + // spacing: MaterialStyleMetrics.padding_8; + // Text { + // text: light.name; + // height: 32px; + // vertical-alignment: center; + // horizontal-alignment: right; + // // font-weight: light.on ? 700 : 500; + // color: light.on ? MaterialPalette.primary : MaterialPalette.secondary; + // font-size: 18px; + // } + + // sw := Switch { + // width: 48px; + // height: 32px; + // enabled: light.available; + // checked: light.on; + // checked_state_changed(checked) => { root.clicked() } + // } + // } } export component AppWindow inherits Window {