浏览代码

UI: Add setThemeID to qt-wrappers

Makes the function usable outside of just window-basic-stats.cpp.
jp9000 5 年之前
父节点
当前提交
a6871b2c1d
共有 3 个文件被更改,包括 14 次插入12 次删除
  1. 12 0
      UI/qt-wrappers.cpp
  2. 2 0
      UI/qt-wrappers.hpp
  3. 0 12
      UI/window-basic-stats.cpp

+ 12 - 0
UI/qt-wrappers.cpp

@@ -323,3 +323,15 @@ bool LineEditChanged(QEvent *event)
 
 	return false;
 }
+
+void setThemeID(QWidget *widget, const QString &themeID)
+{
+	if (widget->property("themeID").toString() != themeID) {
+		widget->setProperty("themeID", themeID);
+
+		/* force style sheet recalculation */
+		QString qss = widget->styleSheet();
+		widget->setStyleSheet("/* */");
+		widget->setStyleSheet(qss);
+	}
+}

+ 2 - 0
UI/qt-wrappers.hpp

@@ -105,3 +105,5 @@ static inline Qt::ConnectionType WaitConnection()
 
 bool LineEditCanceled(QEvent *event);
 bool LineEditChanged(QEvent *event);
+
+void setThemeID(QWidget *widget, const QString &themeID);

+ 0 - 12
UI/window-basic-stats.cpp

@@ -18,18 +18,6 @@
 #define TIMER_INTERVAL 2000
 #define REC_TIME_LEFT_INTERVAL 30000
 
-static void setThemeID(QWidget *widget, const QString &themeID)
-{
-	if (widget->property("themeID").toString() != themeID) {
-		widget->setProperty("themeID", themeID);
-
-		/* force style sheet recalculation */
-		QString qss = widget->styleSheet();
-		widget->setStyleSheet("/* */");
-		widget->setStyleSheet(qss);
-	}
-}
-
 void OBSBasicStats::OBSFrontendEvent(enum obs_frontend_event event, void *ptr)
 {
 	OBSBasicStats *stats = reinterpret_cast<OBSBasicStats *>(ptr);