fixed clicking to select split

This commit is contained in:
fourtf 2018-06-04 21:44:03 +02:00
parent d9cb8093cb
commit b693779c55
3 changed files with 14 additions and 16 deletions

View file

@ -7,7 +7,7 @@ namespace irc {
IrcConnection::IrcConnection(QObject *parent)
: Communi::IrcConnection(parent)
{
this->pingTimer_.setInterval(10000);
this->pingTimer_.setInterval(5000);
this->pingTimer_.start();
QObject::connect(&this->pingTimer_, &QTimer::timeout, [this] {
if (!this->recentlyReceivedMessage_.load()) {
@ -17,23 +17,18 @@ IrcConnection::IrcConnection(QObject *parent)
this->recentlyReceivedMessage_ = false;
});
this->reconnectTimer_.setInterval(10000);
this->reconnectTimer_.setInterval(5000);
this->reconnectTimer_.setSingleShot(true);
QObject::connect(&this->reconnectTimer_, &QTimer::timeout,
[this] { reconnectRequested.invoke(); });
QObject::connect(this, &Communi::IrcConnection::messageReceived,
[this](Communi::IrcMessage *message) {
if (message->command() == "PONG") {
qDebug() << "PONG";
}
this->recentlyReceivedMessage_ = true;
QObject::connect(this, &Communi::IrcConnection::messageReceived, [this](Communi::IrcMessage *) {
this->recentlyReceivedMessage_ = true;
if (this->reconnectTimer_.isActive()) {
this->reconnectTimer_.stop();
qDebug() << "reconnect stopped";
}
});
if (this->reconnectTimer_.isActive()) {
this->reconnectTimer_.stop();
}
});
}
} // namespace irc

View file

@ -813,6 +813,8 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
{
auto app = getApp();
this->mouseDown.invoke(event);
std::shared_ptr<messages::MessageLayout> layout;
QPoint relativePos;
int messageIndex;
@ -856,8 +858,6 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
auto selectionItem = SelectionItem(messageIndex, index);
this->setSelection(selectionItem, selectionItem);
this->mouseDown.invoke(event);
} break;
case Qt::RightButton: {

View file

@ -95,7 +95,10 @@ Split::Split(QWidget *parent)
this->input.ui.textEdit->installEventFilter(parent);
this->view.mouseDown.connect([this](QMouseEvent *) { this->giveFocus(Qt::MouseFocusReason); });
this->view.mouseDown.connect([this](QMouseEvent *) {
//
this->giveFocus(Qt::MouseFocusReason);
});
this->view.selectionChanged.connect([this]() {
if (view.hasSelection()) {
this->input.clearSelection();