Commit 67a65d9b authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner: fix text context pane

parent fb1ae302
...@@ -64,10 +64,11 @@ void ContextPaneTextWidget::setProperties(QmlJS::PropertyReader *propertyReader) ...@@ -64,10 +64,11 @@ void ContextPaneTextWidget::setProperties(QmlJS::PropertyReader *propertyReader)
} else if (!propertyReader->hasProperty(QLatin1String("font.pixelSize"))) { } else if (!propertyReader->hasProperty(QLatin1String("font.pixelSize"))) {
ui->fontSizeSpinBox->setValue(8); ui->fontSizeSpinBox->setValue(8);
ui->fontSizeSpinBox->setIsPointSize(true); ui->fontSizeSpinBox->setIsPointSize(true);
if (m_fontSizeTimer > 0) { }
killTimer(m_fontSizeTimer);
m_fontSizeTimer = -1; if (m_fontSizeTimer > 0) {
} killTimer(m_fontSizeTimer);
m_fontSizeTimer = -1;
} }
if (propertyReader->hasProperty(QLatin1String("font.pixelSize"))) { if (propertyReader->hasProperty(QLatin1String("font.pixelSize"))) {
...@@ -131,11 +132,11 @@ void ContextPaneTextWidget::setProperties(QmlJS::PropertyReader *propertyReader) ...@@ -131,11 +132,11 @@ void ContextPaneTextWidget::setProperties(QmlJS::PropertyReader *propertyReader)
if (propertyReader->hasProperty(QLatin1String("verticalAlignment"))) { if (propertyReader->hasProperty(QLatin1String("verticalAlignment"))) {
QString alignment = propertyReader->readProperty(QLatin1String("verticalAlignment")).toString(); QString alignment = propertyReader->readProperty(QLatin1String("verticalAlignment")).toString();
ui->bottomAlignmentButton->setChecked(true); ui->topAlignmentButton->setChecked(true);
if (alignment == QLatin1String("Text.AlignVCenter") || alignment == QLatin1String("AlignVCenter")) if (alignment == QLatin1String("Text.AlignVCenter") || alignment == QLatin1String("AlignVCenter"))
ui->centerVAlignmentButton->setChecked(true); ui->centerVAlignmentButton->setChecked(true);
else if (alignment == QLatin1String("Text.AlignTop") || alignment == QLatin1String("AlignTop")) else if (alignment == QLatin1String("Text.AlignBottom") || alignment == QLatin1String("AlignBottom"))
ui->topAlignmentButton->setChecked(true); ui->bottomAlignmentButton->setChecked(true);
} else { } else {
ui->topAlignmentButton->setChecked(true); ui->topAlignmentButton->setChecked(true);
} }
...@@ -212,7 +213,7 @@ void ContextPaneTextWidget::onColorDialogCancled() ...@@ -212,7 +213,7 @@ void ContextPaneTextWidget::onColorDialogCancled()
void ContextPaneTextWidget::onFontSizeChanged(int) void ContextPaneTextWidget::onFontSizeChanged(int)
{ {
if (m_fontSizeTimer) if (m_fontSizeTimer > 0)
killTimer(m_fontSizeTimer); killTimer(m_fontSizeTimer);
m_fontSizeTimer = startTimer(200); m_fontSizeTimer = startTimer(200);
} }
...@@ -304,7 +305,7 @@ void ContextPaneTextWidget::onVerticalAlignmentChanged() ...@@ -304,7 +305,7 @@ void ContextPaneTextWidget::onVerticalAlignmentChanged()
alignment = QLatin1String("Text.AlignBottom"); alignment = QLatin1String("Text.AlignBottom");
if (m_verticalAlignment != alignment) { if (m_verticalAlignment != alignment) {
m_verticalAlignment = alignment; m_verticalAlignment = alignment;
if (alignment == QLatin1String("Text.AlignBottom")) if (alignment == QLatin1String("Text.AlignTop"))
emit removeProperty(QLatin1String("verticalAlignment")); emit removeProperty(QLatin1String("verticalAlignment"));
else else
emit propertyChanged(QLatin1String("verticalAlignment"), alignment); emit propertyChanged(QLatin1String("verticalAlignment"), alignment);
......
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