浏览代码

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 年之前
父节点
当前提交
d51ac98fcf
共有 1 个文件被更改,包括 10 次插入0 次删除
  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());