Added minimum width setting for subviews - regionmap, table, scene, preview and dialogue. It should be noted that the setting is not the starting minimum width, i.e. it won't be possible to reduce the width of the subview after the creation. Also, one setting applies to all subviews. It may be desirable to have individual settings.

deque
cc9cii 10 years ago
parent c4f11785ec
commit c8ae8f4a6d

@ -299,6 +299,12 @@ void CSVSettings::Dialog::buildPages()
if(index != -1)
cmbRefIdType->setCurrentIndex(index);
// subview
if(model()->hasSettingDefinitions("SubView/minimum width"))
sbMinSubViewWidth->setValue(model()->settingValue("SubView/minimum width").toInt());
else
sbMinSubViewWidth->setValue(325);
SettingWindow::createPages ();
foreach (Page *page, SettingWindow::pages())
@ -376,6 +382,9 @@ void CSVSettings::Dialog::closeEvent (QCloseEvent *event)
QStringList(cmbRecStatus->currentText()));
model()->setDefinitions("Display Format/Referenceable ID Type Display",
QStringList(cmbRefIdType->currentText()));
// subview
model()->setDefinitions("SubView/minimum width",
QStringList(QString::number(sbMinSubViewWidth->value())));
saveSettings();
}

@ -27,6 +27,7 @@
#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"
@ -392,7 +393,12 @@ void CSVWorld::EditWidget::remake(int row)
mWidgetMapper->setCurrentModelIndex(mTable->index(row, 0));
this->setMinimumWidth(325); /// \todo replace hardcoded value with a user setting
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,6 +8,8 @@
#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)
{
@ -41,6 +43,13 @@ 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()));
@ -63,4 +72,4 @@ void CSVWorld::PreviewSubView::referenceableIdChanged (const std::string& id)
setWindowTitle ("Preview: Reference to <nothing>");
else
setWindowTitle (("Preview: Reference to " + id).c_str());
}
}

@ -2,6 +2,7 @@
#include "regionmapsubview.hpp"
#include "regionmap.hpp"
#include "../../model/settings/usersettings.hpp"
CSVWorld::RegionMapSubView::RegionMapSubView (CSMWorld::UniversalId universalId,
CSMDoc::Document& document)
@ -9,6 +10,13 @@ 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&)),
@ -24,4 +32,4 @@ void CSVWorld::RegionMapSubView::editRequest (const CSMWorld::UniversalId& id,
const std::string& hint)
{
focusId (id, hint);
}
}

@ -9,7 +9,7 @@
#include <cassert>
#include "../../model/doc/document.hpp"
#include "../../model/settings/usersettings.hpp"
#include "../../model/world/cellselection.hpp"
#include "../filter/filterbox.hpp"
@ -74,6 +74,13 @@ 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);
}
@ -254,4 +261,4 @@ void CSVWorld::SceneSubView::replaceToolbarAndWorldspace (CSVRender::WorldspaceW
mScene->selectDefaultNavigationMode();
setFocusProxy (mScene);
}
}

@ -6,6 +6,7 @@
#include "../../model/doc/document.hpp"
#include "../../model/world/tablemimedata.hpp"
#include "../../model/settings/usersettings.hpp"
#include "../filter/filterbox.hpp"
#include "table.hpp"
@ -34,6 +35,13 @@ 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&)),

@ -142,7 +142,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinBox_min_subview_width">
<widget class="QSpinBox" name="sbMinSubViewWidth">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
@ -260,10 +260,10 @@
<string>Show Status Bar</string>
</property>
</widget>
<zorder>displayGroup_Subviews</zorder>
<zorder>layoutWidget_Subviews</zorder>
<zorder>displayGroup_Window</zorder>
<zorder>displayGroup_DisplayFormat</zorder>
<zorder>displayGroup_Subviews</zorder>
<zorder>cbStatusBar</zorder>
</widget>
<widget class="QWidget" name="VideoSettings">
@ -387,7 +387,7 @@
<tabstop>sbHeight</tabstop>
<tabstop>cbStatusBar</tabstop>
<tabstop>spinBox_max_subviews</tabstop>
<tabstop>spinBox_min_subview_width</tabstop>
<tabstop>sbMinSubViewWidth</tabstop>
<tabstop>checkBox_reuse_subview</tabstop>
<tabstop>cbOverride</tabstop>
<tabstop>cmbRenderSys</tabstop>

Loading…
Cancel
Save