mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 22:04:56 +00:00
191 files reformatted across views, components, widgets, hybrid, contexts. New components: CCreateSchemaDialog, CAddFieldDialog, CAdminContentPanel. JS helpers: connBadgeStatus/Text, adminStats, exampleLabels, onLevelClicked. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
44 lines
1.0 KiB
QML
44 lines
1.0 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
|
|
import "MaterialPalette.qml" as MaterialPalette
|
|
|
|
Rectangle {
|
|
id: iconButton
|
|
property url iconSource: ""
|
|
property bool disabled: false
|
|
property string tooltip: ""
|
|
signal clicked()
|
|
|
|
width: 48
|
|
height: 48
|
|
radius: width / 2
|
|
color: iconButton.hovered && !disabled
|
|
? MaterialPalette.surfaceVariant : MaterialPalette.surface
|
|
border.color: MaterialPalette.outline
|
|
border.width: 1
|
|
|
|
property bool hovered: false
|
|
|
|
Image {
|
|
anchors.centerIn: parent
|
|
source: iconSource
|
|
width: 20
|
|
height: 20
|
|
opacity: disabled ? 0.4 : 1
|
|
fillMode: Image.PreserveAspectFit
|
|
}
|
|
|
|
MouseArea {
|
|
id: mouseArea
|
|
anchors.fill: parent
|
|
hoverEnabled: true
|
|
enabled: !disabled
|
|
onClicked: iconButton.clicked()
|
|
onPressed: iconButton.scale = 0.95
|
|
onReleased: iconButton.scale = 1
|
|
onEntered: iconButton.hovered = true
|
|
onExited: iconButton.hovered = false
|
|
}
|
|
}
|