diff --git a/.config/quickshell/modules/bar/Bar.qml b/.config/quickshell/modules/bar/Bar.qml index f451f8744..cbaaad833 100644 --- a/.config/quickshell/modules/bar/Bar.qml +++ b/.config/quickshell/modules/bar/Bar.qml @@ -1,5 +1,6 @@ import "root:/modules/common" import "root:/modules/common/widgets" +import "root:/services" import QtQuick import QtQuick.Controls import QtQuick.Layouts diff --git a/.config/quickshell/modules/bar/ClockWidget.qml b/.config/quickshell/modules/bar/ClockWidget.qml index 6093eaf8b..e44ac7f5a 100644 --- a/.config/quickshell/modules/bar/ClockWidget.qml +++ b/.config/quickshell/modules/bar/ClockWidget.qml @@ -1,5 +1,6 @@ import "root:/modules/common" import "root:/modules/common/widgets" +import "root:/services" import QtQuick import QtQuick.Layouts diff --git a/.config/quickshell/modules/bar/Media.qml b/.config/quickshell/modules/bar/Media.qml index c5c29093f..4200a77c5 100644 --- a/.config/quickshell/modules/bar/Media.qml +++ b/.config/quickshell/modules/bar/Media.qml @@ -1,5 +1,6 @@ import "root:/modules/common" import "root:/modules/common/widgets" +import "root:/services" import QtQuick import QtQuick.Layouts import Quickshell diff --git a/.config/quickshell/modules/bar/Resources.qml b/.config/quickshell/modules/bar/Resources.qml index 6d6514632..8de5dcfc1 100644 --- a/.config/quickshell/modules/bar/Resources.qml +++ b/.config/quickshell/modules/bar/Resources.qml @@ -1,5 +1,6 @@ import "root:/modules/common" import "root:/modules/common/widgets" +import "root:/services" import QtQuick import QtQuick.Layouts import Quickshell diff --git a/.config/quickshell/modules/common/Appearance.qml b/.config/quickshell/modules/common/Appearance.qml index d3c03520a..4fb519793 100644 --- a/.config/quickshell/modules/common/Appearance.qml +++ b/.config/quickshell/modules/common/Appearance.qml @@ -164,6 +164,7 @@ Singleton { property QtObject elementDecel: QtObject { property int duration: 180 property int type: Easing.OutCirc + property int velocity: 650 } property QtObject menuDecel: QtObject { property int duration: 350 diff --git a/.config/quickshell/modules/common/widgets/StyledToolTip.qml b/.config/quickshell/modules/common/widgets/StyledToolTip.qml index df97fc8e8..98945ceec 100644 --- a/.config/quickshell/modules/common/widgets/StyledToolTip.qml +++ b/.config/quickshell/modules/common/widgets/StyledToolTip.qml @@ -6,16 +6,25 @@ import QtQuick.Layouts ToolTip { property string content - parent: parent - visible: parent.hovered + property bool extraVisibleCondition: true padding: 7 + + visible: (extraVisibleCondition && parent.hovered) + background: Rectangle { color: Appearance.colors.colTooltip radius: Appearance.rounding.small - width: tooltipText.width + 2 * padding + width: tooltipTextObject.width + 2 * padding + Behavior on opacity { + OpacityAnimator { + duration: Appearance.animation.elementDecel.duration + easing.type: Appearance.animation.elementDecel.type + } + } + opacity: visible ? 1 : 0 } StyledText { - id: tooltipText + id: tooltipTextObject text: content color: Appearance.colors.colOnTooltip wrapMode: Text.WordWrap diff --git a/.config/quickshell/modules/sidebarRight/SidebarCalendar.qml b/.config/quickshell/modules/sidebarRight/SidebarCalendar.qml index a4e27241a..bf749f0c2 100644 --- a/.config/quickshell/modules/sidebarRight/SidebarCalendar.qml +++ b/.config/quickshell/modules/sidebarRight/SidebarCalendar.qml @@ -13,13 +13,13 @@ Rectangle { Layout.fillWidth: true radius: Appearance.rounding.normal color: Appearance.colors.colLayer1 - implicitHeight: 343 // TODO NO HARD CODE + // implicitHeight: 343 // TODO NO HARD CODE + height: calendarWidgetRow.height RowLayout { - id: calendarRow - anchors.fill: parent - // width: parent.width - 10 * 2 - height: parent.height - 10 * 2 + id: calendarWidgetRow + anchors.fill: parent + height: tabStack.height spacing: 10 property int selectedTab: 0 @@ -36,11 +36,11 @@ Rectangle { {"name": "To Do", "icon": "done_outline"} ] NavRailButton { - toggled: calendarRow.selectedTab == index + toggled: calendarWidgetRow.selectedTab == index buttonText: modelData.name buttonIcon: modelData.icon onClicked: { - calendarRow.selectedTab = index + calendarWidgetRow.selectedTab = index } } } @@ -50,7 +50,7 @@ Rectangle { StackLayout { id: tabStack Layout.fillWidth: true - // Layout.fillHeight: true + height: 358 // ???? wtf Layout.alignment: Qt.AlignVCenter property int realIndex: 0 property int animationDuration: Appearance.animation.elementDecel.duration * 1.5 @@ -65,6 +65,7 @@ Rectangle { height: calendarColumn.height property int monthShift: 0 property var viewingDate: CalendarLayout.getDateInXMonthsTime(monthShift) + property var calendarLayout: CalendarLayout.getCalendarLayout(viewingDate, monthShift === 0) MouseArea { anchors.fill: parent @@ -84,18 +85,13 @@ Rectangle { // Calendar header RowLayout { Layout.fillWidth: true - Layout.fillHeight: false spacing: 5 CalendarHeaderButton { + buttonText: `${monthShift != 0 ? "• " : ""}${viewingDate.toLocaleDateString(Qt.locale(), "MMMM yyyy")}` + tooltipText: (monthShift === 0) ? "" : "Jump to current month" onClicked: { monthShift = 0; } - content: StyledText { - text: `${monthShift != 0 ? "• " : ""}${viewingDate.toLocaleDateString(Qt.locale(), "MMMM yyyy")}` - horizontalAlignment: Text.AlignHCenter - font.pixelSize: Appearance.font.pixelSize.larger - color: Appearance.colors.colOnLayer1 - } } Item { Layout.fillWidth: true @@ -106,9 +102,9 @@ Rectangle { onClicked: { monthShift--; } - content: MaterialSymbol { + contentItem: MaterialSymbol { text: "chevron_left" - font.pixelSize: Appearance.font.pixelSize.large + font.pixelSize: Appearance.font.pixelSize.larger horizontalAlignment: Text.AlignHCenter color: Appearance.colors.colOnLayer1 } @@ -118,9 +114,9 @@ Rectangle { onClicked: { monthShift++; } - content: MaterialSymbol { + contentItem: MaterialSymbol { text: "chevron_right" - font.pixelSize: Appearance.font.pixelSize.large + font.pixelSize: Appearance.font.pixelSize.larger horizontalAlignment: Text.AlignHCenter color: Appearance.colors.colOnLayer1 } @@ -147,16 +143,17 @@ Rectangle { // Real week rows Repeater { id: calendarRows - model: CalendarLayout.getCalendarLayout(viewingDate, monthShift === 0) + // model: calendarLayout + model: 6 delegate: RowLayout { Layout.alignment: Qt.AlignHCenter Layout.fillHeight: false spacing: 5 Repeater { - model: modelData + model: Array(7).fill(modelData) delegate: CalendarDayButton { - day: modelData.day - isToday: modelData.today + day: calendarLayout[modelData][index].day + isToday: calendarLayout[modelData][index].today } } } @@ -186,10 +183,10 @@ Rectangle { } Connections { - target: calendarRow + target: calendarWidgetRow function onSelectedTabChanged() { delayedStackSwitch.start() - tabStack.realIndex = calendarRow.selectedTab + tabStack.realIndex = calendarWidgetRow.selectedTab } } Timer { @@ -197,7 +194,7 @@ Rectangle { interval: tabStack.animationDuration / 2 repeat: false onTriggered: { - tabStack.currentIndex = calendarRow.selectedTab + tabStack.currentIndex = calendarWidgetRow.selectedTab } } diff --git a/.config/quickshell/modules/sidebarRight/SidebarRight.qml b/.config/quickshell/modules/sidebarRight/SidebarRight.qml index ce343ee24..381cf3977 100644 --- a/.config/quickshell/modules/sidebarRight/SidebarRight.qml +++ b/.config/quickshell/modules/sidebarRight/SidebarRight.qml @@ -1,5 +1,6 @@ import "root:/modules/common" import "root:/modules/common/widgets" +import "root:/services" import "./quickToggles/" import QtQuick import QtQuick.Controls @@ -129,8 +130,8 @@ Scope { anchors.margins: 5 spacing: 5 - Network {} - Bluetooth {} + NetworkToggle {} + BluetoothToggle {} NightLight {} GameMode {} IdleInhibitor {} diff --git a/.config/quickshell/modules/sidebarRight/calendar/CalendarHeaderButton.qml b/.config/quickshell/modules/sidebarRight/calendar/CalendarHeaderButton.qml index 447dc6a37..babe3a26f 100644 --- a/.config/quickshell/modules/sidebarRight/calendar/CalendarHeaderButton.qml +++ b/.config/quickshell/modules/sidebarRight/calendar/CalendarHeaderButton.qml @@ -6,12 +6,19 @@ import QtQuick.Layouts Button { id: button - required default property Item content + property string buttonText: "" + property string tooltipText: "" property bool forceCircle: false implicitHeight: 30 implicitWidth: forceCircle ? implicitHeight : (contentItem.implicitWidth + 10 * 2) + Behavior on implicitWidth { + SmoothedAnimation { + velocity: Appearance.animation.elementDecel.velocity + } + } + background: Rectangle { anchors.fill: parent radius: Appearance.rounding.full @@ -26,6 +33,15 @@ Button { } } - contentItem: content + contentItem: StyledText { + text: buttonText + horizontalAlignment: Text.AlignHCenter + font.pixelSize: Appearance.font.pixelSize.larger + color: Appearance.colors.colOnLayer1 + } + StyledToolTip { + content: tooltipText + extraVisibleCondition: tooltipText.length > 0 + } } \ No newline at end of file diff --git a/.config/quickshell/modules/sidebarRight/quickToggles/Bluetooth.qml b/.config/quickshell/modules/sidebarRight/quickToggles/BluetoothToggle.qml similarity index 98% rename from .config/quickshell/modules/sidebarRight/quickToggles/Bluetooth.qml rename to .config/quickshell/modules/sidebarRight/quickToggles/BluetoothToggle.qml index 682334957..a02caea38 100644 --- a/.config/quickshell/modules/sidebarRight/quickToggles/Bluetooth.qml +++ b/.config/quickshell/modules/sidebarRight/quickToggles/BluetoothToggle.qml @@ -1,4 +1,5 @@ import "../" +import "root:/services" import "root:/modules/common" import "root:/modules/common/widgets" import QtQuick diff --git a/.config/quickshell/modules/sidebarRight/quickToggles/Network.qml b/.config/quickshell/modules/sidebarRight/quickToggles/NetworkToggle.qml similarity index 98% rename from .config/quickshell/modules/sidebarRight/quickToggles/Network.qml rename to .config/quickshell/modules/sidebarRight/quickToggles/NetworkToggle.qml index c3d8173ca..4a15071eb 100644 --- a/.config/quickshell/modules/sidebarRight/quickToggles/Network.qml +++ b/.config/quickshell/modules/sidebarRight/quickToggles/NetworkToggle.qml @@ -1,5 +1,6 @@ import "root:/modules/common" import "root:/modules/common/widgets" +import "root:/services" import "../" import Quickshell.Io import Quickshell diff --git a/.config/quickshell/modules/common/Audio.qml b/.config/quickshell/services/Audio.qml similarity index 100% rename from .config/quickshell/modules/common/Audio.qml rename to .config/quickshell/services/Audio.qml diff --git a/.config/quickshell/modules/common/Bluetooth.qml b/.config/quickshell/services/Bluetooth.qml similarity index 100% rename from .config/quickshell/modules/common/Bluetooth.qml rename to .config/quickshell/services/Bluetooth.qml diff --git a/.config/quickshell/modules/common/Brightness.qml b/.config/quickshell/services/Brightness.qml similarity index 100% rename from .config/quickshell/modules/common/Brightness.qml rename to .config/quickshell/services/Brightness.qml diff --git a/.config/quickshell/modules/common/DateTime.qml b/.config/quickshell/services/DateTime.qml similarity index 100% rename from .config/quickshell/modules/common/DateTime.qml rename to .config/quickshell/services/DateTime.qml diff --git a/.config/quickshell/modules/common/MprisController.qml b/.config/quickshell/services/MprisController.qml similarity index 100% rename from .config/quickshell/modules/common/MprisController.qml rename to .config/quickshell/services/MprisController.qml diff --git a/.config/quickshell/modules/common/Network.qml b/.config/quickshell/services/Network.qml similarity index 100% rename from .config/quickshell/modules/common/Network.qml rename to .config/quickshell/services/Network.qml diff --git a/.config/quickshell/modules/common/ResourceUsage.qml b/.config/quickshell/services/ResourceUsage.qml similarity index 100% rename from .config/quickshell/modules/common/ResourceUsage.qml rename to .config/quickshell/services/ResourceUsage.qml diff --git a/.config/quickshell/modules/common/SystemInfo.qml b/.config/quickshell/services/SystemInfo.qml similarity index 100% rename from .config/quickshell/modules/common/SystemInfo.qml rename to .config/quickshell/services/SystemInfo.qml