Skip to content

Commit

Permalink
UI: Split Properties window with a QSplitter
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Fabian Dirks committed Oct 4, 2016
1 parent 580cfc1 commit 3ed34ed
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
21 changes: 13 additions & 8 deletions UI/window-basic-properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,26 @@ OBSBasicProperties::OBSBasicProperties(QWidget *parent, OBSSource source_)
view = new OBSPropertiesView(settings, source,
(PropertiesReloadCallback)obs_source_properties,
(PropertiesUpdateCallback)obs_source_update);
//view->setMaximumHeight(250);
view->setMinimumHeight(150);
view->show();

preview->setMinimumSize(20, 20);
preview->setMinimumSize(20, 150);
preview->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,
QSizePolicy::Expanding));

// Create a QSplitter to keep a unified workflow here.
windowSplitter = new QSplitter(Qt::Orientation::Vertical, this);
windowSplitter->addWidget(preview);
windowSplitter->addWidget(view);
windowSplitter->setChildrenCollapsible(false);
windowSplitter->setSizes(QList<int>({ 16777216, 150 }));

setLayout(new QVBoxLayout(this));
layout()->addWidget(preview);
layout()->addWidget(view);
layout()->addWidget(windowSplitter);
layout()->addWidget(buttonBox);
layout()->setAlignment(buttonBox, Qt::AlignRight | Qt::AlignBottom);
layout()->setAlignment(view, Qt::AlignBottom);
view->setMaximumHeight(250);
view->setMinimumHeight(150);
view->show();


installEventFilter(CreateShortcutFilter());

const char *name = obs_source_get_name(source);
Expand Down
2 changes: 2 additions & 0 deletions UI/window-basic-properties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <QDialog>
#include <QDialogButtonBox>
#include <QPointer>
#include <QSplitter>
#include "qt-display.hpp"
#include <obs.hpp>

Expand All @@ -42,6 +43,7 @@ class OBSBasicProperties : public QDialog {
OBSData oldSettings;
OBSPropertiesView *view;
QDialogButtonBox *buttonBox;
QSplitter *windowSplitter;

static void SourceRemoved(void *data, calldata_t *params);
static void SourceRenamed(void *data, calldata_t *params);
Expand Down

0 comments on commit 3ed34ed

Please sign in to comment.