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

DlgPrefInterface: Disable tooltips on iOS by default #12689

Merged
merged 2 commits into from Feb 6, 2024

Conversation

fwcd
Copy link
Member

@fwcd fwcd commented Jan 29, 2024

These are usually more obtrusive than helpful on touchscreens, especially when covering other controls, therefore this PR disables them, by default, on iOS.

@fwcd fwcd mentioned this pull request Jan 29, 2024
48 tasks
@@ -439,7 +440,11 @@ void DlgPrefInterface::slotApply() {
void DlgPrefInterface::loadTooltipPreferenceFromConfig() {
const auto tooltipMode = static_cast<mixxx::TooltipsPreference>(
m_pConfig->getValue(ConfigKey(kControlsGroup, kTooltipsKey),
#ifdef Q_OS_IOS
Copy link
Member

Choose a reason for hiding this comment

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

Is the OS the appropriated criteria here? Shouldn't it be screen size, or screen size + touch instead? This also applies to RPi etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

Screen size would be debatable IMO, touch seems reasonable, but remember that this is only a default value and setting it depending on whether there's a mouse currently connected doesn't make much sense IMO (or would lead to surprising behavior with missing tooltips once the user connects one).

If we'd want to go this route, we would likely have to dynamically update this option based on screen size/connected input devices etc. Such a mechanism would be a lot more complex to implement than this fix, which is safe to apply given that all iOS devices use a touchscreen as their primary input.

We could implement a more complex system in future PRs, but I'd consider that out of scope for this small UX improvement which is trivial to replace.

@ronso0
Copy link
Member

ronso0 commented Jan 29, 2024

I'm wondering, how are tooltips triggered on touch devices?
Does the pointer remain on the last touch point?

Did you intend to disable tooltips altogether?
If so, there's also

m_toolTipsCfg(mixxx::TooltipsPreference::TOOLTIPS_ON) {

and
// Set the visibility of tooltips, default "1" = ON
m_toolTipsCfg = static_cast<mixxx::TooltipsPreference>(
pConfig->getValue(ConfigKey("[Controls]", "Tooltips"),
static_cast<int>(mixxx::TooltipsPreference::TOOLTIPS_ON)));
#ifdef MIXXX_USE_QOPENGL
ToolTipQOpenGL::singleton().setActive(m_toolTipsCfg == mixxx::TooltipsPreference::TOOLTIPS_ON);
#endif

and

mixxx/src/mixxxmainwindow.cpp

Lines 1132 to 1155 in def8d15

bool MixxxMainWindow::eventFilter(QObject* obj, QEvent* event) {
if (event->type() == QEvent::ToolTip) {
// always show tooltips in the preferences window
QWidget* activeWindow = QApplication::activeWindow();
if (activeWindow &&
QLatin1String(activeWindow->metaObject()->className()) !=
"DlgPreferences") {
// return true for no tool tips
switch (m_toolTipsCfg) {
case mixxx::TooltipsPreference::TOOLTIPS_ONLY_IN_LIBRARY:
if (dynamic_cast<WBaseWidget*>(obj) != nullptr) {
return true;
}
break;
case mixxx::TooltipsPreference::TOOLTIPS_ON:
break;
case mixxx::TooltipsPreference::TOOLTIPS_OFF:
return true;
default:
DEBUG_ASSERT(!"m_toolTipsCfg value unknown");
return true;
}
}
}

@fwcd
Copy link
Member Author

fwcd commented Jan 29, 2024

I couldn't get tooltips to trigger reliably, usually they would pop up on the last tapped control after I've already tapped something else, but only every now and then (just often enough to become a minor annoyance, because they seem to block touches to the underlying UI).

Did you intend to disable tooltips altogether?
If so, there's also ...

Ah interesting, I didn't know about those! I think it's reasonable to leave it opt-in for now, that way adventurous users could still enable them manually in the settings (or users wishing to connect a mouse to their iOS device), even if the vast majority likely won't find them useful on iOS.

@fwcd
Copy link
Member Author

fwcd commented Feb 4, 2024

Can we move forward with this PR or is there a reason we should hold off on this fix?

@ronso0
Copy link
Member

ronso0 commented Feb 5, 2024

LGTM, I think slotResetToDefaults() should be adjusted accordingly?

@fwcd
Copy link
Member Author

fwcd commented Feb 6, 2024

Updated, thanks

@ronso0
Copy link
Member

ronso0 commented Feb 6, 2024

Thank you, looks good!

@ronso0 ronso0 merged commit 7b3e485 into mixxxdj:main Feb 6, 2024
13 checks passed
@fwcd fwcd deleted the disable-tooltips-ios branch February 6, 2024 21:38
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.

None yet

3 participants