-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WTrackProperty: show simple editor on delayed double-click #11755
Conversation
ba395ea
to
c1361cd
Compare
c1361cd
to
d718ca3
Compare
I'll probably keep polishing this, but it has already proven useful & usable in real life. |
This is very inviting, I edit and tag my tracks much more often now, and more spontaneously than before, when editing was rather clunky with Track Info or with the library. |
d718ca3
to
20847ed
Compare
Ready to roll! There's a new tr string for the respective tooltip. |
20847ed
to
92a3694
Compare
92a3694
to
8ec4312
Compare
I added a workaround a Qt bug that became obvious with the new Workaround is to post a QLeaveEvent when the menu is shown. Need to test whether this is still required with Qt6. |
8ec4312
to
36c822e
Compare
rebased onto main |
6f82aad
to
2239f22
Compare
Yes, it is. I also improved some comments. Ready for review. |
2239f22
to
af102fc
Compare
|
57a9196
to
8351e4f
Compare
e3732be
to
71a7625
Compare
71a7625
to
393c128
Compare
This works great, except: clicking outside the editor ('blank' area) doesn't close it. |
393c128
to
4cc338d
Compare
Very strange: after rebasing (main with new drag'n'drop threshold) hovering a WTrackProperty initiates a drag. THOUGH this is not caused by c++ changes but by qss selector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works good. I have only two minor comments
src/widget/wtrackproperty.cpp
Outdated
namespace { | ||
// Duration (ms) the widget is 'selected' after left click, i.e. the duration | ||
// a second click would open the value editor | ||
constexpr int selectedClickTimeout = 2000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constexpr int selectedClickTimeout = 2000; | |
constexpr int kSelectedClickTimeoutMs = 2000; |
src/widget/wtrackproperty.cpp
Outdated
|
||
if (!m_pSelectedClickTimer) { | ||
// create & start the timer | ||
m_pSelectedClickTimer = new QTimer(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can also become a parented pointer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thank you.
* load a track * click a track label -> is now 'selected' (qProperty for qss) * click again within 2 sec * editor is created * edit text * to cancel: press Esc to cancel * to apply & close: press Return or focus another widget
* hover effect * 'selected' state (waiting for second click to start editing) * editor Note: Shade has no hover effects (at all)
396b4c5
to
687ed2f
Compare
I squashed the fixup. |
Thank you. |
Wooohoo 🎉 |
Review after having used this for a few months: And I expect the cursor at the front of the selection to match watch the label displayed (even if that is different to how line edits usually behave). |
show a simple QLineEdit after selected-click (delayed double click) onto track property labels
a coffee break project to help with my tag editing workflow (quick in-deck tag editing), i.e. create a fast alternative to double-click -> Track Properties -> click desired property line edit -> edit -> hit Apply:
Gonna share this early, but Draft until it's polished.
get real double-click interval, use x3 for selected click2s timeout are finenew
selected
widget property,WTrackProperty[selected="true"] { background: red; };
May reuse #11752 for comments, but QLineEdit is fine for now.