forked from len0rd/rockbox
Theme Editor: Stopped combo boxes in configuration editor from scrolling on mouse-wheel
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26879 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
75560845aa
commit
1dc2c5ebcb
2 changed files with 12 additions and 2 deletions
|
@ -187,7 +187,7 @@ QString ConfigDocument::toPlainText() const
|
||||||
void ConfigDocument::addRow(QString key, QString value)
|
void ConfigDocument::addRow(QString key, QString value)
|
||||||
{
|
{
|
||||||
QHBoxLayout* layout = new QHBoxLayout();
|
QHBoxLayout* layout = new QHBoxLayout();
|
||||||
QComboBox* keyEdit = new QComboBox(this);
|
NoScrollCombo* keyEdit = new NoScrollCombo(this);
|
||||||
QLineEdit* valueEdit = new QLineEdit(value, this);
|
QLineEdit* valueEdit = new QLineEdit(value, this);
|
||||||
QPushButton* delButton = new QPushButton(tr("-"), this);
|
QPushButton* delButton = new QPushButton(tr("-"), this);
|
||||||
QLabel* label = new QLabel(":");
|
QLabel* label = new QLabel(":");
|
||||||
|
@ -203,6 +203,7 @@ void ConfigDocument::addRow(QString key, QString value)
|
||||||
else
|
else
|
||||||
keyEdit->setEditText(key);
|
keyEdit->setEditText(key);
|
||||||
|
|
||||||
|
|
||||||
layout->addWidget(keyEdit);
|
layout->addWidget(keyEdit);
|
||||||
layout->addWidget(label);
|
layout->addWidget(label);
|
||||||
layout->addWidget(valueEdit);
|
layout->addWidget(valueEdit);
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
#include <QWheelEvent>
|
||||||
|
|
||||||
#include "tabcontent.h"
|
#include "tabcontent.h"
|
||||||
|
|
||||||
|
@ -36,6 +37,14 @@ namespace Ui {
|
||||||
class ConfigDocument;
|
class ConfigDocument;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class NoScrollCombo: public QComboBox
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NoScrollCombo(QWidget* parent = 0) : QComboBox(parent) {}
|
||||||
|
|
||||||
|
void wheelEvent(QWheelEvent* event) { event->ignore(); }
|
||||||
|
};
|
||||||
|
|
||||||
class ConfigDocument : public TabContent {
|
class ConfigDocument : public TabContent {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -69,7 +78,7 @@ private slots:
|
||||||
private:
|
private:
|
||||||
Ui::ConfigDocument *ui;
|
Ui::ConfigDocument *ui;
|
||||||
QList<QHBoxLayout*> containers;
|
QList<QHBoxLayout*> containers;
|
||||||
QList<QComboBox*> keys;
|
QList<NoScrollCombo*> keys;
|
||||||
QList<QLineEdit*> values;
|
QList<QLineEdit*> values;
|
||||||
QList<QPushButton*> deleteButtons;
|
QList<QPushButton*> deleteButtons;
|
||||||
QList<QLabel*> labels;
|
QList<QLabel*> labels;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue