import QtQuick import Weave.Controls import Weave.Templates as T T.IconButton { id: root implicitWidth: implicitContentWidth + leftPadding + rightPadding implicitHeight: implicitContentHeight + topPadding + bottomPadding padding: 0 dynamicColor: true icon { color: root.pressed ? Theme.component.iconbutton.icon.fill.pressed : (root.hovered || root.visualFocus) ? Theme.component.iconbutton.icon.fill.hover : Theme.component.iconbutton.icon.fill.default // most ActionIconButtons will display implicitly-sized ui-control icons width: 0 height: 0 } indicator: null background: null contentItem: T.IconImage { url: root.icon.source name: root.icon.name sourceSize: Qt.size(root.icon.width, root.icon.height) color: { if (!root.dynamicColor) { return root.icon.color } else { var state = (root.pressed || root.popupOpened) ? "pressed" : (root.enabled && root.hovered) ? "hover" : root.visualFocus ? "focus" : "default" return root.checked ? Theme.component.iconbutton.icon.fill.selected[state] : Theme.component.iconbutton.icon.fill[state] } } } }