Commit 54c800e4 authored by Clément Fauconnier's avatar Clément Fauconnier

workaround for QFontDialog issue locking current font (https://bugreports.qt.io/browse/QTBUG-79637)

parent 937bf5aa
...@@ -280,8 +280,6 @@ void UBGraphicsTextItemDelegate::contentsChanged() ...@@ -280,8 +280,6 @@ void UBGraphicsTextItemDelegate::contentsChanged()
// will remain in the font list. // will remain in the font list.
void UBGraphicsTextItemDelegate::customize(QFontDialog &fontDialog) void UBGraphicsTextItemDelegate::customize(QFontDialog &fontDialog)
{ {
fontDialog.setOption(QFontDialog::DontUseNativeDialog);
if (UBSettings::settings()->isDarkBackground()) { if (UBSettings::settings()->isDarkBackground()) {
fontDialog.setStyleSheet("background-color: white;"); fontDialog.setStyleSheet("background-color: white;");
} }
...@@ -334,7 +332,11 @@ void UBGraphicsTextItemDelegate::pickFont() ...@@ -334,7 +332,11 @@ void UBGraphicsTextItemDelegate::pickFont()
{ {
if (mDelegated && mDelegated->scene() && mDelegated->scene()->views().size() > 0) if (mDelegated && mDelegated->scene() && mDelegated->scene()->views().size() > 0)
{ {
QFontDialog fontDialog(delegated()->textCursor().charFormat().font(), static_cast<QGraphicsView*>(UBApplication::boardController->controlView())); // https://bugreports.qt.io/browse/QTBUG-79637
QFontDialog fontDialog(static_cast<QGraphicsView*>(UBApplication::boardController->controlView()));
fontDialog.setOption(QFontDialog::DontUseNativeDialog);
fontDialog.setCurrentFont(delegated()->textCursor().charFormat().font());
customize(fontDialog); customize(fontDialog);
if (fontDialog.exec()) if (fontDialog.exec())
......
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