mirror of https://github.com/mgba-emu/mgba.git
Qt: Use a sidebar instead of a tabbed view for settings
This commit is contained in:
parent
5dc56b98e8
commit
b6f1ddc4fe
|
@ -100,21 +100,24 @@ SettingsView::SettingsView(ConfigController* controller, InputController* inputC
|
||||||
});
|
});
|
||||||
|
|
||||||
GBAKeyEditor* editor = new GBAKeyEditor(inputController, InputController::KEYBOARD, QString(), this);
|
GBAKeyEditor* editor = new GBAKeyEditor(inputController, InputController::KEYBOARD, QString(), this);
|
||||||
m_ui.tabWidget->addTab(editor, "Keyboard");
|
m_ui.stackedWidget->addWidget(editor);
|
||||||
|
m_ui.tabs->addItem("Keyboard");
|
||||||
connect(m_ui.buttonBox, SIGNAL(accepted()), editor, SLOT(save()));
|
connect(m_ui.buttonBox, SIGNAL(accepted()), editor, SLOT(save()));
|
||||||
|
|
||||||
#ifdef BUILD_SDL
|
#ifdef BUILD_SDL
|
||||||
inputController->recalibrateAxes();
|
inputController->recalibrateAxes();
|
||||||
const char* profile = inputController->profileForType(SDL_BINDING_BUTTON);
|
const char* profile = inputController->profileForType(SDL_BINDING_BUTTON);
|
||||||
editor = new GBAKeyEditor(inputController, SDL_BINDING_BUTTON, profile);
|
editor = new GBAKeyEditor(inputController, SDL_BINDING_BUTTON, profile);
|
||||||
m_ui.tabWidget->addTab(editor, "Controllers");
|
m_ui.stackedWidget->addWidget(editor);
|
||||||
|
m_ui.tabs->addItem("Controllers");
|
||||||
connect(m_ui.buttonBox, SIGNAL(accepted()), editor, SLOT(save()));
|
connect(m_ui.buttonBox, SIGNAL(accepted()), editor, SLOT(save()));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ShortcutView* shortcutView = new ShortcutView();
|
ShortcutView* shortcutView = new ShortcutView();
|
||||||
shortcutView->setController(shortcutController);
|
shortcutView->setController(shortcutController);
|
||||||
shortcutView->setInputController(inputController);
|
shortcutView->setInputController(inputController);
|
||||||
m_ui.tabWidget->addTab(shortcutView, "Shortcuts");
|
m_ui.stackedWidget->addWidget(shortcutView);
|
||||||
|
m_ui.tabs->addItem("Shortcuts");
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsView::selectBios() {
|
void SettingsView::selectBios() {
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>417</width>
|
<width>565</width>
|
||||||
<height>478</height>
|
<height>459</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -19,19 +19,13 @@
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Settings</string>
|
<string>Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="sizeConstraint">
|
<property name="sizeConstraint">
|
||||||
<enum>QLayout::SetFixedSize</enum>
|
<enum>QLayout::SetFixedSize</enum>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item row="1" column="1">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QStackedWidget" name="stackedWidget">
|
||||||
<property name="currentIndex">
|
<widget class="QWidget" name="stackedWidgetPage1">
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="tab_3">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Audio/Video</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<property name="fieldGrowthPolicy">
|
<property name="fieldGrowthPolicy">
|
||||||
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
|
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
|
||||||
|
@ -181,6 +175,12 @@
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSlider" name="volume">
|
<widget class="QSlider" name="volume">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>128</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>256</number>
|
<number>256</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -204,6 +204,13 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="4" column="0" colspan="2">
|
||||||
|
<widget class="Line" name="line_4">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="label_10">
|
<widget class="QLabel" name="label_10">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -280,6 +287,13 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="8" column="0" colspan="2">
|
||||||
|
<widget class="Line" name="line_5">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="9" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -319,26 +333,9 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0" colspan="2">
|
|
||||||
<widget class="Line" name="line_4">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="0" colspan="2">
|
|
||||||
<widget class="Line" name="line_5">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_4">
|
<widget class="QWidget" name="stackedWidgetPage2">
|
||||||
<attribute name="title">
|
|
||||||
<string>Running</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QFormLayout" name="formLayout_2">
|
<layout class="QFormLayout" name="formLayout_2">
|
||||||
<property name="fieldGrowthPolicy">
|
<property name="fieldGrowthPolicy">
|
||||||
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
|
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
|
||||||
|
@ -558,7 +555,33 @@
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QListWidget" name="tabs">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Audio/Video</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Running</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
@ -602,18 +625,18 @@
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>useBios</sender>
|
<sender>tabs</sender>
|
||||||
<signal>toggled(bool)</signal>
|
<signal>currentRowChanged(int)</signal>
|
||||||
<receiver>skipBios</receiver>
|
<receiver>stackedWidget</receiver>
|
||||||
<slot>setEnabled(bool)</slot>
|
<slot>setCurrentIndex(int)</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
<x>520</x>
|
<x>61</x>
|
||||||
<y>62</y>
|
<y>209</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel">
|
<hint type="destinationlabel">
|
||||||
<x>525</x>
|
<x>315</x>
|
||||||
<y>83</y>
|
<y>209</y>
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
|
Loading…
Reference in New Issue