SceneSwitcher/lib/utils/status-control.hpp
WarmUpTill 9522d7c0b4 Adapt to new OBS dock API
* The plugin will no longer attempt to restore dock positions on scene
  collection change.
* When a macro is being renamed the dock widget with the current name
  will be removed.
  A new dock with the new name will have to be opened manually.
* The status dock position will be when updating to a version containing
  this changei from an older version.
2024-08-14 21:51:42 +02:00

49 lines
921 B
C++

#pragma once
#include <QPushButton>
#include <QLabel>
#include <QTimer>
#include <QLayout>
#include <obs-data.h>
namespace advss {
class StatusControl : public QWidget {
Q_OBJECT
public:
StatusControl(QWidget *parent = 0, bool noLayout = false);
QPushButton *Button() { return _button; }
QHBoxLayout *ButtonLayout() { return _buttonLayout; }
QLabel *StatusLabel() { return _status; }
QLabel *StatusPrefixLabel() { return _statusPrefix; }
private slots:
void ButtonClicked();
void UpdateStatus();
private:
void SetStopped();
void SetStarted();
void SetStatusStyleSheet(bool stopped) const;
QPushButton *_button;
QHBoxLayout *_buttonLayout;
QLabel *_status;
QLabel *_statusPrefix;
QTimer _timer;
QObject *_pulse = nullptr;
bool _setToStopped = true;
};
class StatusDockWidget : public QFrame {
Q_OBJECT
public:
StatusDockWidget(QWidget *parent = 0);
};
void SetupDock();
} // namespace advss