diff options
author | Robert Bieber <robby@bieberphoto.com> | 2010-07-03 23:48:10 +0000 |
---|---|---|
committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-03 23:48:10 +0000 |
commit | d4e7ab7a93a268a9fbb1255b7ca3a39a09c090e2 (patch) | |
tree | 52cd45438b6394169c4921dbbaacdc1acaaf3952 /utils | |
parent | e472c3975e9bf280b08bc48e6cc0fcfa0ef46ef5 (diff) |
Theme Editor: Switched device configuration panel to a QFormLayout
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27267 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils')
-rw-r--r-- | utils/themeeditor/gui/devicestate.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/utils/themeeditor/gui/devicestate.cpp b/utils/themeeditor/gui/devicestate.cpp index 477adf2296..fda2bddbe5 100644 --- a/utils/themeeditor/gui/devicestate.cpp +++ b/utils/themeeditor/gui/devicestate.cpp @@ -29,6 +29,7 @@ #include <QVBoxLayout> #include <QLabel> #include <QLineEdit> +#include <QFormLayout> DeviceState::DeviceState(QWidget *parent) : @@ -39,7 +40,7 @@ DeviceState::DeviceState(QWidget *parent) : setWindowIcon(QIcon(":/resources/windowicon.png")); setWindowTitle(tr("Device Settings")); - QVBoxLayout* layout = new QVBoxLayout(this); + QFormLayout* layout = new QFormLayout(this); layout->addWidget(&tabs); this->setLayout(layout); @@ -68,7 +69,7 @@ DeviceState::DeviceState(QWidget *parent) : panel = new QWidget(); currentArea = new QScrollArea(); - layout = new QVBoxLayout(panel); + layout = new QFormLayout(panel); currentArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); currentArea->setWidget(panel); currentArea->setWidgetResizable(true); @@ -84,18 +85,11 @@ DeviceState::DeviceState(QWidget *parent) : QString type = elements[2].trimmed(); QString defVal = elements[3].trimmed(); - subLayout = new QHBoxLayout(); - if(type != "check") - subLayout->addWidget(new QLabel(elements[1].trimmed(), - currentArea)); - layout->addLayout(subLayout); - - elements = type.split("("); if(elements[0].trimmed() == "text") { QLineEdit* temp = new QLineEdit(defVal, currentArea); - subLayout->addWidget(temp); + layout->addRow(title, temp); inputs.insert(tag, QPair<InputType, QWidget*>(Text, temp)); temp->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, @@ -107,7 +101,7 @@ DeviceState::DeviceState(QWidget *parent) : else if(elements[0].trimmed() == "check") { QCheckBox* temp = new QCheckBox(title, currentArea); - subLayout->addWidget(temp); + layout->addRow(temp); if(defVal.toLower() == "true") temp->setChecked(true); else @@ -129,7 +123,7 @@ DeviceState::DeviceState(QWidget *parent) : temp->setMinimum(min); temp->setMaximum(max); temp->setValue(defVal.toInt()); - subLayout->addWidget(temp); + layout->addRow(title, temp); inputs.insert(tag, QPair<InputType, QWidget*>(Slide, temp)); QObject::connect(temp, SIGNAL(valueChanged(int)), @@ -147,7 +141,7 @@ DeviceState::DeviceState(QWidget *parent) : temp->setMinimum(min); temp->setMaximum(max); temp->setValue(defVal.toInt()); - subLayout->addWidget(temp); + layout->addRow(title, temp); inputs.insert(tag, QPair<InputType, QWidget*>(Spin, temp)); QObject::connect(temp, SIGNAL(valueChanged(int)), @@ -166,7 +160,7 @@ DeviceState::DeviceState(QWidget *parent) : temp->setMaximum(max); temp->setValue(defVal.toDouble()); temp->setSingleStep(0.1); - subLayout->addWidget(temp); + layout->addRow(title, temp); inputs.insert(tag, QPair<InputType, QWidget*>(DSpin, temp)); QObject::connect(temp, SIGNAL(valueChanged(double)), @@ -188,7 +182,7 @@ DeviceState::DeviceState(QWidget *parent) : defIndex = i; } temp->setCurrentIndex(defIndex); - subLayout->addWidget(temp); + layout->addRow(title, temp); inputs.insert(tag, QPair<InputType, QWidget*>(Combo, temp)); QObject::connect(temp, SIGNAL(currentIndexChanged(int)), |