Quellcode durchsuchen

UI: Make streaming/recording buttons checkable

This makes it so the buttons appear "pressed" while streaming/recording
to more visibly help indicate that they are currently active.

Closes jp9000/obs-studio#1039
nleseul vor 8 Jahren
Ursprung
Commit
d22a75401d
3 geänderte Dateien mit 16 neuen und 2 gelöschten Zeilen
  1. 5 1
      UI/data/themes/Rachni.qss
  2. 4 1
      UI/forms/OBSBasic.ui
  3. 7 0
      UI/window-basic-main.cpp

+ 5 - 1
UI/data/themes/Rachni.qss

@@ -794,8 +794,12 @@ QPushButton:pressed#exitButton {
 	border: 1px solid rgb(240, 98, 146); /* Pink (Secondary) */
 }
 
+QPushButton:checked#streamButton,
+QPushButton:checked#recordButton,
 QPushButton:checked[themeID="replayBufferButton"],
-QPushButton:checked#modeSwitch {
+QPushButton:checked#modeSwitch,
+QPushButton:checked#settingsButton,
+QPushButton:checked#exitButton {
 	background-color: rgba(240, 98, 146, 0.5); /* Pink (Secondary) */
 	border: 1px solid rgba(240, 98, 146, 0.5); /* Pink (Secondary) */
 }

+ 4 - 1
UI/forms/OBSBasic.ui

@@ -954,7 +954,7 @@
         <string>Basic.Main.StartStreaming</string>
        </property>
        <property name="checkable">
-        <bool>false</bool>
+        <bool>true</bool>
        </property>
       </widget>
      </item>
@@ -978,6 +978,9 @@
        <property name="text">
         <string>Basic.Main.StartRecording</string>
        </property>
+       <property name="checkable">
+        <bool>true</bool>
+       </property>
       </widget>
      </item>
      <item>

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

@@ -4192,6 +4192,7 @@ void OBSBasic::StartStreaming()
 	if (!outputHandler->StartStreaming(service)) {
 		ui->streamButton->setText(QTStr("Basic.Main.StartStreaming"));
 		ui->streamButton->setEnabled(true);
+		ui->streamButton->setChecked(false);
 
 		if (sysTrayStream) {
 			sysTrayStream->setText(ui->streamButton->text());
@@ -4314,6 +4315,7 @@ void OBSBasic::StreamDelayStarting(int sec)
 {
 	ui->streamButton->setText(QTStr("Basic.Main.StopStreaming"));
 	ui->streamButton->setEnabled(true);
+	ui->streamButton->setChecked(true);
 
 	if (sysTrayStream) {
 		sysTrayStream->setText(ui->streamButton->text());
@@ -4339,6 +4341,7 @@ void OBSBasic::StreamDelayStopping(int sec)
 {
 	ui->streamButton->setText(QTStr("Basic.Main.StartStreaming"));
 	ui->streamButton->setEnabled(true);
+	ui->streamButton->setChecked(false);
 
 	if (sysTrayStream) {
 		sysTrayStream->setText(ui->streamButton->text());
@@ -4362,6 +4365,7 @@ void OBSBasic::StreamingStart()
 {
 	ui->streamButton->setText(QTStr("Basic.Main.StopStreaming"));
 	ui->streamButton->setEnabled(true);
+	ui->streamButton->setChecked(true);
 	ui->statusbar->StreamStarted(outputHandler->streamOutput);
 
 	if (sysTrayStream) {
@@ -4432,6 +4436,7 @@ void OBSBasic::StreamingStop(int code, QString last_error)
 
 	ui->streamButton->setText(QTStr("Basic.Main.StartStreaming"));
 	ui->streamButton->setEnabled(true);
+	ui->streamButton->setChecked(false);
 
 	if (sysTrayStream) {
 		sysTrayStream->setText(ui->streamButton->text());
@@ -4501,6 +4506,7 @@ void OBSBasic::RecordingStart()
 {
 	ui->statusbar->RecordingStarted(outputHandler->fileOutput);
 	ui->recordButton->setText(QTStr("Basic.Main.StopRecording"));
+	ui->recordButton->setChecked(true);
 
 	if (sysTrayRecord)
 		sysTrayRecord->setText(ui->recordButton->text());
@@ -4518,6 +4524,7 @@ void OBSBasic::RecordingStop(int code)
 {
 	ui->statusbar->RecordingStopped();
 	ui->recordButton->setText(QTStr("Basic.Main.StartRecording"));
+	ui->recordButton->setChecked(false);
 
 	if (sysTrayRecord)
 		sysTrayRecord->setText(ui->recordButton->text());