diff options
author | lbartoletti <l.bartoletti@free.fr> | 2019-10-22 21:07:16 +0200 |
---|---|---|
committer | lbartoletti <l.bartoletti@free.fr> | 2019-10-22 21:07:16 +0200 |
commit | 7e07c3980607d8c6e394520ea2e5ea37cb8860b7 (patch) | |
tree | 7600ec29bfb937bcf2148a8a02772127fcd27013 /src-qt5/experimental/lumina-terminal | |
parent | fix lumina-screenshot/MainUI.cpp (diff) | |
download | lumina-7e07c3980607d8c6e394520ea2e5ea37cb8860b7.tar.gz lumina-7e07c3980607d8c6e394520ea2e5ea37cb8860b7.tar.bz2 lumina-7e07c3980607d8c6e394520ea2e5ea37cb8860b7.zip |
fontMetrics().width -> fontMetrics().horizontalAdvance
Diffstat (limited to 'src-qt5/experimental/lumina-terminal')
-rw-r--r-- | src-qt5/experimental/lumina-terminal/TerminalWidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src-qt5/experimental/lumina-terminal/TerminalWidget.cpp b/src-qt5/experimental/lumina-terminal/TerminalWidget.cpp index 9fe4f15e..43523f15 100644 --- a/src-qt5/experimental/lumina-terminal/TerminalWidget.cpp +++ b/src-qt5/experimental/lumina-terminal/TerminalWidget.cpp @@ -29,7 +29,7 @@ TerminalWidget::TerminalWidget(QWidget *parent, QString dir) : QTextEdit(parent) this->setAcceptRichText(false); this->setOverwriteMode(true); this->setFocusPolicy(Qt::StrongFocus); - this->setTabStopWidth( 8 * this->fontMetrics().width(" ") ); //8 character spaces per tab (UNIX standard) + this->setTabStopWidth( 8 * this->fontMetrics().horizontalAdvance(" ") ); //8 character spaces per tab (UNIX standard) this->setTabChangesFocus(false); //this->setWordWrapMode(QTextOption::NoWrap); this->setContextMenuPolicy(Qt::CustomContextMenu); @@ -537,7 +537,7 @@ void TerminalWidget::updateTermSize(){ if(!PROC->isOpen()){ return; } QSize pix = this->size(); //pixels QSize chars; - chars.setWidth( pix.width()/this->fontMetrics().width("W") ); + chars.setWidth( pix.width()/this->fontMetrics().horizontalAdvance("W") ); chars.setHeight( pix.height()/this->fontMetrics().lineSpacing() ); //qDebug() << "Set Terminal Size:" << chars << pix; if(chars.width() <2 || chars.height() <2){ return; } //skip this - cannot go less than 2 characters wide/high |