// A small circular icon button — mute toggles, chevrons, per-row actions.

import QtQuick
import Quickshell
import qs.config
import qs.widgets

Rectangle {
    id: root

    property string icon: ""
    property string iconFallback: "dialog-information-symbolic"
    property int size: 28
    property int iconSize: 16
    property color tint: Theme.fg

    signal clicked

    implicitWidth: root.size
    implicitHeight: root.size
    radius: root.size / 2
    border.width: 0

    color: {
        if (mouse.pressed)
            return Theme.alpha(Theme.fg, Theme.activeAlpha);
        if (mouse.containsMouse)
            return Theme.alpha(Theme.fg, Theme.hoverAlpha);
        return "transparent";
    }

    Behavior on color {
        ColorAnimation {
            duration: Theme.durFast
        }
    }

    ThemedIcon {
        anchors.centerIn: parent
        size: root.iconSize
        icon: root.icon
        iconFallback: root.iconFallback
        tint: root.tint
    }

    MouseArea {
        id: mouse
        anchors.fill: parent
        hoverEnabled: true
        cursorShape: Qt.PointingHandCursor
        onClicked: root.clicked()
    }
}
