/***************************************************************************
- * Copyright (C) 2005-2013 by the Quassel Project *
+ * Copyright (C) 2005-2018 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include <QIcon>
#include <QLayout>
#include <QKeyEvent>
#include <QMenu>
#include "chatviewsearchcontroller.h"
#include "chatviewsettings.h"
#include "client.h"
-#include "iconloader.h"
#include "multilineedit.h"
#include "qtui.h"
#include "settings.h"
BufferWidget::BufferWidget(QWidget *parent)
: AbstractBufferContainer(parent),
_chatViewSearchController(new ChatViewSearchController(this)),
- _autoMarkerLine(true)
+ _autoMarkerLine(true),
+ _autoMarkerLineOnLostFocus(true)
{
ui.setupUi(this);
layout()->setContentsMargins(0, 0, 0, 0);
Action *zoomInChatview = coll->add<Action>("ZoomInChatView", this, SLOT(zoomIn()));
zoomInChatview->setText(tr("Zoom In"));
- zoomInChatview->setIcon(SmallIcon("zoom-in"));
+ zoomInChatview->setIcon(QIcon::fromTheme("zoom-in"));
zoomInChatview->setShortcut(QKeySequence::ZoomIn);
Action *zoomOutChatview = coll->add<Action>("ZoomOutChatView", this, SLOT(zoomOut()));
- zoomOutChatview->setIcon(SmallIcon("zoom-out"));
+ zoomOutChatview->setIcon(QIcon::fromTheme("zoom-out"));
zoomOutChatview->setText(tr("Zoom Out"));
zoomOutChatview->setShortcut(QKeySequence::ZoomOut);
Action *zoomOriginalChatview = coll->add<Action>("ZoomOriginalChatView", this, SLOT(zoomOriginal()));
- zoomOriginalChatview->setIcon(SmallIcon("zoom-original"));
+ zoomOriginalChatview->setIcon(QIcon::fromTheme("zoom-original"));
zoomOriginalChatview->setText(tr("Actual Size"));
//zoomOriginalChatview->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_0)); // used for RTS switching
ChatViewSettings s;
s.initAndNotify("AutoMarkerLine", this, SLOT(setAutoMarkerLine(QVariant)), true);
+ s.initAndNotify("AutoMarkerLineOnLostFocus", this, SLOT(setAutoMarkerLineOnLostFocus(QVariant)), true);
}
_autoMarkerLine = v.toBool();
}
+void BufferWidget::setAutoMarkerLineOnLostFocus(const QVariant &v)
+{
+ _autoMarkerLineOnLostFocus = v.toBool();
+}
+
AbstractChatView *BufferWidget::createChatView(BufferId id)
{
case Qt::Key_Down:
if (!(keyEvent->modifiers() & Qt::ShiftModifier))
return false;
+ [[clang::fallthrough]];
case Qt::Key_PageUp:
case Qt::Key_PageDown:
// static cast to access public qobject::event
if (lastLine) {
QModelIndex idx = lastLine->index();
MsgId msgId = idx.data(MessageModel::MsgIdRole).value<MsgId>();
+ BufferId bufId = view->scene()->singleBufferId();
if (!allowGoingBack) {
- BufferId bufId = view->scene()->singleBufferId();
MsgId oldMsgId = Client::markerLine(bufId);
if (oldMsgId.isValid() && msgId <= oldMsgId)
return;
}
- view->setMarkerLine(msgId);
+ Client::setMarkerLine(bufId, msgId);
}
}