Skip to content

Commit

Permalink
Merge branch 'master' into fix/draggable-stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada authored Dec 29, 2023
2 parents 0510cf0 + d84779f commit 9e0dd8c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
- Bugfix: Fixes to section deletion in text input fields. (#5013)
- Bugfix: Show user text input within watch streak notices. (#5029)
- Bugfix: Fixed draggable popups falling back to a non-native drag implementation on Windows. (#5051)
- 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)
Expand Down
13 changes: 11 additions & 2 deletions src/widgets/helper/Button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

emit clicked(event->button());
if (isInside)
{
emit clicked(event->button());
}
}

void Button::mouseMoveEvent(QMouseEvent *event)
Expand Down

0 comments on commit 9e0dd8c

Please sign in to comment.