UI: Simplify Projector Init
This commit is contained in:
parent
7da90fa25f
commit
3952fe2693
@ -135,25 +135,19 @@ static OBSSource CreateLabel(const char *name, size_t h)
|
|||||||
void OBSProjector::Init(int monitor, bool window, QString title,
|
void OBSProjector::Init(int monitor, bool window, QString title,
|
||||||
ProjectorType type_)
|
ProjectorType type_)
|
||||||
{
|
{
|
||||||
QScreen *screen = QGuiApplication::screens()[monitor];
|
|
||||||
|
|
||||||
if (!window)
|
|
||||||
setGeometry(screen->geometry());
|
|
||||||
|
|
||||||
bool alwaysOnTop = config_get_bool(GetGlobalConfig(),
|
bool alwaysOnTop = config_get_bool(GetGlobalConfig(),
|
||||||
"BasicWindow", "ProjectorAlwaysOnTop");
|
"BasicWindow", "ProjectorAlwaysOnTop");
|
||||||
if (alwaysOnTop && !window)
|
if (alwaysOnTop && !window)
|
||||||
SetAlwaysOnTop(this, true);
|
SetAlwaysOnTop(this, true);
|
||||||
|
|
||||||
if (window)
|
|
||||||
setWindowTitle(title);
|
|
||||||
|
|
||||||
show();
|
show();
|
||||||
|
|
||||||
if (source)
|
if (window) {
|
||||||
obs_source_inc_showing(source);
|
setWindowTitle(title);
|
||||||
|
} else {
|
||||||
|
QScreen *screen = QGuiApplication::screens()[monitor];
|
||||||
|
setGeometry(screen->geometry());
|
||||||
|
|
||||||
if (!window) {
|
|
||||||
QAction *action = new QAction(this);
|
QAction *action = new QAction(this);
|
||||||
action->setShortcut(Qt::Key_Escape);
|
action->setShortcut(Qt::Key_Escape);
|
||||||
addAction(action);
|
addAction(action);
|
||||||
@ -162,6 +156,9 @@ void OBSProjector::Init(int monitor, bool window, QString title,
|
|||||||
activateWindow();
|
activateWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (source)
|
||||||
|
obs_source_inc_showing(source);
|
||||||
|
|
||||||
savedMonitor = monitor;
|
savedMonitor = monitor;
|
||||||
isWindow = window;
|
isWindow = window;
|
||||||
type = type_;
|
type = type_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user