Browse Source

UI: Fix pause/replay buttons having large width

Depending on the circumstances, these buttons can start with width
values that are much larger than their height, and that value wouldn't
be corrected immediately.  Setting an explicit policy to lock their
width to the same as their height value enforces the behavior that was
intended from the beginning.
jp9000 5 years ago
parent
commit
d51ac98fcf
1 changed files with 10 additions and 0 deletions
  1. 10 0
      UI/window-basic-main.cpp

+ 10 - 0
UI/window-basic-main.cpp

@@ -7845,6 +7845,11 @@ void OBSBasic::UpdatePause(bool activate)
 		pause->setChecked(false);
 		pause->setProperty("themeID",
 				   QVariant(QStringLiteral("pauseIconSmall")));
+
+		QSizePolicy sp;
+		sp.setHeightForWidth(true);
+		pause->setSizePolicy(sp);
+
 		connect(pause.data(), &QAbstractButton::clicked, this,
 			&OBSBasic::PauseToggled);
 		ui->recordingLayout->addWidget(pause.data());
@@ -7868,6 +7873,11 @@ void OBSBasic::UpdateReplayBuffer(bool activate)
 	replay->setChecked(false);
 	replay->setProperty("themeID",
 			    QVariant(QStringLiteral("replayIconSmall")));
+
+	QSizePolicy sp;
+	sp.setHeightForWidth(true);
+	replay->setSizePolicy(sp);
+
 	connect(replay.data(), &QAbstractButton::clicked, this,
 		&OBSBasic::ReplayBufferSave);
 	replayLayout->addWidget(replay.data());