fixed clicking on splits to focus them

This commit is contained in:
fourtf 2017-09-16 16:49:52 +02:00
parent a4995201f5
commit 3e9f71dbf9
4 changed files with 6 additions and 4 deletions

View file

@ -681,6 +681,8 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
QPoint relativePos;
int messageIndex;
this->mouseDown(event);
if (!tryGetMessageAt(event->pos(), message, relativePos, messageIndex)) {
setCursor(Qt::ArrowCursor);

View file

@ -96,6 +96,8 @@ public:
void clearMessages();
boost::signals2::signal<void(QMouseEvent *)> mouseDown;
protected:
virtual void resizeEvent(QResizeEvent *) override;

View file

@ -82,9 +82,7 @@ ChatWidget::ChatWidget(ChannelManager &_channelManager, NotebookPage *parent)
this->input.textInput.installEventFilter(parent);
connect(&view, &this->view.mousePressEvent, this, [&](QMouseEvent *) {
QTimer::singleShot(10, [this] { this->giveFocus(Qt::MouseFocusReason); });
});
this->view.mouseDown.connect([this](QMouseEvent *) { this->giveFocus(Qt::MouseFocusReason); });
}
ChatWidget::~ChatWidget()

View file

@ -3,8 +3,8 @@
#include "emotemanager.hpp"
#include "resizingtextedit.hpp"
#include "widgets/basewidget.hpp"
#include "widgets/rippleeffectlabel.hpp"
#include "widgets/emotepopup.hpp"
#include "widgets/rippleeffectlabel.hpp"
#include <QHBoxLayout>
#include <QLabel>