mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fix: some buttons triggering when releasing mouse outside (#5052)
Examples of buttons fixed with this: Usercard profile picture & split header mod mode button
This commit is contained in:
parent
04a46f60dc
commit
d84779f127
|
@ -57,6 +57,7 @@
|
|||
- Bugfix: Fixed a bug on Wayland where tooltips would spawn as separate windows instead of behaving like tooltips. (#4998, #5040)
|
||||
- Bugfix: Fixes to section deletion in text input fields. (#5013)
|
||||
- Bugfix: Show user text input within watch streak notices. (#5029)
|
||||
- Bugfix: Fixed avatar in usercard and moderation button triggering when releasing the mouse outside their area. (#5052)
|
||||
- Dev: Run miniaudio in a separate thread, and simplify it to not manage the device ourselves. There's a chance the simplification is a bad idea. (#4978)
|
||||
- Dev: Change clang-format from v14 to v16. (#4929)
|
||||
- Dev: Fixed UTF16 encoding of `modes` file for the installer. (#4791)
|
||||
|
|
|
@ -261,17 +261,26 @@ void Button::mousePressEvent(QMouseEvent *event)
|
|||
void Button::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
if (!this->enabled_)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool isInside = this->rect().contains(event->pos());
|
||||
|
||||
if (event->button() == Qt::LeftButton)
|
||||
{
|
||||
this->mouseDown_ = false;
|
||||
|
||||
if (this->rect().contains(event->pos()))
|
||||
if (isInside)
|
||||
{
|
||||
emit leftClicked();
|
||||
}
|
||||
}
|
||||
|
||||
if (isInside)
|
||||
{
|
||||
emit clicked(event->button());
|
||||
}
|
||||
}
|
||||
|
||||
void Button::mouseMoveEvent(QMouseEvent *event)
|
||||
|
|
Loading…
Reference in a new issue