mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fixed clicking on splits to focus them
This commit is contained in:
parent
a4995201f5
commit
3e9f71dbf9
|
@ -681,6 +681,8 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
|
||||||
QPoint relativePos;
|
QPoint relativePos;
|
||||||
int messageIndex;
|
int messageIndex;
|
||||||
|
|
||||||
|
this->mouseDown(event);
|
||||||
|
|
||||||
if (!tryGetMessageAt(event->pos(), message, relativePos, messageIndex)) {
|
if (!tryGetMessageAt(event->pos(), message, relativePos, messageIndex)) {
|
||||||
setCursor(Qt::ArrowCursor);
|
setCursor(Qt::ArrowCursor);
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,8 @@ public:
|
||||||
|
|
||||||
void clearMessages();
|
void clearMessages();
|
||||||
|
|
||||||
|
boost::signals2::signal<void(QMouseEvent *)> mouseDown;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void resizeEvent(QResizeEvent *) override;
|
virtual void resizeEvent(QResizeEvent *) override;
|
||||||
|
|
||||||
|
|
|
@ -82,9 +82,7 @@ ChatWidget::ChatWidget(ChannelManager &_channelManager, NotebookPage *parent)
|
||||||
|
|
||||||
this->input.textInput.installEventFilter(parent);
|
this->input.textInput.installEventFilter(parent);
|
||||||
|
|
||||||
connect(&view, &this->view.mousePressEvent, this, [&](QMouseEvent *) {
|
this->view.mouseDown.connect([this](QMouseEvent *) { this->giveFocus(Qt::MouseFocusReason); });
|
||||||
QTimer::singleShot(10, [this] { this->giveFocus(Qt::MouseFocusReason); });
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatWidget::~ChatWidget()
|
ChatWidget::~ChatWidget()
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
#include "emotemanager.hpp"
|
#include "emotemanager.hpp"
|
||||||
#include "resizingtextedit.hpp"
|
#include "resizingtextedit.hpp"
|
||||||
#include "widgets/basewidget.hpp"
|
#include "widgets/basewidget.hpp"
|
||||||
#include "widgets/rippleeffectlabel.hpp"
|
|
||||||
#include "widgets/emotepopup.hpp"
|
#include "widgets/emotepopup.hpp"
|
||||||
|
#include "widgets/rippleeffectlabel.hpp"
|
||||||
|
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
Loading…
Reference in a new issue