Skip to content

Commit

Permalink
Fix #25457: Style dialog too big by default
Browse files Browse the repository at this point in the history
  • Loading branch information
WhyMeAgain233 committed Jan 8, 2025
1 parent d1860d2 commit 2d1966a
Show file tree
Hide file tree
Showing 3 changed files with 251 additions and 235 deletions.
15 changes: 15 additions & 0 deletions src/notation/view/widgets/editstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ EditStyle::EditStyle(QWidget* parent)

setObjectName("EditStyle");
setupUi(this);
resizeDialog();
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
setModal(true);

Expand Down Expand Up @@ -1282,6 +1283,20 @@ void EditStyle::changeEvent(QEvent* event)
}
}

//---------------------------------------------------------
// resizeDialog
//---------------------------------------------------------

void EditStyle::resizeDialog()
{
QScreen* screen = QGuiApplication::primaryScreen();
int screenHeight = screen->size().height();
int maximumHeight = static_cast<int>(0.9 * screenHeight);
if (this->height() > maximumHeight) {
this->resize(this->width(), maximumHeight);
}
}

//---------------------------------------------------------
// retranslate
/// NOTE: keep in sync with constructor.
Expand Down
1 change: 1 addition & 0 deletions src/notation/view/widgets/editstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public slots:
void changeEvent(QEvent*);
void keyPressEvent(QKeyEvent* event);

void resizeDialog();
void retranslate();
void setHeaderFooterToolTip();
void adjustPagesStackSize(int currentPageIndex);
Expand Down
Loading

0 comments on commit 2d1966a

Please sign in to comment.