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; 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);

View file

@ -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;

View file

@ -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()

View file

@ -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>