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

Fixed the tooltips of volume control under Wayland #1933

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugin-volume/volumebutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ void VolumeButton::setMixerCommand(const QString &command)
void VolumeButton::enterEvent(QEvent *event)
{
// show tooltip immediately on entering widget
QToolTip::showText(static_cast<QEnterEvent*>(event)->globalPos(), toolTip());
QToolTip::showText(static_cast<QEnterEvent*>(event)->globalPos(), toolTip(), this);
}

void VolumeButton::mouseMoveEvent(QMouseEvent *event)
{
QToolButton::mouseMoveEvent(event);
// show tooltip immediately on moving the mouse
if (!QToolTip::isVisible()) // prevent sliding of tooltip
QToolTip::showText(event->globalPos(), toolTip());
QToolTip::showText(event->globalPos(), toolTip(), this);
}

void VolumeButton::wheelEvent(QWheelEvent *event)
Expand Down
2 changes: 1 addition & 1 deletion plugin-volume/volumepopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void VolumePopup::handleSliderValueChanged(int value)
return;
// qDebug("VolumePopup::handleSliderValueChanged: %d\n", value);
m_device->setVolume(value);
QTimer::singleShot(0, this, [this] { QToolTip::showText(QCursor::pos(), m_volumeSlider->toolTip()); });
QTimer::singleShot(0, this, [this] { QToolTip::showText(QCursor::pos(), m_volumeSlider->toolTip(), this); });
}

void VolumePopup::handleMuteToggleClicked()
Expand Down
Loading