KeSp_controller/ui/components/connection_bar.slint
Mae PUGIN 32ee3a6d26 feat: Complete KeSp Controller — Slint UI port
Full port of the KaSe/KeSp split keyboard configurator from egui to Slint:
- 6 tabs: Keymap, Advanced, Macros, Stats, Settings, Flash
- Responsive keyboard view with scale-to-fit and key rotations
- Key selector popup with categorized grid, MT/LT builders, hex input
- Combo key picker with inline keyboard visual
- Macro step builder with visual tags
- Serial communication via background threads + mpsc polling
- Heatmap overlay with blue-yellow-red gradient
- OTA flasher with prog port VID filtering and partition selector
- WPM polling, Tamagotchi, Autoshift controls
- Dracula theme matching egui version

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 20:40:34 +02:00

56 lines
1.8 KiB
Text

import { ComboBox, Button } from "std-widgets.slint";
import { Theme } from "../theme.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
Button {
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;
}
}
}