Titler: align right by default on left to right languages.

CCBUG: 413572
parent 68726a4c
Pipeline #9656 passed with stage
in 21 minutes and 6 seconds
......@@ -65,7 +65,7 @@ void MyQGraphicsEffect::draw(QPainter *painter)
MyTextItem::MyTextItem(const QString &txt, QGraphicsItem *parent)
: QGraphicsTextItem(txt, parent)
, m_alignment(Qt::AlignLeft)
, m_alignment(qApp->isLeftToRight() ? Qt::AlignRight : Qt::AlignLeft)
{
setCacheMode(QGraphicsItem::ItemCoordinateCache);
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
......
......@@ -265,7 +265,11 @@ TitleWidget::TitleWidget(const QUrl &url, const Timecode &tc, QString projectTit
buttonAlignRight->setToolTip(i18n("Align right"));
buttonAlignLeft->setToolTip(i18n("Align left"));
buttonAlignCenter->setToolTip(i18n("Align center"));
buttonAlignLeft->setChecked(true);
if (qApp->isLeftToRight()) {
buttonAlignRight->setChecked(true);
} else {
buttonAlignLeft->setChecked(true);
}
m_unicodeAction = new QAction(QIcon::fromTheme(QStringLiteral("kdenlive-insert-unicode")), QString(), this);
m_unicodeAction->setShortcut(Qt::SHIFT + Qt::CTRL + Qt::Key_U);
......@@ -1663,7 +1667,7 @@ void TitleWidget::slotUpdateText()
item->setAlignment(Qt::AlignLeft);
}
} else {
item->setAlignment(Qt::AlignLeft);
item->setAlignment(qApp->isLeftToRight() ? Qt::AlignRight : Qt::AlignLeft);
}
// Set font properties
......
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