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

add new searchbox styles #4505

Merged
merged 6 commits into from
Dec 18, 2021
Merged

add new searchbox styles #4505

merged 6 commits into from
Dec 18, 2021

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Nov 6, 2021

Skin styles for the new searchbox drop-down menu.

  • wider drop-down button, aspect ratio ~2:3
  • drop-down is resized with the library font

image

  • LateNight
  • Tango
  • Deere
  • Shade

// Show available auto-complete suggestions in a popup.
// Without this (default: QCompleter::InlineCompletion) a suggestion is picked
// automatically, and needs to be removed manually if it doesn't fit
lineEdit()->completer()->setCompletionMode(QCompleter::PopupCompletion);
Copy link
Member Author

@ronso0 ronso0 Dec 8, 2021

Choose a reason for hiding this comment

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

This is a valuable change we should implement.
Though I'll revert this for now because currently it can't be styled wit qss.
As soon as I find a way that allows to adequately style the additional drop-down I'll open a follow-up.

@ronso0 ronso0 force-pushed the search-styles branch 2 times, most recently from aed8ace to 76cacca Compare December 15, 2021 15:18
@ronso0 ronso0 marked this pull request as ready for review December 15, 2021 23:30
@ronso0
Copy link
Member Author

ronso0 commented Dec 15, 2021

This is now ready for review.

Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

can't comment on the qss or any removed code since I don't know how it worked in the first place.

src/widget/wsearchlineedit.cpp Outdated Show resolved Hide resolved
<< text;
#endif // ENABLE_TRACE_LOG

int paddingPx;
Copy link
Member

Choose a reason for hiding this comment

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

if this variable does not get initialized in both of the if branches below, its uninitialized memory and using it then would result in UB. IMO it would be better to initialize on declaration using this tertiary statement. The resulting double call to isEmpty can be ignored imo because its cheap.

Suggested change
int paddingPx;
const int paddingPx = text.isEmpty() ? 0 : m_innerHeight;

@ronso0
Copy link
Member Author

ronso0 commented Dec 16, 2021

@Swiftb0y Thanks for your review, I realized some chances for improvement after not having looked at it for some weeks.

If the fixup looks okay to you I'll squash it.

Re skin testing:

  • the drop-down button should scale with the library font (Pref > Library > set font)
  • the drop-down button should e hidden in features that don't support searching (most sidebar root items, AutoDJ, Browse, Rec)
  • the search query list should look like each skin's context menus

@vlada-dudr
Copy link
Contributor

Hi, this fixes problem I have on master - auto filing searchbar and jumping to the end of the line. But I think there should be option to disable autocompletion at all. Even if it works better now, I still feel it is slowing me down.

@ronso0
Copy link
Member Author

ronso0 commented Dec 16, 2021

@vlada-dudr I think you tested the intermdeiate version with the auto-complete drop-down. Though I reverted that because I couldn't style the list view, see my comment.

@ronso0
Copy link
Member Author

ronso0 commented Dec 16, 2021

@Swiftb0y Ready for merge.

@Swiftb0y
Copy link
Member

Thank. I got around to testing this just now. Actually the first time since a while I touched main. A couple of suggestions.

  • The cancel button in Deere could use a hover-style imo (out of scope)
  • I dislike the fact that the spacing in LateNight is so much bigger between the cancel button and the dropdown arrow compared to dropdown and the library maximize button.
  • the library in shade is black on white while the dropdown is white on black which seems out-of-place:
    image
  • It would be nice to be able to use tab, to jump to the end of the suggestion similar to how its possible in most shells (out of scope).

@vlada-dudr
Copy link
Contributor

vlada-dudr commented Dec 16, 2021

I think you tested the intermdeiate version with the auto-complete drop-down.

I tested and commented on current version, with inline autocomplete. I checked it out just before commenting now. This branch is bug-free, which is much better, but my opinion holds: autocomplete is annoying feature (for me). I am sorry if I am too moronic.

@ronso0
Copy link
Member Author

ronso0 commented Dec 17, 2021

Ah okay, I assumed you referred to the auto-complete drop-down.
As I said: as soon as it can be styled I'll add it back.

Thanks for testing, appreciated!

@ronso0
Copy link
Member Author

ronso0 commented Dec 17, 2021

Thanks for testing all skins!

I dislike the fact that the spacing in LateNight is so much bigger between the cancel button and the dropdown arrow compared to dropdown and the library maximize button.

Actually the button sizes are equal in all skins, only the icons are a bit thinner in LateNight (PaleMoon).
The intention with the spacing is that you'd aim for the icon which should should decrease the chance of accidentally clicking the adjacent button (actually only clicking the Clear button might be annoying if it happens before the auto-save timer ran out)
I'll add more padding to the max button.

the library in shade is black on white while the dropdown is white on black

Good point. I'll adjust that.

It would be nice to be able to use tab, to jump to the end of the suggestion

Yes, out of scope. Tab is Move focus forward for all widgets.
The ➔ button does the trick though.

@Swiftb0y
Copy link
Member

Swiftb0y commented Dec 17, 2021

Actually the button sizes are equal in all skins, only the icons are a bit thinner in LateNight (PaleMoon).
The intention with the spacing is that you'd aim for the icon which should should decrease the chance of accidentally clicking the adjacent button (actually only clicking the Clear button might be annoying if it happens before the auto-save timer ran out)
I'll add more padding to the max button.

Yeah I figured that either some of the assets are suboptimal or my brain is just straight up tricking me. Still, it just looked "off" in latenight compared to the rest so I figured I'd mention that.

The ➔ button does the trick though.

yes, thats not as intuitive as Tab though since going to the arrow key essentially forces me to take my right hand of the typing position. Maybe I'm just biased and prefer tab because I'm used to it though. Still, it would be nice if both ➔ and tab could advance the autocompletion, though I guess that would involve some hacks.

@ronso0
Copy link
Member Author

ronso0 commented Dec 18, 2021

@Swiftb0y If you find some time please take a final look.

In LateNight the max button is a bit wider now and has some more space, hope that is okay now:
image

The popup in Shade is styled like the tracks table now:
image

Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

Works very well and looks good. Thanks.

@Swiftb0y Swiftb0y merged commit 4194007 into mixxxdj:main Dec 18, 2021
@ronso0 ronso0 deleted the search-styles branch December 18, 2021 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants