1
0
Эх сурвалжийг харах

UI: Use QDialog for all dialogs

While QWidgets can be opened as dialogs, they don't contain certain
functions/defaults that are expected in a dialog.
Matt Gajownik 3 жил өмнө
parent
commit
9613fe7d47

+ 1 - 1
UI/forms/OBSExtraBrowsers.ui

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
 <ui version="4.0">
  <class>OBSExtraBrowsers</class>
  <class>OBSExtraBrowsers</class>
- <widget class="QWidget" name="OBSExtraBrowsers">
+ <widget class="QDialog" name="OBSExtraBrowsers">
   <property name="geometry">
   <property name="geometry">
    <rect>
    <rect>
     <x>0</x>
     <x>0</x>

+ 1 - 1
UI/frontend-plugins/frontend-tools/forms/scripts.ui

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
 <ui version="4.0">
  <class>ScriptsTool</class>
  <class>ScriptsTool</class>
- <widget class="QWidget" name="ScriptsTool">
+ <widget class="QDialog" name="ScriptsTool">
   <property name="geometry">
   <property name="geometry">
    <rect>
    <rect>
     <x>0</x>
     <x>0</x>

+ 6 - 2
UI/frontend-plugins/frontend-tools/scripts.cpp

@@ -85,7 +85,7 @@ static OBSPlainTextEdit *scriptLogWidget = nullptr;
 
 
 /* ----------------------------------------------------------------- */
 /* ----------------------------------------------------------------- */
 
 
-ScriptLogWindow::ScriptLogWindow() : QWidget(nullptr)
+ScriptLogWindow::ScriptLogWindow() : QDialog(nullptr)
 {
 {
 	OBSPlainTextEdit *edit = new OBSPlainTextEdit();
 	OBSPlainTextEdit *edit = new OBSPlainTextEdit();
 	edit->setReadOnly(true);
 	edit->setReadOnly(true);
@@ -109,6 +109,8 @@ ScriptLogWindow::ScriptLogWindow() : QWidget(nullptr)
 	setLayout(layout);
 	setLayout(layout);
 	scriptLogWidget = edit;
 	scriptLogWidget = edit;
 
 
+	setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
+
 	resize(600, 400);
 	resize(600, 400);
 
 
 	config_t *global_config = obs_frontend_get_global_config();
 	config_t *global_config = obs_frontend_get_global_config();
@@ -179,8 +181,10 @@ void ScriptLogWindow::Clear()
 
 
 /* ----------------------------------------------------------------- */
 /* ----------------------------------------------------------------- */
 
 
-ScriptsTool::ScriptsTool() : QWidget(nullptr), ui(new Ui_ScriptsTool)
+ScriptsTool::ScriptsTool() : QDialog(nullptr), ui(new Ui_ScriptsTool)
 {
 {
+	setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
+
 	ui->setupUi(this);
 	ui->setupUi(this);
 	RefreshLists();
 	RefreshLists();
 
 

+ 3 - 3
UI/frontend-plugins/frontend-tools/scripts.hpp

@@ -1,12 +1,12 @@
 #pragma once
 #pragma once
 
 
-#include <QWidget>
+#include <QDialog>
 #include <QString>
 #include <QString>
 #include <memory>
 #include <memory>
 
 
 class Ui_ScriptsTool;
 class Ui_ScriptsTool;
 
 
-class ScriptLogWindow : public QWidget {
+class ScriptLogWindow : public QDialog {
 	Q_OBJECT
 	Q_OBJECT
 
 
 	QString lines;
 	QString lines;
@@ -25,7 +25,7 @@ public slots:
 	void ScrollChanged(int val);
 	void ScrollChanged(int val);
 };
 };
 
 
-class ScriptsTool : public QWidget {
+class ScriptsTool : public QDialog {
 	Q_OBJECT
 	Q_OBJECT
 
 
 	std::unique_ptr<Ui_ScriptsTool> ui;
 	std::unique_ptr<Ui_ScriptsTool> ui;