mirror of
https://github.com/johndoe6345789/tustu.git
synced 2026-04-24 21:55:12 +00:00
- Updated Main.qml to improve UI layout and replace menu with a toolbar. - Created reusable QML components: DraggableGauge, StatusIndicator, and TopButton. - Implemented EngineSimulator class in main.py for real-time engine data simulation. - Simplified GaugeClusterView by utilizing new components and removing internal timers. - Added README.md for component documentation and usage examples. - Enhanced overall maintainability and performance of the application.
27 lines
649 B
QML
27 lines
649 B
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
|
|
// Top toolbar button component
|
|
ToolButton {
|
|
id: root
|
|
text: ""
|
|
flat: true
|
|
font.pixelSize: 12
|
|
|
|
property bool isActive: false
|
|
|
|
background: Rectangle {
|
|
color: root.isActive ? "#3498db" : (root.hovered ? "#34495e" : "#2c3e50")
|
|
border.color: root.isActive ? "#2980b9" : "#1a252f"
|
|
border.width: 1
|
|
}
|
|
|
|
contentItem: Text {
|
|
text: root.text
|
|
font: root.font
|
|
color: root.isActive ? "#fff" : (root.hovered ? "#ecf0f1" : "#bdc3c7")
|
|
horizontalAlignment: Text.AlignHCenter
|
|
verticalAlignment: Text.AlignVCenter
|
|
}
|
|
}
|