Commit 26109aaf authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Tweaked spacings and margins of various GUI elements for beautification.

parent f50e26e2
......@@ -46,14 +46,19 @@ namespace campvis {
QBoxLayout* outerLayout = new QBoxLayout(QBoxLayout::LeftToRight, this);
QGroupBox* groupBox = new QGroupBox(QString::fromStdString(_property->getTitle()));
outerLayout->setMargin(4);
outerLayout->addWidget(groupBox);
_layout = new QBoxLayout(QBoxLayout::TopToBottom, groupBox);
_layout->setSpacing(1);
_layout->setMargin(3);
}
else {
_titleLabel = new QLabel(QString::fromStdString(_property->getTitle() + ":"), this);
_layout = new QBoxLayout(QBoxLayout::LeftToRight, this);
_layout->setSpacing(8);
_layout->setMargin(4);
_layout->addWidget(_titleLabel, 0);
}
......
......@@ -35,7 +35,7 @@
namespace campvis {
CameraPropertyWidget::CameraPropertyWidget(CameraProperty* property, QWidget* parent /*= 0*/)
: AbstractPropertyWidget(property, false, parent)
: AbstractPropertyWidget(property, true, parent)
, _lblCameraPosition(0)
, _lblLookDirection(0)
, _lblUpVector(0)
......
......@@ -32,6 +32,7 @@
#include <QCheckBox>
#include <QTimer>
#include <QGridLayout>
#include <QPushButton>
#include <QWidget>
namespace campvis {
......@@ -45,6 +46,8 @@ namespace campvis {
QWidget* widget = new QWidget(this);
QGridLayout* layout = new QGridLayout(widget);
layout->setSpacing(2);
layout->setMargin(0);
widget->setLayout(layout);
_adjuster = new IntAdjusterWidget;
......@@ -54,14 +57,20 @@ namespace campvis {
_adjuster->setValue(property->getValue());
layout->addWidget(_adjuster, 0, 0, 1, 2);
_btnShowHideTimer = new QPushButton(tr("S"));
_btnShowHideTimer->setFixedWidth(16);
layout->addWidget(_btnShowHideTimer, 0, 2);
_cbEnableTimer = new QCheckBox("Enable Timer", widget);
_cbEnableTimer->setVisible(false);
layout->addWidget(_cbEnableTimer, 1, 0);
_sbInterval = new QSpinBox(widget);
_sbInterval->setMinimum(1);
_sbInterval->setMaximum(2000);
_sbInterval->setValue(50);
layout->addWidget(_sbInterval, 1, 1);
_sbInterval->setVisible(false);
layout->addWidget(_sbInterval, 1, 1, 1, 2);
addWidget(widget);
......@@ -69,6 +78,7 @@ namespace campvis {
connect(_adjuster, SIGNAL(valueChanged(int)), this, SLOT(onValueChanged(int)));
connect(_cbEnableTimer, SIGNAL(stateChanged(int)), this, SLOT(onEnableTimerChanged(int)));
connect(_sbInterval, SIGNAL(valueChanged(int)), this, SLOT(onIntervalValueChanged(int)));
connect(_btnShowHideTimer, SIGNAL(clicked()), this, SLOT(onBtnSHTClicked()));
property->s_minMaxChanged.connect(this, &IntPropertyWidget::onPropertyMinMaxChanged);
property->s_stepChanged.connect(this, &IntPropertyWidget::onPropertyStepChanged);
}
......@@ -129,4 +139,10 @@ namespace campvis {
prop->setValue(prop->getMinValue());
}
void IntPropertyWidget::onBtnSHTClicked() {
_cbEnableTimer->setVisible(! _cbEnableTimer->isVisible());
_sbInterval->setVisible(! _sbInterval->isVisible());
_btnShowHideTimer->setText(_sbInterval->isVisible() ? tr("H") : tr("S"));
}
}
\ No newline at end of file
......@@ -35,6 +35,7 @@
#include "core/properties/numericproperty.h"
class QCheckBox;
class QPushButton;
class QTimer;
namespace campvis {
......@@ -68,6 +69,7 @@ namespace campvis {
void onIntervalValueChanged(int value);
void onEnableTimerChanged(int state);
void onTimer();
void onBtnSHTClicked();
private:
/// Slot getting called when the property's min or max value has changed, so that the widget can be updated.
......@@ -78,6 +80,7 @@ namespace campvis {
IntAdjusterWidget* _adjuster;
QPushButton* _btnShowHideTimer;
QTimer* _timer;
QCheckBox* _cbEnableTimer;
QSpinBox* _sbInterval;
......
......@@ -74,6 +74,7 @@ namespace campvis {
void PropertyCollectionWidget::setupWidget() {
_layout = new QVBoxLayout();
_layout->setSpacing(0);
_layout->setMargin(0);
setLayout(_layout);
}
......
......@@ -42,7 +42,7 @@
namespace campvis {
TransferFunctionPropertyWidget::TransferFunctionPropertyWidget(TransferFunctionProperty* property, QWidget* parent /*= 0*/)
: AbstractPropertyWidget(property, false, parent)
: AbstractPropertyWidget(property, true, parent)
, _widget(0)
, _gridLayout(0)
, _lblDomain(0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment