Jelajahi Sumber

UI: Add `OBSPropertiesView::SetDisabled`

Disables all children of the properties view.
Ruwen Hahn 1 tahun lalu
induk
melakukan
42a3f903a9
2 mengubah file dengan 9 tambahan dan 0 penghapusan
  1. 7 0
      UI/properties-view.cpp
  2. 2 0
      UI/properties-view.hpp

+ 7 - 0
UI/properties-view.cpp

@@ -245,6 +245,13 @@ OBSPropertiesView::OBSPropertiesView(OBSData settings_, const char *type_,
 				  Qt::QueuedConnection);
 }
 
+void OBSPropertiesView::SetDisabled(bool disabled)
+{
+	for (auto child : findChildren<QWidget *>()) {
+		child->setDisabled(disabled);
+	}
+}
+
 void OBSPropertiesView::resizeEvent(QResizeEvent *event)
 {
 	emit PropertiesResized();

+ 2 - 0
UI/properties-view.hpp

@@ -208,6 +208,8 @@ public:
 		RefreshProperties();
 	}
 
+	void SetDisabled(bool disabled);
+
 #define Def_IsObject(type)                                \
 	inline bool IsObject(obs_##type##_t *type) const  \
 	{                                                 \