Skip to content
Snippets Groups Projects
Commit 67a65d9b authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner: fix text context pane

parent fb1ae302
No related branches found
No related tags found
No related merge requests found
......@@ -64,10 +64,11 @@ void ContextPaneTextWidget::setProperties(QmlJS::PropertyReader *propertyReader)
} else if (!propertyReader->hasProperty(QLatin1String("font.pixelSize"))) {
ui->fontSizeSpinBox->setValue(8);
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"))) {
......@@ -131,11 +132,11 @@ void ContextPaneTextWidget::setProperties(QmlJS::PropertyReader *propertyReader)
if (propertyReader->hasProperty(QLatin1String("verticalAlignment"))) {
QString alignment = propertyReader->readProperty(QLatin1String("verticalAlignment")).toString();
ui->bottomAlignmentButton->setChecked(true);
ui->topAlignmentButton->setChecked(true);
if (alignment == QLatin1String("Text.AlignVCenter") || alignment == QLatin1String("AlignVCenter"))
ui->centerVAlignmentButton->setChecked(true);
else if (alignment == QLatin1String("Text.AlignTop") || alignment == QLatin1String("AlignTop"))
ui->topAlignmentButton->setChecked(true);
else if (alignment == QLatin1String("Text.AlignBottom") || alignment == QLatin1String("AlignBottom"))
ui->bottomAlignmentButton->setChecked(true);
} else {
ui->topAlignmentButton->setChecked(true);
}
......@@ -212,7 +213,7 @@ void ContextPaneTextWidget::onColorDialogCancled()
void ContextPaneTextWidget::onFontSizeChanged(int)
{
if (m_fontSizeTimer)
if (m_fontSizeTimer > 0)
killTimer(m_fontSizeTimer);
m_fontSizeTimer = startTimer(200);
}
......@@ -304,7 +305,7 @@ void ContextPaneTextWidget::onVerticalAlignmentChanged()
alignment = QLatin1String("Text.AlignBottom");
if (m_verticalAlignment != alignment) {
m_verticalAlignment = alignment;
if (alignment == QLatin1String("Text.AlignBottom"))
if (alignment == QLatin1String("Text.AlignTop"))
emit removeProperty(QLatin1String("verticalAlignment"));
else
emit propertyChanged(QLatin1String("verticalAlignment"), alignment);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment