Implements #1081.
s.notify("EnableScrollBars", this, SLOT(setScrollBarsEnabled(QVariant)));
setScrollBarsEnabled(s.value("EnableScrollBars", true));
+ s.notify("EnableLineWrap", this, SLOT(setLineWrapEnabled(QVariant)));
+ setLineWrapEnabled(s.value("EnableLineWrap", false));
+
s.notify("EnableMultiLine", this, SLOT(setMultiLineEnabled(QVariant)));
setMultiLineEnabled(s.value("EnableMultiLine", true));
}
+void InputWidget::setLineWrapEnabled(const QVariant &v)
+{
+ ui.inputEdit->setLineWrapEnabled(v.toBool());
+}
+
+
void InputWidget::setMultiLineEnabled(const QVariant &v)
{
ui.inputEdit->setMode(v.toBool() ? MultiLineEdit::MultiLine : MultiLineEdit::SingleLine);
void setShowStyleButtons(const QVariant &);
void setEnablePerChatHistory(const QVariant &);
void setMaxLines(const QVariant &);
+ void setLineWrapEnabled(const QVariant &);
void setMultiLineEnabled(const QVariant &);
void setScrollBarsEnabled(const QVariant &);
void onTextEntered(const QString &text);
</property>
</widget>
</item>
+ <item>
+ <widget class="QCheckBox" name="enableLineWrapMode">
+ <property name="toolTip">
+ <string>Enables line wrapping for input.</string>
+ </property>
+ <property name="text">
+ <string>Line wrapping</string>
+ </property>
+ <property name="settingsKey" stdset="0">
+ <string notr="true">EnableLineWrap</string>
+ </property>
+ <property name="defaultValue" stdset="0">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
{
ui.setupUi(this);
ui.topicEditButton->setIcon(SmallIcon("edit-rename"));
- ui.topicLineEdit->setWordWrapEnabled(true);
+ ui.topicLineEdit->setLineWrapEnabled(true);
ui.topicLineEdit->installEventFilter(this);
connect(ui.topicLabel, SIGNAL(clickableActivated(Clickable)), SLOT(clickableActivated(Clickable)));
#endif
setMode(SingleLine);
- setWordWrapEnabled(false);
+ setLineWrapEnabled(false);
reset();
connect(this, SIGNAL(textChanged()), this, SLOT(on_textChanged()));
}
+void MultiLineEdit::setLineWrapEnabled(bool enable)
+{
+ setLineWrapMode(enable ? WidgetWidth : NoWrap);
+ updateSizeHint();
+}
+
+
void MultiLineEdit::setMinHeight(int lines)
{
if (lines == _minHeight)
}
-void MultiLineEdit::setWordWrapEnabled(bool enable)
-{
- setLineWrapMode(enable ? WidgetWidth : NoWrap);
- updateSizeHint();
-}
-
-
void MultiLineEdit::setPasteProtectionEnabled(bool enable, QWidget *)
{
_pasteProtectionEnabled = enable;
void setScrollBarsEnabled(bool enable = true);
void setSpellCheckEnabled(bool enable = true);
void setPasteProtectionEnabled(bool enable = true, QWidget *msgBoxParent = 0);
-
- // Note: Enabling wrap will make isSingleLine() not work correctly, so only use this if minHeight() > 1!
- void setWordWrapEnabled(bool enable = true);
+ void setLineWrapEnabled(bool enable = false);
inline void setHistory(QStringList history) { _history = history; }
inline void setTempHistory(QHash<int, QString> tempHistory) { _tempHistory = tempHistory; }