mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 15:35:23 +00:00
Put the filter input in a toolbar and made it work with a shortcut (Alt+F)
This commit is contained in:
parent
15df25f947
commit
83e642678f
@ -1,6 +1,5 @@
|
|||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
#include <QDebug>
|
||||||
#include <QDebug> // TODO: Remove
|
|
||||||
|
|
||||||
#include <components/esm/esm_reader.hpp>
|
#include <components/esm/esm_reader.hpp>
|
||||||
#include <components/files/path.hpp>
|
#include <components/files/path.hpp>
|
||||||
@ -37,15 +36,23 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
|
|||||||
mPluginsProxyModel->setDynamicSortFilter(true);
|
mPluginsProxyModel->setDynamicSortFilter(true);
|
||||||
mPluginsProxyModel->setSourceModel(mPluginsModel);
|
mPluginsProxyModel->setSourceModel(mPluginsModel);
|
||||||
|
|
||||||
QLabel *filterLabel = new QLabel(tr("Filter:"), this);
|
QLabel *filterLabel = new QLabel(tr("&Filter:"), this);
|
||||||
LineEdit *filterLineEdit = new LineEdit(this);
|
LineEdit *filterLineEdit = new LineEdit(this);
|
||||||
|
filterLabel->setBuddy(filterLineEdit);
|
||||||
|
|
||||||
QHBoxLayout *topLayout = new QHBoxLayout();
|
QToolBar *filterToolBar = new QToolBar(this);
|
||||||
|
filterToolBar->setMovable(false);
|
||||||
|
|
||||||
|
// Create a container widget and a layout to get the spacer to work
|
||||||
|
QWidget *filterWidget = new QWidget(this);
|
||||||
|
QHBoxLayout *filterLayout = new QHBoxLayout(filterWidget);
|
||||||
QSpacerItem *hSpacer1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
QSpacerItem *hSpacer1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
|
||||||
topLayout->addItem(hSpacer1);
|
filterLayout->addItem(hSpacer1);
|
||||||
topLayout->addWidget(filterLabel);
|
filterLayout->addWidget(filterLabel);
|
||||||
topLayout->addWidget(filterLineEdit);
|
filterLayout->addWidget(filterLineEdit);
|
||||||
|
|
||||||
|
filterToolBar->addWidget(filterWidget);
|
||||||
|
|
||||||
mMastersWidget = new QTableWidget(this); // Contains the available masters
|
mMastersWidget = new QTableWidget(this); // Contains the available masters
|
||||||
mMastersWidget->setObjectName("MastersWidget");
|
mMastersWidget->setObjectName("MastersWidget");
|
||||||
@ -98,11 +105,8 @@ DataFilesPage::DataFilesPage(QWidget *parent) : QWidget(parent)
|
|||||||
mProfileToolBar->addWidget(mProfilesComboBox);
|
mProfileToolBar->addWidget(mProfilesComboBox);
|
||||||
|
|
||||||
QVBoxLayout *pageLayout = new QVBoxLayout(this);
|
QVBoxLayout *pageLayout = new QVBoxLayout(this);
|
||||||
// Add some space above and below the page items
|
|
||||||
QSpacerItem *vSpacer2 = new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Minimum);
|
|
||||||
|
|
||||||
pageLayout->addLayout(topLayout);
|
pageLayout->addWidget(filterToolBar);
|
||||||
pageLayout->addItem(vSpacer2);
|
|
||||||
pageLayout->addWidget(splitter);
|
pageLayout->addWidget(splitter);
|
||||||
pageLayout->addWidget(mProfileToolBar);
|
pageLayout->addWidget(mProfileToolBar);
|
||||||
|
|
||||||
@ -956,7 +960,6 @@ void DataFilesPage::readConfig()
|
|||||||
|
|
||||||
void DataFilesPage::writeConfig(QString profile)
|
void DataFilesPage::writeConfig(QString profile)
|
||||||
{
|
{
|
||||||
// TODO: Testing the config here
|
|
||||||
if (profile.isEmpty()) {
|
if (profile.isEmpty()) {
|
||||||
profile = mProfilesComboBox->currentText();
|
profile = mProfilesComboBox->currentText();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user