From c73a4b575eae6e526c60e8cd8bece71fe9ddd56d Mon Sep 17 00:00:00 2001 From: Candifloss Date: Sun, 23 Nov 2025 19:36:45 +0530 Subject: [PATCH] Add: Power button widget - Just another square button - Constant icon --- ui/topbar.slint | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/ui/topbar.slint b/ui/topbar.slint index 2c3de8d..455a5f5 100644 --- a/ui/topbar.slint +++ b/ui/topbar.slint @@ -73,6 +73,15 @@ export component TopBar inherits Window { in property notif_bg_clicked: #4a5f70;*/ callback show_notif(); + // Power button + in property power_tooltip; + in property power_icon: ""; + /*in property power_icon_color: #ffffff; + in property power_bg_normal: #8e9162; + in property power_bg_hover: #6d8a4d; + in property power_bg_clicked: #4a5f70;*/ + callback show_power(); + title: "chocobar"; width: bar_width *1px; height: bar_height *1px; @@ -154,7 +163,7 @@ export component TopBar inherits Window { square_btn_callback => root.show_wifi(); } - // SquareIconWidget - brightness + // SquareIconWidget - Brightness SquareIconWidget { bar_height: root.bar_height; icon_text: root.brightness_icon; @@ -203,6 +212,18 @@ export component TopBar inherits Window { // Forward the widget's callback to the root's to access from Rust show_clock => root.show_clock(); } + + // SquareIconWidget - Power button + SquareIconWidget { + bar_height: root.bar_height; + icon_text: root.power_icon; + tooltip_text: root.power_tooltip; + /*icon_color: root.power_icon_color; + bg_normal: root.power_bg_normal; + bg_hover: root.power_bg_hover; + bg_clicked: root.power_bg_clicked;*/ + square_btn_callback => root.show_power(); + } } } }