Re-implemented subview minimum size setting.

pull/276/head
cc9cii 10 years ago
parent c8ae8f4a6d
commit 437fb774c5

@ -442,6 +442,13 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
if (!hint.empty())
view->useHint (hint);
int minWidth = 325; // default value if none found
if(CSMSettings::UserSettings::instance().hasSettingDefinitions("SubView/minimum width"))
minWidth = CSMSettings::UserSettings::instance().settingValue("SubView/minimum width").toInt();
else
CSMSettings::UserSettings::instance().setDefinitions("SubView/minimum width", (QStringList() << "minWidth"));
view->setMinimumWidth(minWidth);
view->setStatusBar (mShowStatusBar->isChecked());
// NOTE: only required if show status bar setting should be applied to existing
// window

@ -302,8 +302,6 @@ void CSVSettings::Dialog::buildPages()
// subview
if(model()->hasSettingDefinitions("SubView/minimum width"))
sbMinSubViewWidth->setValue(model()->settingValue("SubView/minimum width").toInt());
else
sbMinSubViewWidth->setValue(325);
SettingWindow::createPages ();

@ -27,7 +27,6 @@
#include "../../model/world/tablemimedata.hpp"
#include "../../model/doc/document.hpp"
#include "../../model/world/commands.hpp"
#include "../../model/settings/usersettings.hpp"
#include "recordstatusdelegate.hpp"
#include "util.hpp"
@ -393,12 +392,6 @@ void CSVWorld::EditWidget::remake(int row)
mWidgetMapper->setCurrentModelIndex(mTable->index(row, 0));
int minWidth = 325;
if(CSMSettings::UserSettings::instance().hasSettingDefinitions("SubView/minimum width"))
minWidth = CSMSettings::UserSettings::instance().settingValue("SubView/minimum width").toInt();
else
CSMSettings::UserSettings::instance().setDefinitions("SubView/minimum width", (QStringList() << "minWidth"));
this->setMinimumWidth(minWidth);
this->setWidget(mMainWidget);
this->setWidgetResizable(true);
}

@ -8,8 +8,6 @@
#include "../widget/scenetoolbar.hpp"
#include "../widget/scenetoolmode.hpp"
#include "../../model/settings/usersettings.hpp"
CSVWorld::PreviewSubView::PreviewSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
: SubView (id)
{
@ -43,13 +41,6 @@ CSVWorld::PreviewSubView::PreviewSubView (const CSMWorld::UniversalId& id, CSMDo
widget->setLayout (layout);
int minWidth = 325;
if(CSMSettings::UserSettings::instance().hasSettingDefinitions("SubView/minimum width"))
minWidth = CSMSettings::UserSettings::instance().settingValue("SubView/minimum width").toInt();
else
CSMSettings::UserSettings::instance().setDefinitions("SubView/minimum width", (QStringList() << "minWidth"));
widget->setMinimumWidth(minWidth);
setWidget (widget);
connect (mScene, SIGNAL (closeRequest()), this, SLOT (closeRequest()));

@ -2,7 +2,6 @@
#include "regionmapsubview.hpp"
#include "regionmap.hpp"
#include "../../model/settings/usersettings.hpp"
CSVWorld::RegionMapSubView::RegionMapSubView (CSMWorld::UniversalId universalId,
CSMDoc::Document& document)
@ -10,13 +9,6 @@ CSVWorld::RegionMapSubView::RegionMapSubView (CSMWorld::UniversalId universalId,
{
mRegionMap = new RegionMap (universalId, document, this);
int minWidth = 325;
if(CSMSettings::UserSettings::instance().hasSettingDefinitions("SubView/minimum width"))
minWidth = CSMSettings::UserSettings::instance().settingValue("SubView/minimum width").toInt();
else
CSMSettings::UserSettings::instance().setDefinitions("SubView/minimum width", (QStringList() << "minWidth"));
mRegionMap->setMinimumWidth(minWidth);
setWidget (mRegionMap);
connect (mRegionMap, SIGNAL (editRequest (const CSMWorld::UniversalId&, const std::string&)),

@ -74,13 +74,6 @@ CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::D
widget->setLayout (layout);
int minWidth = 325;
if(CSMSettings::UserSettings::instance().hasSettingDefinitions("SubView/minimum width"))
minWidth = CSMSettings::UserSettings::instance().settingValue("SubView/minimum width").toInt();
else
CSMSettings::UserSettings::instance().setDefinitions("SubView/minimum width", (QStringList() << "minWidth"));
widget->setMinimumWidth(minWidth);
setWidget (widget);
}

@ -6,7 +6,6 @@
#include "../../model/doc/document.hpp"
#include "../../model/world/tablemimedata.hpp"
#include "../../model/settings/usersettings.hpp"
#include "../filter/filterbox.hpp"
#include "table.hpp"
@ -35,13 +34,6 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D
widget->setLayout (layout);
int minWidth = 325;
if(CSMSettings::UserSettings::instance().hasSettingDefinitions("SubView/minimum width"))
minWidth = CSMSettings::UserSettings::instance().settingValue("SubView/minimum width").toInt();
else
CSMSettings::UserSettings::instance().setDefinitions("SubView/minimum width", (QStringList() << "minWidth"));
widget->setMinimumWidth(minWidth);
setWidget (widget);
connect (mTable, SIGNAL (editRequest (const CSMWorld::UniversalId&, const std::string&)),

@ -146,12 +146,6 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>325</number>
</property>
<property name="maximum">
<number>20000</number>
</property>
<property name="singleStep">
<number>5</number>
</property>

Loading…
Cancel
Save