#include "tabcompleter.h"
#include <QPainter>
+const int leftMargin = 3;
+
InputWidget::InputWidget(QWidget *parent)
: AbstractItemView(parent),
_networkId(0)
setShowStyleButtons(s.value("ShowStyleButtons", true));
s.notify("EnablePerChatHistory", this, SLOT(setEnablePerChatHistory(QVariant)));
- setEnablePerChatHistory(s.value("EnablePerChatHistory", true));
+ setEnablePerChatHistory(s.value("EnablePerChatHistory", false));
s.notify("MaxNumLines", this, SLOT(setMaxLines(QVariant)));
setMaxLines(s.value("MaxNumLines", 5));
inputLine()->setIdx(historyMap[currentBufferId].idx);
inputLine()->setHtml(historyMap[currentBufferId].inputLine);
inputLine()->moveCursor(QTextCursor::End,QTextCursor::MoveAnchor);
+
+ // FIXME this really should be in MultiLineEdit (and the const int on top removed)
+ QTextBlockFormat format = inputLine()->textCursor().blockFormat();
+ format.setLeftMargin(leftMargin); // we want a little space between the frame and the contents
+ inputLine()->textCursor().setBlockFormat(format);
}
NetworkId networkId = current.data(NetworkModel::NetworkIdRole).value<NetworkId>();
<string>Enable per chat history</string>
</property>
<property name="checked">
- <bool>true</bool>
+ <bool>false</bool>
</property>
<property name="settingsKey" stdset="0">
- <string>EnablePerChatHistory</string>
+ <string notr="true">EnablePerChatHistory</string>
</property>
<property name="defaultValue" stdset="0">
- <bool>true</bool>
+ <bool>false</bool>
</property>
</widget>
</item>
void setCustomFont(const QFont &); // should be used instead setFont(), so we can set our size correctly
// Compatibility methods with the rest of the classes which still expect this to be a QLineEdit
- inline QString text() { return toPlainText(); }
- inline QString html() { return toHtml(); }
- inline int cursorPosition() { return textCursor().position(); }
+ inline QString text() const { return toPlainText(); }
+ inline QString html() const { return toHtml(); }
+ inline int cursorPosition() const { return textCursor().position(); }
inline void insert(const QString &newText) { insertPlainText(newText); }
inline void backspace() { keyPressEvent(new QKeyEvent(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier)); }
- inline bool hasSelectedText() { return textCursor().hasSelection(); }
+ inline bool hasSelectedText() const { return textCursor().hasSelection(); }
inline bool isSingleLine() const { return _singleLine; }
inline bool pasteProtectionEnabled() const { return _pasteProtectionEnabled; }
inline QString rgbColorFromMirc(QString mircColor) const { return _mircColorMap[mircColor]; }
inline QMap<QString, QString> mircColorMap() const { return _mircColorMap; }
- inline QStringList history() { return _history; }
- inline QHash<int, QString> tempHistory() { return _tempHistory; }
- inline qint32 idx() { return _idx; }
+ inline QStringList history() const { return _history; }
+ inline QHash<int, QString> tempHistory() const { return _tempHistory; }
+ inline qint32 idx() const { return _idx; }
public slots:
void setMode(Mode mode);