- Avoid code duplication - Base square icon button component with common appearance, properties, callbacks - Refactor BatteryWidget to inherit SquareIconWidget
11 lines
363 B
Plaintext
11 lines
363 B
Plaintext
import { SquareIconWidget } from "square-icon-widget.slint";
|
|
|
|
export component BatteryWidget inherits SquareIconWidget {
|
|
in property <string> battery_status;
|
|
in property <int> battery_capacity;
|
|
in property <string> battery_capacity_level;
|
|
|
|
// Compose tooltip here
|
|
tooltip_text: "Battery: " + battery_capacity + "% (" + battery_status + ")";
|
|
}
|