Merge pull request #2 from hydrargyrum/master
UI: make the layout scrollable when there are many buttons
This commit is contained in:
@ -95,9 +95,12 @@ LayoutEdit::LayoutEdit( LayoutManager* l )
|
|||||||
mainLayout->addWidget( joyButtons );
|
mainLayout->addWidget( joyButtons );
|
||||||
|
|
||||||
//we have a WidgetStack to represent the multiple joypads
|
//we have a WidgetStack to represent the multiple joypads
|
||||||
|
padScroll = new QScrollArea(this);
|
||||||
|
padScroll->setWidgetResizable(true);
|
||||||
|
mainLayout->addWidget(padScroll);
|
||||||
padStack = new QStackedWidget( this );
|
padStack = new QStackedWidget( this );
|
||||||
padStack->setFrameStyle(QFrame::Box | QFrame::Sunken );
|
padStack->setFrameStyle(QFrame::Box | QFrame::Sunken );
|
||||||
mainLayout->addWidget(padStack);
|
padScroll->setWidget(padStack);
|
||||||
|
|
||||||
//go through each of the available joysticks
|
//go through each of the available joysticks
|
||||||
// i is the current index into PadStack
|
// i is the current index into PadStack
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef QJOYPAD_LAYOUT_EDIT_H
|
#ifndef QJOYPAD_LAYOUT_EDIT_H
|
||||||
#define QJOYPAD_LAYOUT_EDIT_H
|
#define QJOYPAD_LAYOUT_EDIT_H
|
||||||
|
|
||||||
|
#include <QScrollArea>
|
||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
|
|
||||||
//for the tab list of joypads
|
//for the tab list of joypads
|
||||||
@ -33,6 +34,7 @@ class LayoutEdit : public QWidget {
|
|||||||
LayoutManager* lm;
|
LayoutManager* lm;
|
||||||
//parts of the dialog:
|
//parts of the dialog:
|
||||||
QVBoxLayout *mainLayout;
|
QVBoxLayout *mainLayout;
|
||||||
|
QScrollArea *padScroll;
|
||||||
QStackedWidget *padStack;
|
QStackedWidget *padStack;
|
||||||
FlashRadioArray *joyButtons;
|
FlashRadioArray *joyButtons;
|
||||||
QComboBox* cmbLayouts;
|
QComboBox* cmbLayouts;
|
||||||
|
Reference in New Issue
Block a user