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)
|
||||
{
|
||||
QHBoxLayout* layout = new QHBoxLayout();
|
||||
QComboBox* keyEdit = new QComboBox(this);
|
||||
NoScrollCombo* keyEdit = new NoScrollCombo(this);
|
||||
QLineEdit* valueEdit = new QLineEdit(value, this);
|
||||
QPushButton* delButton = new QPushButton(tr("-"), this);
|
||||
QLabel* label = new QLabel(":");
|
||||
|
@ -203,6 +203,7 @@ void ConfigDocument::addRow(QString key, QString value)
|
|||
else
|
||||
keyEdit->setEditText(key);
|
||||
|
||||
|
||||
layout->addWidget(keyEdit);
|
||||
layout->addWidget(label);
|
||||
layout->addWidget(valueEdit);
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include <QMap>
|
||||
#include <QWheelEvent>
|
||||
|
||||
#include "tabcontent.h"
|
||||
|
||||
|
@ -36,6 +37,14 @@ namespace Ui {
|
|||
class ConfigDocument;
|
||||
}
|
||||
|
||||
class NoScrollCombo: public QComboBox
|
||||
{
|
||||
public:
|
||||
NoScrollCombo(QWidget* parent = 0) : QComboBox(parent) {}
|
||||
|
||||
void wheelEvent(QWheelEvent* event) { event->ignore(); }
|
||||
};
|
||||
|
||||
class ConfigDocument : public TabContent {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@ -69,7 +78,7 @@ private slots:
|
|||
private:
|
||||
Ui::ConfigDocument *ui;
|
||||
QList<QHBoxLayout*> containers;
|
||||
QList<QComboBox*> keys;
|
||||
QList<NoScrollCombo*> keys;
|
||||
QList<QLineEdit*> values;
|
||||
QList<QPushButton*> deleteButtons;
|
||||
QList<QLabel*> labels;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue