Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 57994c1d authored by Kurt Hindenburg's avatar Kurt Hindenburg

Provide GUI to change line spacing

This provides a profile GUI to change the line spacing  (0-5).  Due to
the Qt4.8/BIDI issues, allowing the user to  change the spacing allows
the user to fix any issues w/ the font they are using.

FEATURE: 279490
REVIEW: 105478
FIXED-IN: 4.10
parent ed31a8b0
......@@ -1040,6 +1040,12 @@ void EditProfileDialog::setupAdvancedPage(const Profile::Ptr profile)
};
setupCheckBoxes(options , profile);
const int lineSpacing = profile->lineSpacing();
_ui->lineSpacingSpinner->setValue(lineSpacing);
connect(_ui->lineSpacingSpinner, SIGNAL(valueChanged(int)),
this, SLOT(lineSpacingChanged(int)));
// cursor options
if (profile->useCustomCursorColor())
_ui->customCursorColorButton->setChecked(true);
......@@ -1099,6 +1105,10 @@ void EditProfileDialog::togglebidiRendering(bool enable)
{
updateTempProfileProperty(Profile::BidiRenderingEnabled, enable);
}
void EditProfileDialog::lineSpacingChanged(int spacing)
{
updateTempProfileProperty(Profile::LineSpacing, spacing);
}
void EditProfileDialog::toggleBlinkingCursor(bool enable)
{
updateTempProfileProperty(Profile::BlinkingCursorEnabled, enable);
......
......@@ -162,6 +162,7 @@ private slots:
void toggleBlinkingText(bool);
void toggleFlowControl(bool);
void togglebidiRendering(bool);
void lineSpacingChanged(int);
void toggleBlinkingCursor(bool);
void setCursorShape(int);
......
......@@ -928,6 +928,43 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="lineSpacingLabel">
<property name="text">
<string>Line Spacing:</string>
</property>
</widget>
</item>
<item>
<widget class="KIntSpinBox" name="lineSpacingSpinner">
<property name="toolTip">
<string>The number of pixels between two lines</string>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>5</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
......
......@@ -78,6 +78,7 @@ const Profile::PropertyInfo Profile::DefaultPropertyNames[] = {
, { ColorScheme , "colors" , 0 , QVariant::String }
, { AntiAliasFonts, "AntiAliasFonts" , APPEARANCE_GROUP , QVariant::Bool }
, { BoldIntense, "BoldIntense", APPEARANCE_GROUP, QVariant::Bool }
, { LineSpacing , "LineSpacing" , APPEARANCE_GROUP , QVariant::Int }
// Keyboard
, { KeyBindings , "KeyBindings" , KEYBOARD_GROUP , QVariant::String }
......@@ -177,6 +178,7 @@ FallbackProfile::FallbackProfile()
setProperty(BlinkingCursorEnabled, false);
setProperty(BidiRenderingEnabled, true);
setProperty(LineSpacing, 0);
setProperty(CursorShape, Enum::BlockCursor);
setProperty(UseCustomCursorColor, false);
setProperty(CustomCursorColor, Qt::black);
......
......@@ -163,6 +163,9 @@ public:
* Ctrl+Q) have any effect. Also known as Xon/Xoff
*/
FlowControlEnabled,
/** (int) Specifies the pixels between the terminal lines.
*/
LineSpacing,
/** (bool) Specifies whether the cursor blinks ( in a manner similar
* to text editing applications )
*/
......@@ -405,6 +408,12 @@ public:
return property<bool>(Profile::BidiRenderingEnabled);
}
/** Convenience method for property<bool>(Profile::LineSpacing) */
int lineSpacing() const {
return property<int>(Profile::LineSpacing);
}
/** Convenience method for property<bool>(Profile::BlinkingTextEnabled) */
bool blinkingTextEnabled() const {
return property<bool>(Profile::BlinkingTextEnabled);
......
......@@ -379,14 +379,6 @@ public:
*/
void setBidiEnabled(bool set) {
_bidiEnabled = set;
// See bug 280896 for more info
#if QT_VERSION >= 0x040800
if (_bidiEnabled) {
setLineSpacing(0);
} else {
setLineSpacing(2);
}
#endif
}
/**
* Returns the status of the BiDi rendering in this widget.
......
......@@ -805,6 +805,7 @@ void ViewManager::applyProfileToView(TerminalDisplay* view , const Profile::Ptr
view->setUnderlineLinks(profile->underlineLinksEnabled());
view->setControlDrag(profile->property<bool>(Profile::CtrlRequiredForDrag));
view->setBidiEnabled(profile->bidiRenderingEnabled());
view->setLineSpacing(profile->lineSpacing());
int middleClickPasteMode = profile->property<int>(Profile::MiddleClickPasteMode);
if (middleClickPasteMode == Enum::PasteFromX11Selection)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment