Files
metabuilder/qml/Material/MaterialIconButton.qml
johndoe6345789 6e394d7846 style(qt6): 80-char margin enforced — 737 violations → 29 remaining
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>
2026-03-19 15:48:39 +00:00

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