mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
new folder for services, fancy calendar month button
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import "root:/modules/common"
|
||||
import "root:/modules/common/widgets"
|
||||
import "root:/services"
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import "root:/modules/common"
|
||||
import "root:/modules/common/widgets"
|
||||
import "root:/services"
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import "root:/modules/common"
|
||||
import "root:/modules/common/widgets"
|
||||
import "root:/services"
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import "root:/modules/common"
|
||||
import "root:/modules/common/widgets"
|
||||
import "root:/services"
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
import "../"
|
||||
import "root:/services"
|
||||
import "root:/modules/common"
|
||||
import "root:/modules/common/widgets"
|
||||
import QtQuick
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
import "root:/modules/common"
|
||||
import "root:/modules/common/widgets"
|
||||
import "root:/services"
|
||||
import "../"
|
||||
import Quickshell.Io
|
||||
import Quickshell
|
||||
Reference in New Issue
Block a user