//@ pragma UseQApplication
import Quickshell
import Quickshell.Io
import QtQuick
import QtQuick.Layouts
import Quickshell.Widgets
import Quickshell.Hyprland

import "widgets" as Widgets
import "widgets/player" as Player
import "widgets/common" as Common
import "widgets/clock" as Clock
import "widgets/workspace" as Workspace

// Tako kindly threatened you to sort the naming schema and to put all the svg's in an asset folder, so please do that

        PanelWindow {
            property var modelData
            screen: modelData.values[0];

            color: '#20ffffff'
        anchors {
          top: true
          left: true
          right: true
        }

        implicitHeight: 32
        RowLayout {
            height: 28
            anchors {
                top: parent.top
                left: parent.left
                right: parent.right
                // bottomMargin: 2
                leftMargin: 10
                rightMargin: 10
            }
            RowLayout { // Left
                Layout.alignment: Qt.AlignLeft
                Clock.Date {}
                Clock.Clock {}
                Workspace.WorkspaceWidget {}
            }
            RowLayout { // Center
                // TODO: add icons of the active window per workspace in the workspace tab
                anchors.centerIn: parent
            }
            RowLayout { // Right
                Layout.alignment: Qt.AlignRight
                Loader {
                    sourceComponent: Widgets.Audio {}
                }
                RowLayout {
                    Text {
                        text: HyprlandWindowTracker.HyprlandWindowTracker.aaaa
                    }
                    visible: Player.activePlayer.isPlaying()
                    Player.PlayerWidgetV2 {
                    }
                }
                    Widgets.SystemTray {
                        id: systemTray
                    }
            }
        }
        Rectangle {
            anchors {
                bottom: parent.bottom
                left: parent.left
                right: parent.right
            }
            height: 1
            color: "#8d8d8d"
        }
      }
