refs #312 navigation bars, contributes also to #347

* allow to set/unset frameless mode in CDockWidget
* adjusted context menus
* adjusted style sheets
* ini settings for margins
* hidden info area to host floating widgets only visible when floating (allows to CDockInfoArea widgets)
* made some private slots non-virtual
This commit is contained in:
Klaus Basan
2015-04-08 22:46:54 +02:00
parent 425e034b19
commit e7c8c28252
23 changed files with 556 additions and 175 deletions

View File

@@ -499,6 +499,15 @@ namespace BlackGui
}
}
void CInfoArea::setMarginsWhenFramelessFloating(int left, int top, int right, int bottom)
{
for (CDockWidgetInfoArea *dw : this->m_dockWidgetInfoAreas)
{
//! Margins when window is floating
dw->setMarginsWhenFramelessFloating(left, top, right, bottom);
}
}
void CInfoArea::setMarginsWhenDocked(int left, int top, int right, int bottom)
{
for (CDockWidgetInfoArea *dw : this->m_dockWidgetInfoAreas)
@@ -534,24 +543,21 @@ namespace BlackGui
void CInfoArea::iniFileBasedSettings()
{
const QString section(this->objectName());
const QSettings *settings = CStyleSheetUtility::instance().iniFile();
if (settings)
if (settings && !section.isEmpty())
{
this->setMarginsWhenDocked(
settings->value("infoarea/margindocked.left").toInt(),
settings->value("infoarea/margindocked.top").toInt(),
settings->value("infoarea/margindocked.right").toInt(),
settings->value("infoarea/margindocked.bottom").toInt());
this->setMarginsWhenFloating(
settings->value("infoarea/marginfloating.left").toInt(),
settings->value("infoarea/marginfloating.top").toInt(),
settings->value("infoarea/marginfloating.right").toInt(),
settings->value("infoarea/marginfloating.bottom").toInt());
for (CDockWidgetInfoArea *dw : this->m_dockWidgetInfoAreas)
{
//! Margins when window is floating
dw->setMarginsFromSettings(section);
}
}
else
{
// some defaut if not available
this->setMarginsWhenFloating(10, 10, 20, 20); // left, top, right, bottom
// some defaults if not available
this->setMarginsWhenFloating(10, 10, 10, 10); // left, top, right, bottom
this->setMarginsWhenFramelessFloating(5, 5, 5, 5); // left, top, right, bottom
this->setMarginsWhenDocked(1, 1, 1, 1); // top has no effect
}
}