mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 23:06:41 +00:00
DialogueSubView layout update for dialogues with nested tables only.
This commit is contained in:
parent
860754e460
commit
787cef1386
1 changed files with 27 additions and 9 deletions
|
@ -293,7 +293,6 @@ QWidget* CSVWorld::DialogueDelegateDispatcher::makeEditor(CSMWorld::ColumnBase::
|
||||||
connect(proxy, SIGNAL(tableMimeDataDropped(QWidget*, const QModelIndex&, const CSMWorld::UniversalId&, const CSMDoc::Document*)),
|
connect(proxy, SIGNAL(tableMimeDataDropped(QWidget*, const QModelIndex&, const CSMWorld::UniversalId&, const CSMDoc::Document*)),
|
||||||
this, SIGNAL(tableMimeDataDropped(QWidget*, const QModelIndex&, const CSMWorld::UniversalId&, const CSMDoc::Document*)));
|
this, SIGNAL(tableMimeDataDropped(QWidget*, const QModelIndex&, const CSMWorld::UniversalId&, const CSMDoc::Document*)));
|
||||||
|
|
||||||
//skip = true;
|
|
||||||
}
|
}
|
||||||
else if (qobject_cast<QCheckBox*>(editor))
|
else if (qobject_cast<QCheckBox*>(editor))
|
||||||
{
|
{
|
||||||
|
@ -382,18 +381,27 @@ void CSVWorld::EditWidget::remake(int row)
|
||||||
mWidgetMapper->setModel(mTable);
|
mWidgetMapper->setModel(mTable);
|
||||||
mWidgetMapper->setItemDelegate(&mDispatcher);
|
mWidgetMapper->setItemDelegate(&mDispatcher);
|
||||||
|
|
||||||
|
QFrame* line = new QFrame(mMainWidget);
|
||||||
|
line->setObjectName(QString::fromUtf8("line"));
|
||||||
|
line->setGeometry(QRect(320, 150, 118, 3));
|
||||||
|
line->setFrameShape(QFrame::HLine);
|
||||||
|
line->setFrameShadow(QFrame::Sunken);
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout(mMainWidget);
|
QVBoxLayout *mainLayout = new QVBoxLayout(mMainWidget);
|
||||||
|
QGridLayout *lockedLayout = new QGridLayout();
|
||||||
QScrollArea *scroll = new QScrollArea(mMainWidget);
|
QScrollArea *scroll = new QScrollArea(mMainWidget);
|
||||||
QWidget *unlockedWidget = new QWidget(scroll);
|
QWidget *unlockedWidget = new QWidget(scroll);
|
||||||
QGridLayout *unlockedLayout = new QGridLayout(unlockedWidget);
|
QVBoxLayout *overLayout = new QVBoxLayout(unlockedWidget);
|
||||||
QGridLayout *lockedLayout = new QGridLayout();
|
QGridLayout *unlockedLayout = new QGridLayout();
|
||||||
QVBoxLayout *tablesLayout = new QVBoxLayout();
|
QVBoxLayout *tablesLayout = new QVBoxLayout();
|
||||||
|
|
||||||
mainLayout->addLayout(lockedLayout, 0);
|
mainLayout->addLayout(lockedLayout, QSizePolicy::Fixed);
|
||||||
mainLayout->addSpacing(5); // FIXME: arbitrary number
|
mainLayout->addSpacing(5); // FIXME: arbitrary number
|
||||||
mainLayout->addWidget(scroll, 2);
|
mainLayout->addWidget(line, 1);
|
||||||
|
mainLayout->addWidget(scroll, QSizePolicy::Preferred);
|
||||||
|
overLayout->addLayout(unlockedLayout, QSizePolicy::Preferred);
|
||||||
|
overLayout->addStretch(1);
|
||||||
mainLayout->addSpacing(5); // FIXME: arbitrary number
|
mainLayout->addSpacing(5); // FIXME: arbitrary number
|
||||||
mainLayout->addLayout(tablesLayout, 0);
|
mainLayout->addLayout(tablesLayout, QSizePolicy::Preferred);
|
||||||
mainLayout->addStretch(1);
|
mainLayout->addStretch(1);
|
||||||
|
|
||||||
int unlocked = 0;
|
int unlocked = 0;
|
||||||
|
@ -457,9 +465,19 @@ void CSVWorld::EditWidget::remake(int row)
|
||||||
|
|
||||||
mWidgetMapper->setCurrentModelIndex(mTable->index(row, 0));
|
mWidgetMapper->setCurrentModelIndex(mTable->index(row, 0));
|
||||||
|
|
||||||
scroll->setWidget(unlockedWidget);
|
if (unlocked != 0)
|
||||||
scroll->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed);
|
{
|
||||||
scroll->setWidgetResizable(true);
|
mainLayout->removeWidget(line);
|
||||||
|
scroll->setWidget(unlockedWidget);
|
||||||
|
scroll->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
scroll->setWidgetResizable(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
delete unlockedWidget;
|
||||||
|
delete scroll;
|
||||||
|
}
|
||||||
|
|
||||||
this->setWidget(mMainWidget);
|
this->setWidget(mMainWidget);
|
||||||
this->setWidgetResizable(true);
|
this->setWidgetResizable(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue