// Visible only while a video wallpaper is active: one click pauses or resumes
// it. Exists because a playing wallpaper has real costs the user may want to
// stop right now — a remote desktop session, a recording, or just quiet —
// without opening Settings. Same conditional pattern as ActivityIndicator.

import QtQuick
import qs.config
import qs.services
import qs.widgets

Pill {
    id: root

    visible: VideoWallpaper.active
    horizontalPadding: 10

    onActivated: VideoWallpaper.togglePause()
    onSecondaryActivated: ShellState.openSettings("appearance")

    Accessible.name: VideoWallpaper.paused ? "Resume video wallpaper" : "Pause video wallpaper"

    Text {
        anchors.verticalCenter: parent.verticalCenter
        text: VideoWallpaper.paused ? "\u{F040A}" : "\u{F03E4}" // play / pause
        color: VideoWallpaper.paused ? Theme.barFgDim : Theme.warn
        font.family: Theme.fontMono
        font.pixelSize: 13
    }

    Text {
        anchors.verticalCenter: parent.verticalCenter
        text: VideoWallpaper.paused
            ? (VideoWallpaper.gamePaused ? "Paused for game"
                : (VideoWallpaper.batteryPaused ? "Paused on battery" : "Paused"))
            : "Wallpaper"
        color: Theme.barFgDim
        font.family: Theme.fontFamily
        font.pixelSize: Theme.fontSizeSmall
    }
}
