KeSp_controller/ui/components/connection_bar.slint
Mae PUGIN 4e93f4fd97 style: Custom DarkComboBox + DarkTab (Dracula theme throughout)
- DarkComboBox: PopupWindow dropdown with Dracula colors, replaces all std ComboBox
- DarkTab: custom tab bar with purple underline, replaces std TabWidget
- All 7 .slint files updated, zero std-widgets Button/ComboBox/TabWidget remaining

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 08:46:39 +02:00

56 lines
1.8 KiB
Text

import { Theme } from "../theme.slint";
import { DarkButton } from "dark_button.slint";
import { AppState, ConnectionBridge, ConnectionState } from "../globals.slint";
export component ConnectionBar inherits Rectangle {
height: 48px;
background: Theme.bg-secondary;
HorizontalLayout {
padding: 8px;
spacing: 12px;
alignment: start;
// Status LED (wrapped in a VerticalLayout to center it)
VerticalLayout {
alignment: center;
Rectangle {
width: 16px;
height: 16px;
border-radius: 8px;
background: AppState.connection == ConnectionState.connected ? Theme.connected : Theme.disconnected;
}
}
// Port selector (placeholder - ComboBox needs string model)
Text {
text: ConnectionBridge.selected-port != "" ? ConnectionBridge.selected-port : "No port selected";
color: Theme.fg-primary;
vertical-alignment: center;
}
// Connect/Disconnect button
DarkButton {
text: AppState.connection == ConnectionState.connected ? "Disconnect" : "Connect";
enabled: AppState.connection == ConnectionState.connected || AppState.connection == ConnectionState.disconnected;
clicked => {
if AppState.connection == ConnectionState.connected {
ConnectionBridge.disconnect();
} else {
ConnectionBridge.connect();
}
}
}
// Spacer
Rectangle {
horizontal-stretch: 1;
}
// Firmware version
Text {
text: AppState.firmware-version;
color: Theme.fg-secondary;
vertical-alignment: center;
}
}
}