Skip to content
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

allow skins to style sidebar context menus #2338

Merged
merged 5 commits into from
Nov 4, 2019

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Oct 29, 2019

c++ changes to complete #2337 Skins :: adjust styles of skin context menus, tooltip for the sidebar right-click menu which was previously not stylable via qss because it was created without a parent widget.
Now sidebar widget is passed to each library feature (that has a context menu) and used there as parent widget for creating the context menus.

I also added a right-click action for paths in In 'Computer' tree that are in QuickLinks. This allows to remove those paths from Quick Links easily when they were added accidentially.

Lesson learned:

if within each feature the context menu is parented to QApplication::focusWidget() (which would be WLibrarySidebar as well) some issues arise:

  • menu pops up at wrong place (cursorPos relative to widget 0,0 + global cursorPos)
  • menu is cropped by parent widget's geometry
  • menu won't close on selection or when clicking any menu item or outside the menu

ToDo

  • test with iTunes feature
  • test with Traktor feature
  • test with Banshee feature
  • test with Rhythmbox feature
  • test after skin change / reload

Before merge

  • remove debug output
  • remove example style from skins

KeyboardEventFilter* /* keyboard */) {}
virtual void bindSidebarWidget(WLibrarySidebar* pSidebarWidget) {}
Copy link
Member Author

Choose a reason for hiding this comment

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

Do I need to implement this?

@ronso0 ronso0 marked this pull request as ready for review October 29, 2019 20:23
@ronso0 ronso0 force-pushed the sidebar-qmenu-c-code branch from 5de7da9 to ee48f78 Compare October 30, 2019 15:46
@ronso0 ronso0 force-pushed the sidebar-qmenu-c-code branch from ee48f78 to 2d4f874 Compare October 31, 2019 01:02
@ronso0
Copy link
Member Author

ronso0 commented Oct 31, 2019

Woohoo, done.
I rebased and it's compact now and easy to review.
Please test.

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

Than you.
I can test this on Ubuntu.
So you think we need test for the other targets?

src/library/autodj/autodjfeature.h Outdated Show resolved Hide resolved
src/library/banshee/bansheefeature.cpp Outdated Show resolved Hide resolved
src/library/banshee/bansheefeature.h Outdated Show resolved Hide resolved
src/library/baseexternallibraryfeature.h Outdated Show resolved Hide resolved
src/library/crate/cratefeature.h Outdated Show resolved Hide resolved
src/library/library.cpp Outdated Show resolved Hide resolved
src/library/library.h Outdated Show resolved Hide resolved
src/library/traktor/traktorfeature.h Outdated Show resolved Hide resolved
@ronso0
Copy link
Member Author

ronso0 commented Oct 31, 2019

I can test this on Ubuntu.
So you think we need test for the other targets?

Sure, testing on Win / MacOS dosn't harm. Though I don't see a reason the platform would make a difference here.

@ronso0 ronso0 force-pushed the sidebar-qmenu-c-code branch from 1cd3bd4 to 767a7ec Compare November 1, 2019 18:35
@ronso0
Copy link
Member Author

ronso0 commented Nov 1, 2019

cleaned up & rebased.
Nice to see how simple this actually was in the first place... 🤠

For completeness, this needs to be tested with iTunes and Traktor features.

@ronso0 ronso0 force-pushed the sidebar-qmenu-c-code branch from 767a7ec to 0b5f1ca Compare November 1, 2019 19:02
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

This works with iTunes and Traktor.

Was the green menu background intended or is this a debug leftover?
grafik

src/library/autodj/autodjfeature.h Outdated Show resolved Hide resolved
src/library/baseexternallibraryfeature.cpp Outdated Show resolved Hide resolved
@ronso0
Copy link
Member Author

ronso0 commented Nov 2, 2019

Was the green menu background intended or is this a debug leftover?

the green menu is for testing only.

Before merge
[x] remove debug output
[ ] remove example style from skins

Let me know when you consider this ready for merge, and I'll remove it.

@daschuer
Copy link
Member

daschuer commented Nov 3, 2019

GitHub editor has eaten the template type.
It should be:

QPointer<WLibrarySidebar> m_pSidebarWidget;

@ronso0
Copy link
Member Author

ronso0 commented Nov 3, 2019

error: field ‘m_pSidebarWidget’ has incomplete type ‘QPointer<WLibrarySidebar>’
     QPointer<WLibrarySidebar> m_pSidebarWidget;

had to #include QPointer and move #include wlibrarysidebar.h to the header files

@uklotzde
Copy link
Contributor

uklotzde commented Nov 3, 2019

You can use a forward declaration for WLibrarySidebar in the header file to reduce compile time dependencies. This is the preferred way for classes within the project.

…re compact

use the widget as parent for right-click menus on sidebar items
@ronso0 ronso0 force-pushed the sidebar-qmenu-c-code branch from cf104bb to 751bf03 Compare November 4, 2019 14:25
@daschuer
Copy link
Member

daschuer commented Nov 4, 2019

The CI issues are only time outs. Is this ready for merge now?

Please avoid in future to rebase pending code PRs, because that requires a full code review, while otherwise only the latest changes needs to be reviewed.
Rebasing makes sens to clean up the history from already replaced bitmaps.
So it is best to discuss it with the reviewer if unsure.

@ronso0
Copy link
Member Author

ronso0 commented Nov 4, 2019

Alright. I rebased because now it's only one commit that's 'critical', and that's very compact and repetetive for the internal library features.
Thanks for your help!

@ronso0
Copy link
Member Author

ronso0 commented Nov 4, 2019

yes, ready for merge!

@daschuer
Copy link
Member

daschuer commented Nov 4, 2019

Thank you for keeping care of all these details :-)
LGTM

@daschuer daschuer merged commit 69e5ffb into mixxxdj:master Nov 4, 2019
@ronso0
Copy link
Member Author

ronso0 commented Nov 5, 2019

@daschuer Whoopsy,.. in pleasant anticipation I missed to remove the orange/green example styles.
#2349 should be merged asap!

@ronso0 ronso0 deleted the sidebar-qmenu-c-code branch November 5, 2019 14:06
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.

3 participants