Files
tustu/app_qml/components/TopButton.qml
johndoe6345789 94380b4933 Refactor QML application structure and introduce engine simulation
- 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.
2026-01-11 03:58:52 +00:00

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
}
}