1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-25 14:02:53 -05:00

workaround for all the terrible default QT scrolling behavior

- DankGridView, DankFlickable, DankListView\
- Touchpad behavior greatly improved by preserving momentum
- Fixed janky nested scrollers in control center
This commit is contained in:
bbedward
2025-08-07 15:22:40 -04:00
parent 02ab8e2db5
commit 98d2ca24a8
25 changed files with 973 additions and 788 deletions

View File

@@ -368,8 +368,9 @@ PanelWindow {
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.05)
border.width: 1
GoodScrollingListView {
DankListView {
id: appList
mouseWheelSpeed: 20
property int itemHeight: 72
property int iconSize: 56
@@ -533,7 +534,7 @@ PanelWindow {
}
}
GoodScrollingGridView {
DankGridView {
id: appGrid
property int currentIndex: appLauncher.selectedIndex

View File

@@ -101,7 +101,7 @@ Rectangle {
}
ListView {
DankListView {
id: eventsList
anchors.top: headerRow.bottom

View File

@@ -33,46 +33,90 @@ Item {
}
}
ScrollView {
// Output Tab - DankFlickable
DankFlickable {
width: parent.width
height: parent.height - 48
visible: audioTab.audioSubTab === 0
clip: true
contentHeight: outputColumn.height
contentWidth: width
mouseWheelSpeed: 20
Column {
id: outputColumn
width: parent.width
spacing: Theme.spacingL
VolumeControl {
Loader {
width: parent.width
sourceComponent: volumeComponent
}
AudioDevicesList {
Loader {
width: parent.width
sourceComponent: outputDevicesComponent
}
}
}
ScrollView {
// Input Tab - DankFlickable
DankFlickable {
width: parent.width
height: parent.height - 48
visible: audioTab.audioSubTab === 1
clip: true
contentHeight: inputColumn.height
contentWidth: width
mouseWheelSpeed: 20
Column {
id: inputColumn
width: parent.width
spacing: Theme.spacingL
MicrophoneControl {
Loader {
width: parent.width
sourceComponent: microphoneComponent
}
AudioInputDevicesList {
Loader {
width: parent.width
sourceComponent: inputDevicesComponent
}
}
}
}
}
// Volume Control Component
Component {
id: volumeComponent
VolumeControl {
width: parent.width
}
}
// Microphone Control Component
Component {
id: microphoneComponent
MicrophoneControl {
width: parent.width
}
}
// Output Devices Component
Component {
id: outputDevicesComponent
AudioDevicesList {
width: parent.width
}
}
// Input Devices Component
Component {
id: inputDevicesComponent
AudioInputDevicesList {
width: parent.width
}
}
}

View File

@@ -11,7 +11,15 @@ import qs.Widgets
Column {
id: root
property var bluetoothContextMenuWindow
function findBluetoothContextMenu() {
var p = parent;
while (p) {
if (p.bluetoothContextMenuWindow)
return p.bluetoothContextMenuWindow;
p = p.parent;
}
return null;
}
width: parent.width
spacing: Theme.spacingM
@@ -117,10 +125,11 @@ Column {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
if (bluetoothContextMenuWindow) {
bluetoothContextMenuWindow.deviceData = modelData;
let localPos = btMenuButtonArea.mapToItem(bluetoothContextMenuWindow.parentItem, btMenuButtonArea.width / 2, btMenuButtonArea.height);
bluetoothContextMenuWindow.show(localPos.x, localPos.y);
var contextMenu = root.findBluetoothContextMenu();
if (contextMenu) {
contextMenu.deviceData = modelData;
let localPos = btMenuButtonArea.mapToItem(contextMenu.parentItem, btMenuButtonArea.width / 2, btMenuButtonArea.height);
contextMenu.show(localPos.x, localPos.y);
}
}
}

View File

@@ -12,33 +12,39 @@ import qs.Widgets
Item {
id: bluetoothTab
ScrollView {
property alias bluetoothContextMenuWindow: bluetoothContextMenuWindow
DankFlickable {
anchors.fill: parent
clip: true
ScrollBar.vertical.policy: ScrollBar.AsNeeded
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
contentHeight: mainColumn.height
contentWidth: width
mouseWheelSpeed: 20
Column {
id: mainColumn
width: parent.width
spacing: Theme.spacingL
BluetoothToggle {
Loader {
width: parent.width
sourceComponent: toggleComponent
}
PairedDevicesList {
bluetoothContextMenuWindow: bluetoothContextMenuWindow
Loader {
width: parent.width
sourceComponent: pairedComponent
}
AvailableDevicesList {
Loader {
width: parent.width
sourceComponent: availableComponent
}
}
}
BluetoothContextMenu {
id: bluetoothContextMenuWindow
parentItem: bluetoothTab
}
@@ -57,7 +63,26 @@ Item {
onClicked: {
}
}
}
}
Component {
id: toggleComponent
BluetoothToggle {
width: parent.width
}
}
Component {
id: pairedComponent
PairedDevicesList {
width: parent.width
}
}
Component {
id: availableComponent
AvailableDevicesList {
width: parent.width
}
}
}

View File

@@ -8,7 +8,7 @@ import qs.Modules
import qs.Services
import qs.Widgets
ScrollView {
Item {
id: displayTab
property var brightnessDebounceTimer
@@ -16,19 +16,61 @@ ScrollView {
brightnessDebounceTimer: Timer {
property int pendingValue: 0
interval: BrightnessService.ddcAvailable ? 500 : 50 // 500ms for slow DDC (i2c), 50ms for fast laptop backlight
interval: BrightnessService.ddcAvailable ? 500 : 50
repeat: false
onTriggered: {
BrightnessService.setBrightnessInternal(pendingValue);
}
}
clip: true
Column {
width: parent.width
spacing: Theme.spacingL
DankFlickable {
anchors.fill: parent
clip: true
contentHeight: mainColumn.height
contentWidth: width
mouseWheelSpeed: 20
Column {
id: mainColumn
width: parent.width
spacing: Theme.spacingL
Loader {
width: parent.width
sourceComponent: brightnessComponent
}
Loader {
width: parent.width
sourceComponent: settingsComponent
}
}
}
Process {
id: nightModeEnableProcess
command: ["bash", "-c", "if command -v wlsunset > /dev/null; then pkill wlsunset; wlsunset -t 3000 & elif command -v redshift > /dev/null; then pkill redshift; redshift -P -O 3000 & else echo 'No night mode tool available'; fi"]
running: false
onExited: (exitCode) => {
if (exitCode !== 0) {
SettingsData.setNightModeEnabled(false);
}
}
}
Process {
id: nightModeDisableProcess
command: ["bash", "-c", "pkill wlsunset; pkill redshift; if command -v wlsunset > /dev/null; then wlsunset -t 6500 -T 6500 & sleep 1; pkill wlsunset; elif command -v redshift > /dev/null; then redshift -P -O 6500; redshift -x; fi"]
running: false
onExited: (exitCode) => {
if (exitCode !== 0) {
}
}
}
Component {
id: brightnessComponent
Column {
width: parent.width
spacing: Theme.spacingM
@@ -48,12 +90,10 @@ ScrollView {
rightIcon: "brightness_high"
enabled: BrightnessService.brightnessAvailable
onSliderValueChanged: function(newValue) {
brightnessDebounceTimer.pendingValue = newValue;
brightnessDebounceTimer.restart();
}
onSliderDragFinished: function(finalValue) {
brightnessDebounceTimer.stop();
BrightnessService.setBrightnessInternal(finalValue);
}
@@ -66,9 +106,11 @@ ScrollView {
visible: BrightnessService.ddcAvailable && !BrightnessService.laptopBacklightAvailable
anchors.horizontalCenter: parent.horizontalCenter
}
}
}
Component {
id: settingsComponent
Column {
width: parent.width
spacing: Theme.spacingM
@@ -110,12 +152,10 @@ ScrollView {
font.weight: Font.Medium
anchors.horizontalCenter: parent.horizontalCenter
}
}
MouseArea {
id: nightModeToggle
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
@@ -129,7 +169,6 @@ ScrollView {
}
}
}
}
Rectangle {
@@ -158,12 +197,10 @@ ScrollView {
font.weight: Font.Medium
anchors.horizontalCenter: parent.horizontalCenter
}
}
MouseArea {
id: lightModeToggle
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
@@ -177,40 +214,9 @@ ScrollView {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
}
}
}
Process {
id: nightModeEnableProcess
command: ["bash", "-c", "if command -v wlsunset > /dev/null; then pkill wlsunset; wlsunset -t 3000 & elif command -v redshift > /dev/null; then pkill redshift; redshift -P -O 3000 & else echo 'No night mode tool available'; fi"]
running: false
onExited: (exitCode) => {
if (exitCode !== 0) {
SettingsData.setNightModeEnabled(false);
}
}
}
Process {
id: nightModeDisableProcess
command: ["bash", "-c", "pkill wlsunset; pkill redshift; if command -v wlsunset > /dev/null; then wlsunset -t 6500 -T 6500 & sleep 1; pkill wlsunset; elif command -v redshift > /dev/null; then redshift -P -O 6500; redshift -x; fi"]
running: false
onExited: (exitCode) => {
if (exitCode !== 0)
}
}
}
}

View File

@@ -2,144 +2,27 @@ import QtQuick
import QtQuick.Controls
import qs.Common
import qs.Services
import qs.Widgets
ListView {
DankListView {
id: root
property alias count: root.count
readonly property real listContentHeight: root.contentHeight
readonly property bool atYBeginning: root.contentY === 0
property real stableY: 0
property bool isUserScrolling: false
property alias listContentHeight: root.contentHeight
width: parent.width
height: parent.height
clip: true
model: NotificationService.groupedNotifications
spacing: Theme.spacingL
interactive: true
boundsBehavior: Flickable.StopAtBounds
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
flickDeceleration: 1500
maximumFlickVelocity: 2000
boundsMovement: Flickable.FollowBoundsBehavior
pressDelay: 0
flickableDirection: Flickable.VerticalFlick
cacheBuffer: 1000
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
WheelHandler {
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
property real momentum: 0
onWheel: (event) => {
if (event.pixelDelta.y !== 0) {
// Touchpad with pixel delta
momentum = event.pixelDelta.y * 1.8
} else {
// Mouse wheel with angle delta
momentum = (event.angleDelta.y / 120) * (parent.spacing * 2.5) // ~2.5 items per wheel step
}
let newY = parent.contentY - momentum
newY = Math.max(0, Math.min(parent.contentHeight - parent.height, newY))
parent.contentY = newY
momentum *= 0.92 // Decay for smooth momentum
event.accepted = true
}
}
onMovementStarted: isUserScrolling = true
onMovementEnded: {
isUserScrolling = false;
if (contentY > 40)
stableY = contentY;
}
onContentYChanged: {
if (!isUserScrolling && visible && parent.visible && stableY > 40 && Math.abs(contentY - stableY) > 10)
contentY = stableY;
}
NotificationEmptyState {
visible: root.count === 0
anchors.centerIn: parent
}
add: Transition {
enabled: !root.isUserScrolling
ParallelAnimation {
NumberAnimation {
properties: "opacity"
from: 0
to: 1
duration: root.isUserScrolling ? 0 : Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
NumberAnimation {
properties: "height"
from: 0
duration: root.isUserScrolling ? 0 : Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
}
remove: Transition {
SequentialAnimation {
PauseAnimation {
duration: 50
}
ParallelAnimation {
NumberAnimation {
properties: "opacity"
to: 0
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
NumberAnimation {
properties: "height,anchors.topMargin,anchors.bottomMargin"
to: 0
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
}
}
displaced: Transition {
enabled: false
NumberAnimation {
properties: "y"
duration: 0
}
}
move: Transition {
enabled: false
NumberAnimation {
properties: "y"
duration: 0
easing.type: Theme.emphasizedEasing
}
}
delegate: NotificationCard {
notificationGroup: modelData
}
}

View File

@@ -49,9 +49,7 @@ Column {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
processListView.captureAnchor();
SysMonitorService.setSortBy("name");
processListView.restoreAnchor();
}
}
@@ -90,9 +88,7 @@ Column {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
processListView.captureAnchor();
SysMonitorService.setSortBy("cpu");
processListView.restoreAnchor();
}
}
@@ -131,9 +127,7 @@ Column {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
processListView.captureAnchor();
SysMonitorService.setSortBy("memory");
processListView.restoreAnchor();
}
}
@@ -173,9 +167,7 @@ Column {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
processListView.captureAnchor();
SysMonitorService.setSortBy("pid");
processListView.restoreAnchor();
}
}
@@ -211,9 +203,7 @@ Column {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
processListView.captureAnchor();
SysMonitorService.toggleSortOrder();
processListView.restoreAnchor();
}
}
@@ -228,101 +218,21 @@ Column {
}
ListView {
DankListView {
id: processListView
property real stableY: 0
property bool isUserScrolling: false
property bool isScrollBarDragging: false
property string keyRoleName: "pid"
property var _anchorKey: undefined
property real _anchorOffset: 0
function captureAnchor() {
const y = contentY + 1;
const idx = indexAt(0, y);
if (idx < 0 || !model || idx >= model.length)
return ;
_anchorKey = model[idx][keyRoleName];
const it = itemAtIndex(idx);
_anchorOffset = it ? (y - it.y) : 0;
}
function restoreAnchor() {
Qt.callLater(function() {
if (_anchorKey === undefined || !model)
return ;
var i = -1;
for (var j = 0; j < model.length; ++j) {
if (model[j][keyRoleName] === _anchorKey) {
i = j;
break;
}
}
if (i < 0)
return ;
positionViewAtIndex(i, ListView.Beginning);
const maxY = Math.max(0, contentHeight - height);
contentY = Math.max(0, Math.min(maxY, contentY + _anchorOffset - 1));
});
}
width: parent.width
height: parent.height - columnHeaders.height
clip: true
spacing: 4
model: SysMonitorService.processes
boundsBehavior: Flickable.StopAtBounds
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
interactive: true
flickDeceleration: 1500 // Touch only in Qt 6.9+ // Lower = more momentum, longer scrolling
maximumFlickVelocity: 2000 // Touch only in Qt 6.9+ // Higher = faster maximum scroll speed
boundsMovement: Flickable.FollowBoundsBehavior
pressDelay: 0
flickableDirection: Flickable.VerticalFlick
onMovementStarted: isUserScrolling = true
onMovementEnded: {
isUserScrolling = false;
if (contentY > 40)
stableY = contentY;
}
onContentYChanged: {
if (!isUserScrolling && !isScrollBarDragging && visible && stableY > 40 && Math.abs(contentY - stableY) > 10)
contentY = stableY;
}
onModelChanged: {
if (model && model.length > 0 && !isUserScrolling && stableY > 40)
Qt.callLater(function() {
contentY = stableY;
});
}
delegate: ProcessListItem {
process: modelData
contextMenu: root.contextMenu
}
ScrollBar.vertical: ScrollBar {
id: verticalScrollBar
policy: ScrollBar.AsNeeded
onPressedChanged: {
processListView.isScrollBarDragging = pressed;
if (!pressed && processListView.contentY > 40)
processListView.stableY = processListView.contentY;
}
}
ScrollBar.horizontal: ScrollBar {
policy: ScrollBar.AlwaysOff
}
}
}

View File

@@ -5,35 +5,49 @@ import qs.Common
import qs.Services
import qs.Widgets
ScrollView {
Item {
id: appearanceTab
// Qt 6.9+ scrolling: Enhanced mouse wheel and touchpad responsiveness
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
WheelHandler {
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
onWheel: (event) => {
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 80
let flickable = appearanceTab.contentItem
let newY = flickable.contentY - delta
newY = Math.max(0, Math.min(flickable.contentHeight - flickable.height, newY))
flickable.contentY = newY
event.accepted = true
DankFlickable {
anchors.fill: parent
anchors.topMargin: Theme.spacingL
anchors.bottomMargin: Theme.spacingXL
clip: true
contentHeight: mainColumn.height
contentWidth: width
mouseWheelSpeed: 20
Column {
id: mainColumn
width: parent.width
spacing: Theme.spacingXL
Loader {
width: parent.width
sourceComponent: displayComponent
}
Loader {
width: parent.width
sourceComponent: transparencyComponent
}
Loader {
width: parent.width
sourceComponent: themeComponent
}
Loader {
width: parent.width
sourceComponent: systemThemingComponent
}
}
}
contentWidth: availableWidth
contentHeight: column.implicitHeight + Theme.spacingXL
clip: true
Column {
id: column
width: parent.width
spacing: Theme.spacingXL
topPadding: Theme.spacingL
bottomPadding: Theme.spacingXL
// Display Settings Component
Component {
id: displayComponent
StyledRect {
width: parent.width
height: displaySection.implicitHeight + Theme.spacingL * 2
@@ -273,9 +287,13 @@ ScrollView {
}
}
}
}
// Transparency Settings Component
Component {
id: transparencyComponent
StyledRect {
width: parent.width
height: transparencySection.implicitHeight + Theme.spacingL * 2
@@ -391,9 +409,13 @@ ScrollView {
}
}
}
}
// Theme Color Component
Component {
id: themeComponent
StyledRect {
width: parent.width
height: themeSection.implicitHeight + Theme.spacingL * 2
@@ -759,9 +781,13 @@ ScrollView {
}
}
}
}
// System App Theming Component
Component {
id: systemThemingComponent
StyledRect {
width: parent.width
height: systemThemingSection.implicitHeight + Theme.spacingL * 2
@@ -828,9 +854,7 @@ ScrollView {
}
}
}
}
Process {

View File

@@ -4,34 +4,44 @@ import Quickshell.Widgets
import qs.Common
import qs.Widgets
ScrollView {
Item {
id: launcherTab
// Qt 6.9+ scrolling: Enhanced mouse wheel and touchpad responsiveness
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
WheelHandler {
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
onWheel: (event) => {
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 80
let flickable = launcherTab.contentItem
let newY = flickable.contentY - delta
newY = Math.max(0, Math.min(flickable.contentHeight - flickable.height, newY))
flickable.contentY = newY
event.accepted = true
DankFlickable {
anchors.fill: parent
anchors.topMargin: Theme.spacingL
anchors.bottomMargin: Theme.spacingXL
clip: true
contentHeight: mainColumn.height
contentWidth: width
mouseWheelSpeed: 20
Column {
id: mainColumn
width: parent.width
spacing: Theme.spacingXL
Loader {
width: parent.width
sourceComponent: appLauncherComponent
}
Loader {
width: parent.width
sourceComponent: dockComponent
}
Loader {
width: parent.width
sourceComponent: recentlyUsedComponent
}
}
}
contentHeight: column.implicitHeight + Theme.spacingXL
clip: true
Column {
id: column
width: parent.width
spacing: Theme.spacingXL
topPadding: Theme.spacingL
bottomPadding: Theme.spacingXL
// App Launcher Component
Component {
id: appLauncherComponent
StyledRect {
width: parent.width
height: appLauncherSection.implicitHeight + Theme.spacingL * 2
@@ -159,9 +169,13 @@ ScrollView {
}
}
}
}
// Dock Component
Component {
id: dockComponent
StyledRect {
width: parent.width
height: dockSection.implicitHeight + Theme.spacingL * 2
@@ -262,7 +276,12 @@ ScrollView {
}
}
}
// Recently Used Apps Component
Component {
id: recentlyUsedComponent
StyledRect {
width: parent.width
height: recentlyUsedSection.implicitHeight + Theme.spacingL * 2
@@ -474,9 +493,6 @@ ScrollView {
}
}
}
}
}

View File

@@ -7,35 +7,47 @@ import qs.Modals
import qs.Services
import qs.Widgets
ScrollView {
Item {
id: personalizationTab
// Qt 6.9+ scrolling: Enhanced mouse wheel and touchpad responsiveness
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
WheelHandler {
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
onWheel: (event) => {
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 80
let flickable = personalizationTab.contentItem
let newY = flickable.contentY - delta
newY = Math.max(0, Math.min(flickable.contentHeight - flickable.height, newY))
flickable.contentY = newY
event.accepted = true
}
}
property alias profileBrowser: profileBrowserLoader.item
property alias wallpaperBrowser: wallpaperBrowserLoader.item
contentHeight: column.implicitHeight
clip: true
Column {
id: column
width: parent.width
spacing: Theme.spacingXL
DankFlickable {
anchors.fill: parent
anchors.topMargin: Theme.spacingL
anchors.bottomMargin: Theme.spacingXL
clip: true
contentHeight: mainColumn.height
contentWidth: width
mouseWheelSpeed: 20
Column {
id: mainColumn
width: parent.width
spacing: Theme.spacingXL
Loader {
width: parent.width
sourceComponent: profileComponent
}
Loader {
width: parent.width
sourceComponent: wallpaperComponent
}
Loader {
width: parent.width
sourceComponent: dynamicThemeComponent
}
}
}
// Profile Image Component
Component {
id: profileComponent
StyledRect {
width: parent.width
height: profileSection.implicitHeight + Theme.spacingL * 2
@@ -294,9 +306,13 @@ ScrollView {
}
}
}
}
// Wallpaper Component
Component {
id: wallpaperComponent
StyledRect {
width: parent.width
height: wallpaperSection.implicitHeight + Theme.spacingL * 2
@@ -491,9 +507,13 @@ ScrollView {
}
}
}
}
// Dynamic Theme Component
Component {
id: dynamicThemeComponent
StyledRect {
width: parent.width
height: dynamicThemeSection.implicitHeight + Theme.spacingL * 2
@@ -568,9 +588,7 @@ ScrollView {
}
}
}
}
LazyLoader {

View File

@@ -3,32 +3,39 @@ import QtQuick.Controls
import qs.Common
import qs.Widgets
ScrollView {
Item {
id: timeWeatherTab
// Qt 6.9+ scrolling: Enhanced mouse wheel and touchpad responsiveness
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
WheelHandler {
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
onWheel: (event) => {
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 80
let flickable = timeWeatherTab.contentItem
let newY = flickable.contentY - delta
newY = Math.max(0, Math.min(flickable.contentHeight - flickable.height, newY))
flickable.contentY = newY
event.accepted = true
DankFlickable {
anchors.fill: parent
anchors.topMargin: Theme.spacingL
anchors.bottomMargin: Theme.spacingXL
clip: true
contentHeight: mainColumn.height
contentWidth: width
mouseWheelSpeed: 20
Column {
id: mainColumn
width: parent.width
spacing: Theme.spacingXL
Loader {
width: parent.width
sourceComponent: timeComponent
}
Loader {
width: parent.width
sourceComponent: weatherComponent
}
}
}
contentHeight: column.implicitHeight
clip: true
Column {
id: column
width: parent.width
spacing: Theme.spacingXL
// Time Format Component
Component {
id: timeComponent
StyledRect {
width: parent.width
height: timeSection.implicitHeight + Theme.spacingL * 2
@@ -76,9 +83,13 @@ ScrollView {
}
}
}
}
// Weather Component
Component {
id: weatherComponent
StyledRect {
width: parent.width
height: weatherSection.implicitHeight + Theme.spacingL * 2
@@ -171,9 +182,6 @@ ScrollView {
}
}
}
}
}

View File

@@ -3,23 +3,9 @@ import QtQuick.Controls
import qs.Common
import qs.Widgets
ScrollView {
Item {
id: widgetsTab
// Qt 6.9+ scrolling: Enhanced mouse wheel and touchpad responsiveness
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
WheelHandler {
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
onWheel: (event) => {
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 80
let flickable = widgetsTab.contentItem
let newY = flickable.contentY - delta
newY = Math.max(0, Math.min(flickable.contentHeight - flickable.height, newY))
flickable.contentY = newY
event.accepted = true
}
}
property var baseWidgetDefinitions: [{
"id": "launcherButton",
"text": "App Launcher",
@@ -305,8 +291,6 @@ ScrollView {
return widgets;
}
contentHeight: column.implicitHeight + Theme.spacingXL
clip: true
Component.onCompleted: {
if (!SettingsData.topBarLeftWidgets || SettingsData.topBarLeftWidgets.length === 0)
SettingsData.setTopBarLeftWidgets(defaultLeftWidgets);
@@ -347,14 +331,46 @@ ScrollView {
});
}
Column {
id: column
width: parent.width
spacing: Theme.spacingXL
topPadding: Theme.spacingL
bottomPadding: Theme.spacingXL
DankFlickable {
anchors.fill: parent
anchors.topMargin: Theme.spacingL
anchors.bottomMargin: Theme.spacingXL
clip: true
contentHeight: mainColumn.height
contentWidth: width
mouseWheelSpeed: 20
Column {
id: mainColumn
width: parent.width
spacing: Theme.spacingXL
Loader {
width: parent.width
sourceComponent: headerComponent
}
Loader {
width: parent.width
sourceComponent: messageComponent
}
Loader {
width: parent.width
sourceComponent: sectionsComponent
}
Loader {
width: parent.width
sourceComponent: workspaceComponent
}
}
}
// Header Component
Component {
id: headerComponent
Row {
width: parent.width
spacing: Theme.spacingM
@@ -406,7 +422,6 @@ ScrollView {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
@@ -427,7 +442,6 @@ ScrollView {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
Behavior on border.color {
@@ -435,13 +449,15 @@ ScrollView {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
}
}
// Message Component
Component {
id: messageComponent
Rectangle {
width: parent.width
height: messageText.contentHeight + Theme.spacingM * 2
@@ -449,9 +465,6 @@ ScrollView {
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
border.width: 1
visible: true
opacity: 1
z: 1
StyledText {
id: messageText
@@ -463,9 +476,13 @@ ScrollView {
width: parent.width - Theme.spacingM * 2
wrapMode: Text.WordWrap
}
}
}
// Sections Component
Component {
id: sectionsComponent
Column {
width: parent.width
spacing: Theme.spacingL
@@ -568,9 +585,13 @@ ScrollView {
}
}
}
}
}
// Workspace Settings Component
Component {
id: workspaceComponent
StyledRect {
width: parent.width
height: workspaceSection.implicitHeight + Theme.spacingL * 2
@@ -604,7 +625,6 @@ ScrollView {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
DankToggle {
@@ -626,44 +646,10 @@ ScrollView {
return SettingsData.setShowWorkspacePadding(checked);
}
}
}
}
}
Rectangle {
width: tooltipText.contentWidth + Theme.spacingM * 2
height: tooltipText.contentHeight + Theme.spacingS * 2
radius: Theme.cornerRadius
color: Theme.surfaceContainer
border.color: Theme.outline
border.width: 1
visible: resetArea.containsMouse
opacity: resetArea.containsMouse ? 1 : 0
y: column.y + 48
x: parent.width - width - Theme.spacingM
z: 100
StyledText {
id: tooltipText
anchors.centerIn: parent
text: "Reset widget layout to defaults"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
}
Behavior on opacity {
NumberAnimation {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
DankWidgetSelectionPopup {
id: widgetSelectionPopup

View File

@@ -63,7 +63,7 @@ PanelWindow {
menu: currentTrayItem && currentTrayItem.hasMenu ? currentTrayItem.menu : null
}
ListView {
DankListView {
id: menuList
property real maxTextWidth: {