From d41230a0c56b6ea9054f7fbccc31c3500352c00f Mon Sep 17 00:00:00 2001 From: cc9cii Date: Tue, 23 Sep 2014 20:51:14 +1000 Subject: [PATCH] Tweak the look of the recordfilterbox. Keep titlebar if floating. --- apps/opencs/view/doc/view.cpp | 23 ++++++++------------- apps/opencs/view/filter/recordfilterbox.cpp | 2 +- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index b2317d77b..6c04ac322 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -322,8 +322,11 @@ void CSVDoc::View::updateSubViewIndicies(SubView *view) if(mSubViews.size() == 1) { - mSubViews.at(0)->setTitleBarWidget(new QWidget(this)); - updateTitle(mSubViews.at(0)->getUniversalId().getTypeName().c_str()); + if(!mSubViews.at(0)->isFloating()) + { + mSubViews.at(0)->setTitleBarWidget(new QWidget(this)); + updateTitle(mSubViews.at(0)->getUniversalId().getTypeName().c_str()); + } } else { @@ -471,7 +474,8 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin if(std::find(referenceables.begin(), referenceables.end(), id.getType()) != referenceables.end()) { view = mSubViewFactory.makeSubView (CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Referenceable, id.getId()), *mDocument); - } else + } + else { view = mSubViewFactory.makeSubView (id, *mDocument); } @@ -488,17 +492,6 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin userSettings.setDefinitions("SubView/minimum width", (QStringList() << QString(minWidth))); view->setMinimumWidth(minWidth); -#if 0 - if(mSubViews.size() == 1) // remove subview title and add to the main window - { - updateTitle(id.getTypeName().c_str()); - // FIXME: search area broken - view->setTitleBarWidget(new QWidget(this)); - } - else -#endif - updateSubViewIndicies(); - view->setStatusBar (mShowStatusBar->isChecked()); // NOTE: only required if show status bar setting should be applied to existing // window @@ -511,6 +504,8 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin mSubViewWindow.addDockWidget (Qt::TopDockWidgetArea, view); + updateSubViewIndicies(); + connect (view, SIGNAL (focusId (const CSMWorld::UniversalId&, const std::string&)), this, SLOT (addSubView (const CSMWorld::UniversalId&, const std::string&))); diff --git a/apps/opencs/view/filter/recordfilterbox.cpp b/apps/opencs/view/filter/recordfilterbox.cpp index ef2aeb4d3..97490d508 100644 --- a/apps/opencs/view/filter/recordfilterbox.cpp +++ b/apps/opencs/view/filter/recordfilterbox.cpp @@ -11,7 +11,7 @@ CSVFilter::RecordFilterBox::RecordFilterBox (CSMWorld::Data& data, QWidget *pare { QHBoxLayout *layout = new QHBoxLayout (this); - layout->setContentsMargins (0, 0, 0, 0); + layout->setContentsMargins (0, 6, 5, 0); QLabel *label = new QLabel("Record Filter", this); label->setIndent(2);