diff --git a/src/EditProfileDialog.cpp b/src/EditProfileDialog.cpp index dbc54b91c0d1760ec6bbea4fce0b9dbf64ffa50a..a85cd5b3e9f151d3e1f8c038fb5ac06996be9b02 100644 --- a/src/EditProfileDialog.cpp +++ b/src/EditProfileDialog.cpp @@ -447,6 +447,10 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile) _ui->boldIntenseButton->setChecked(profile->boldIntense()); connect(_ui->boldIntenseButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::setBoldIntense); + + _ui->useFontLineCharactersButton->setChecked(profile->useFontLineCharacters()); + connect(_ui->useFontLineCharactersButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::useFontLineCharacters); + _ui->enableMouseWheelZoomButton->setChecked(profile->mouseWheelZoomEnabled()); connect(_ui->enableMouseWheelZoomButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::toggleMouseWheelZoom); } @@ -474,6 +478,11 @@ void EditProfileDialog::setBoldIntense(bool enable) preview(Profile::BoldIntense, enable); updateTempProfileProperty(Profile::BoldIntense, enable); } +void EditProfileDialog::useFontLineCharacters(bool enable) +{ + preview(Profile::UseFontLineCharacters, enable); + updateTempProfileProperty(Profile::UseFontLineCharacters, enable); +} void EditProfileDialog::toggleMouseWheelZoom(bool enable) { updateTempProfileProperty(Profile::MouseWheelZoomEnabled, enable); diff --git a/src/EditProfileDialog.h b/src/EditProfileDialog.h index 64e32638bff1070f503d698f8bbaf32ed185961c..1195c1400419892b3e492818543b2b0cec54f56c 100644 --- a/src/EditProfileDialog.h +++ b/src/EditProfileDialog.h @@ -126,6 +126,7 @@ private slots: void showAllFontsButtonWarning(bool enable); void setAntialiasText(bool enable); void setBoldIntense(bool enable); + void useFontLineCharacters(bool enable); void showFontDialog(); void newColorScheme(); void editColorScheme(); diff --git a/src/EditProfileDialog.ui b/src/EditProfileDialog.ui index 7b86c6fb4e55980c882da86cc3b00b050cf0d831..1acec377ba989ee983a94d3019539aed59fcb24d 100644 --- a/src/EditProfileDialog.ui +++ b/src/EditProfileDialog.ui @@ -613,6 +613,16 @@ + + + + Use the selected font for line characters instead of the builtin code + + + Use line characters contained in font + + + diff --git a/src/Profile.cpp b/src/Profile.cpp index c58eacd5464d43bb1c024cfb8e040e1a0bfad5c4..06fe5b1eceaab985a70176a6d1997ccd1a237ab6 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -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 } + , { UseFontLineCharacters, "UseFontLineChararacters", APPEARANCE_GROUP, QVariant::Bool } , { LineSpacing , "LineSpacing" , APPEARANCE_GROUP , QVariant::Int } // Keyboard @@ -199,6 +200,7 @@ FallbackProfile::FallbackProfile() setProperty(DefaultEncoding, QString(QTextCodec::codecForLocale()->name())); setProperty(AntiAliasFonts, true); setProperty(BoldIntense, true); + setProperty(UseFontLineCharacters, false); setProperty(WordCharacters, ":@-./_~?&=%+#"); diff --git a/src/Profile.h b/src/Profile.h index 37a0559b477752674d86a632a20e96391fc1b274..de74afade4cf6715f872c98ee67de93441885e3f 100644 --- a/src/Profile.h +++ b/src/Profile.h @@ -223,6 +223,9 @@ public: /** (bool) Whether character with intense colors should be rendered * in bold font or just in bright color. */ BoldIntense, + /** (bool) Whether to use font's line characters instead of the + * builtin code. */ + UseFontLineCharacters, /** (bool) Whether new sessions should be started in the same * directory as the currently active session. */ @@ -479,6 +482,11 @@ public: return property(Profile::BoldIntense); } + /** Convenience method for property(Profile::UseFontLineCharacters)*/ + bool useFontLineCharacters() const { + return property(Profile::UseFontLineCharacters); + } + /** Convenience method for property(Profile::StartInCurrentSessionDir) */ bool startInCurrentSessionDir() const { return property(Profile::StartInCurrentSessionDir); diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index c7fb3c64895ac1cf1e61569e59b734c143c6a6af..4f28837dad003bda9d6dac6a412c02352f1608aa 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -375,6 +375,7 @@ TerminalDisplay::TerminalDisplay(QWidget* parent) , _filterUpdateRequired(true) , _cursorShape(Enum::BlockCursor) , _antialiasText(true) + , _useFontLineCharacters(false) , _printerFriendly(false) , _sessionController(0) , _trimTrailingSpaces(false) @@ -854,7 +855,7 @@ void TerminalDisplay::drawCharacters(QPainter& painter, } // draw text - if (isLineCharString(text)) { + if (isLineCharString(text) && !_useFontLineCharacters) { drawLineCharString(painter, rect.x(), rect.y(), text, style); } else { // Force using LTR as the document layout for the terminal area, because diff --git a/src/TerminalDisplay.h b/src/TerminalDisplay.h index 7f09a5291821f30bc6700b22fac4670169df289d..93c98abbc9d2d77c30570ef9203ef8533aad2c98 100644 --- a/src/TerminalDisplay.h +++ b/src/TerminalDisplay.h @@ -414,6 +414,21 @@ public: return _boldIntense; } + /** + * Specifies whether line characters will be displayed using font instead + * of builtin code. + * as bold. Defaults to false. + */ + void setUseFontLineCharacters(bool value) { + _useFontLineCharacters = value; + } + /** + * Returns true if font line characters will be used. + */ + bool getFontLineCharacters() const { + return _useFontLineCharacters; + } + /** * Sets whether or not the current height and width of the * terminal in lines and columns is displayed whilst the widget @@ -920,6 +935,7 @@ private: InputMethodData _inputMethodData; bool _antialiasText; // do we anti-alias or not + bool _useFontLineCharacters; bool _printerFriendly; // are we currently painting to a printer in black/white mode diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp index da2ccd97bebd6f387759ac27b711795095a21e6a..90ef863bdfaa07b0f8f97e34098ebd5e14b5c686 100644 --- a/src/ViewManager.cpp +++ b/src/ViewManager.cpp @@ -777,6 +777,7 @@ void ViewManager::applyProfileToView(TerminalDisplay* view , const Profile::Ptr // load font view->setAntialias(profile->antiAliasFonts()); view->setBoldIntense(profile->boldIntense()); + view->setUseFontLineCharacters(profile->useFontLineCharacters()); view->setVTFont(profile->font()); // set scroll-bar position