From kde-commits Sun Dec 31 22:16:09 2017 From: =?utf-8?q?Wolthera_van_H=C3=B6vell_tot_Westerflier?= Date: Sun, 31 Dec 2017 22:16:09 +0000 To: kde-commits Subject: [krita] plugins/tools/svgtexttool: Set suffix of lineheight to % Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=151475858126733 Git commit a774c4c9848300d14f86e92ff528d5cf027ec78d by Wolthera van H=C3=B6= vell tot Westerflier. Committed on 31/12/2017 at 22:15. Pushed by woltherav into branch 'master'. Set suffix of lineheight to % Because percentage and em are dependent on different things, apparantly. M +7 -7 plugins/tools/svgtexttool/SvgTextEditor.cpp M +1 -1 plugins/tools/svgtexttool/SvgTextEditor.h https://commits.kde.org/krita/a774c4c9848300d14f86e92ff528d5cf027ec78d diff --git a/plugins/tools/svgtexttool/SvgTextEditor.cpp b/plugins/tools/sv= gtexttool/SvgTextEditor.cpp index 62493bf080e..e97f5a294c4 100644 --- a/plugins/tools/svgtexttool/SvgTextEditor.cpp +++ b/plugins/tools/svgtexttool/SvgTextEditor.cpp @@ -282,9 +282,9 @@ void SvgTextEditor::checkFormat() = QDoubleSpinBox *spnLineHeight =3D qobject_cast(qobjec= t_cast(actionCollection()->action("svg_line_height"))->defa= ultWidget()); if (blockFormat.lineHeightType()=3D=3DQTextBlockFormat::SingleHeight) { - spnLineHeight->setValue(1.0); + spnLineHeight->setValue(100.0); } else if(blockFormat.lineHeightType()=3D=3DQTextBlockFormat::Proporti= onalHeight) { - spnLineHeight->setValue(double(blockFormat.lineHeight()/100.0)); + spnLineHeight->setValue(double(blockFormat.lineHeight())); } } = @@ -608,10 +608,10 @@ void SvgTextEditor::decreaseTextSize() m_textEditorWidget.richTextEdit->mergeCurrentCharFormat(format); } = -void SvgTextEditor::setLineHeight(double lineHeightEm) +void SvgTextEditor::setLineHeight(double lineHeightPercentage) { QTextBlockFormat format =3D m_textEditorWidget.richTextEdit->textCurso= r().blockFormat(); - format.setLineHeight(lineHeightEm*100, QTextBlockFormat::ProportionalH= eight); + format.setLineHeight(lineHeightPercentage, QTextBlockFormat::Proportio= nalHeight); m_textEditorWidget.richTextEdit->textCursor().mergeBlockFormat(format= ); } = @@ -912,9 +912,9 @@ void SvgTextEditor::createActions() QWidgetAction *lineHeight =3D new QWidgetAction(this); lineHeight->setToolTip(i18n("Line height")); QDoubleSpinBox *spnLineHeight =3D new QDoubleSpinBox(); - spnLineHeight->setRange(0.0, 99.0); - spnLineHeight->setSingleStep(0.1); - spnLineHeight->setSuffix(i18n(" em"));//Does this need to be translate= d? + spnLineHeight->setRange(0.0, 1000.0); + spnLineHeight->setSingleStep(10.0); + spnLineHeight->setSuffix("%"); connect(spnLineHeight, SIGNAL(valueChanged(double)), SLOT(setLineHeigh= t(double))); lineHeight->setDefaultWidget(spnLineHeight); actionCollection()->addAction("svg_line_height", lineHeight); diff --git a/plugins/tools/svgtexttool/SvgTextEditor.h b/plugins/tools/svgt= exttool/SvgTextEditor.h index 4d9584d0f47..28849fba42e 100644 --- a/plugins/tools/svgtexttool/SvgTextEditor.h +++ b/plugins/tools/svgtexttool/SvgTextEditor.h @@ -97,7 +97,7 @@ private Q_SLOTS: void increaseTextSize(); void decreaseTextSize(); = - void setLineHeight(double lineHeightEm); + void setLineHeight(double lineHeightPercentage); void alignLeft(); void alignRight(); void alignCenter();