mirror of
https://github.com/stenzek/duckstation.git
synced 2024-11-22 21:39:40 +00:00
Qt: Fix non-cancellable progress dialog height
This commit is contained in:
parent
61dae0ed6f
commit
854a8eb1bb
@ -15,7 +15,7 @@ QtModalProgressCallback::QtModalProgressCallback(QWidget* parent_widget, float s
|
||||
: QObject(parent_widget), m_dialog(QString(), QString(), 0, 1, parent_widget), m_show_delay(show_delay)
|
||||
{
|
||||
m_dialog.setWindowTitle(tr("DuckStation"));
|
||||
m_dialog.setMinimumSize(QSize(500, 100));
|
||||
m_dialog.setMinimumSize(MINIMUM_WIDTH, MINIMUM_HEIGHT_WITHOUT_CANCEL);
|
||||
m_dialog.setModal(parent_widget != nullptr);
|
||||
m_dialog.setAutoClose(false);
|
||||
m_dialog.setAutoReset(false);
|
||||
@ -33,6 +33,7 @@ void QtModalProgressCallback::SetCancellable(bool cancellable)
|
||||
|
||||
ProgressCallback::SetCancellable(cancellable);
|
||||
m_dialog.setWindowFlag(Qt::WindowCloseButtonHint, cancellable);
|
||||
m_dialog.setMinimumHeight(cancellable ? MINIMUM_HEIGHT_WITH_CANCEL : MINIMUM_HEIGHT_WITHOUT_CANCEL);
|
||||
m_dialog.setCancelButtonText(cancellable ? tr("Cancel") : QString());
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,10 @@ private Q_SLOTS:
|
||||
void dialogCancelled();
|
||||
|
||||
private:
|
||||
static constexpr int MINIMUM_WIDTH = 500;
|
||||
static constexpr int MINIMUM_HEIGHT_WITHOUT_CANCEL = 70;
|
||||
static constexpr int MINIMUM_HEIGHT_WITH_CANCEL = 100;
|
||||
|
||||
void checkForDelayedShow();
|
||||
|
||||
QProgressDialog m_dialog;
|
||||
|
Loading…
Reference in New Issue
Block a user