Skip to content

"Universal" workspace panning#8203

Draft
yohannd1 wants to merge 19 commits intoLMMS:masterfrom
yohannd1:feature/workspace-drag
Draft

"Universal" workspace panning#8203
yohannd1 wants to merge 19 commits intoLMMS:masterfrom
yohannd1:feature/workspace-drag

Conversation

@yohannd1
Copy link
Contributor

@yohannd1 yohannd1 commented Jan 9, 2026

This PR adds the ability to pan through the workspace without having to click on the background, primarily through a new keybinding to start panning (which I am calling "universal panning"), but also through the returnal of scrollbars.

For the panning keybinding, the trigger I have set up at the moment is the key combo Ctrl+Alt+Click Alt+S+Click, which might not be ideal, but it was the most unique modifier combination I could think of.

2026-01-26.panning_scroll_demo.v2.mp4

Progress:

  • Initial implementation
  • Change keybinding: Ctrl+Alt -> Alt+S
  • Fix offset bug (at 0:12 in the video)
  • Add checks to prevent dragging in odd situations (at 0:16 in the video)
  • Fix bug where panning without the keybinding, finishing and then trying to drag a widget is causing weird issues. Usually it tries to resize the widget.
  • Implement scrollbars
  • Fix scrollbar twitching (it glitches out sometimes, specially when going to the top/left while the screen is not maximized)
  • Put scrollbars in the correct position (vertical on the right, and bottom one with the width of the workspace widget itself)
  • Fix maximized windows being messed up (introduced by 8d333a48b)
  • Fix scrollbars appearing when a window is maximized
  • Fix wheel-scrolling on the scrollbars (it does nothing, but changes the scrollbar value)
  • Figure out what key combo would be the best for this (feel free to chime in, this is the main blocker for the PR)

Feedback is very welcome on this PR. When testing, keep an eye out for whether the scroll bars are working properly and whether panning feels natural, or if it's error prone.

@yohannd1 yohannd1 changed the title Workspace dragging with Ctrl+Alt "Universal" workspace panning with Ctrl+Alt Jan 9, 2026
Copy link
Contributor

@szeli1 szeli1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern with this PR is that it looks like to me that other "ctrl + alt" mouse shortcuts may not work because of the event filter. I did not test this PR.
Here is some code that may be effected:
AutomationEditor:

}
else if( we->modifiers() & Qt::ControlModifier && we->modifiers() & Qt::AltModifier )
{

ClipView:

bool ClipView::unquantizedModHeld( QMouseEvent * me )
{
	return me->modifiers() & Qt::ControlModifier || me->modifiers() & Qt::AltModifier;
}

PianoRoll:

void PianoRoll::dragNotes(int x, int y, bool alt, bool shift, bool ctrl)

yohannd1 and others added 2 commits January 9, 2026 14:37
Co-authored-by: szeli1 <143485814+szeli1@users.noreply.github.com>
@yohannd1 yohannd1 changed the title "Universal" workspace panning with Ctrl+Alt "Universal" workspace panning Jan 9, 2026
@yohannd1
Copy link
Contributor Author

yohannd1 commented Jan 9, 2026

Changed the keybinding to Alt+S, which (as discussed on discord) is not perfect. I'm hoping to find a better keybinding in the future but for now I'm leaving this one, which I believe doesn't have any conflicts.

Also a note to self: adding the keybinding handling on the event filter is sadly necessary, as when it is pressed I have to prevent it from being forwarded to other elements. I tried implementing it with key{Press,Release}Event and it was a mess.

@szeli1
Copy link
Contributor

szeli1 commented Jan 11, 2026

Also a note to self: adding the keybinding handling on the event filter is sadly necessary, as when it is pressed I have to prevent it from being forwarded to other elements. I tried implementing it with key{Press,Release}Event and it was a mess.

If I remember correctly, there are other options like implementing it in MainWindow::KeyPressEvent, or by using QAction with a shortcut in MainWindow, but event filter may be the best option.

Copy link
Contributor

@szeli1 szeli1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not test this PR.


#include <QApplication>
#include <QCloseEvent>
#include <QDebug> // TODO: remove (along with other qDebug instances here)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include <QDebug> // TODO: remove (along with other qDebug instances here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants