Skip to content

Commit

Permalink
fix font dialog can be behind main window on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Jul 28, 2024
1 parent 81220a2 commit 654f63d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/qmltypes/fontdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Meltytech, LLC
* Copyright (c) 2023-2024 Meltytech, LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -16,7 +16,6 @@
*/

#include "fontdialog.h"
#include "qmlapplication.h"

#include <QFontDialog>

Expand All @@ -28,7 +27,10 @@ FontDialog::FontDialog(QObject *parent)
void FontDialog::open()
{
QFontDialog dialog(m_font);
dialog.setModal(QmlApplication::dialogModality());
dialog.setModal(true);
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
dialog.setOption(QFontDialog::DontUseNativeDialog);
#endif
if (dialog.exec() == QDialog::Accepted) {
setSelectedFont(dialog.currentFont());
emit accepted();
Expand Down

0 comments on commit 654f63d

Please sign in to comment.