refs #512, removed ini file for offsets

This commit is contained in:
Klaus Basan
2016-06-03 17:59:42 +02:00
parent 436b60700f
commit ddace24c35
7 changed files with 1 additions and 121 deletions

View File

@@ -1,75 +0,0 @@
[alias]
; those are the component names and valid until an object name is set
; in most cases the object name is not yet known in the constructor
; this alias makes sense as long there is one object per component
CMainInfoAreaComponent = comp_MainInfoArea
CCockpitInfoAreaComponent = comp_CockpitInfoArea
CInvisibleInfoAreaComponent = comp_InvisibleInfoArea
CInfoBarStatusComponent = dw_dw_InfoBarStatus
[comp_MainInfoArea]
margindocked.left = 0
margindocked.right = 0
margindocked.top = 0
margindocked.bottom = 0
; why the odd numbers??
marginfloating.left = 0
marginfloating.right = 15
marginfloating.top = 3
marginfloating.bottom = 35
marginfloating.frameless.left = 0
marginfloating.frameless.right = 0
marginfloating.frameless.top = 0
marginfloating.frameless.bottom = 0
[comp_CockpitInfoArea]
margindocked.left = 0
margindocked.right = 0
margindocked.top = 0
margindocked.bottom = 0
; why the odd numbers??
marginfloating.left = 0
marginfloating.right = 15
marginfloating.top = 0
marginfloating.bottom = 35
marginfloating.frameless.left = 0
marginfloating.frameless.right = 0
marginfloating.frameless.top = 0
marginfloating.frameless.bottom = 0
[comp_InvisibleInfoArea]
margindocked.left = 0
margindocked.right = 0
margindocked.top = 0
margindocked.bottom = 0
; why the odd numbers??
marginfloating.left = 0
marginfloating.right = 15
marginfloating.top = 0
marginfloating.bottom = 35
marginfloating.frameless.left = 0
marginfloating.frameless.right = 0
marginfloating.frameless.top = 0
marginfloating.frameless.bottom = 0
[dw_InfoBarStatus]
margindocked.left = 0
margindocked.right = 0
margindocked.top = 0
margindocked.bottom = 0
marginfloating.left = 0
marginfloating.right = 0
marginfloating.top = 0
marginfloating.bottom = 0
marginfloating.frameless.left = 0
marginfloating.frameless.right = 0
marginfloating.frameless.top = 0
marginfloating.frameless.bottom = 0

View File

@@ -59,7 +59,7 @@ QFileDialog QToolButton {
Required when dock widget is floating
1) background-image not working on QDockWidget, so I use direct children for that
2) seems to have only effect as normal (floating) window
3) Borders between this widget and the inner child is the margin in gui.ini
3) Borders between this widget and the inner child are the margins defined in dockwidget
*/
BlackGui--CDockWidgetInfoArea {
background-color: green; /* Use green or red here to adjust the borders */

View File

@@ -35,7 +35,6 @@ namespace BlackGui
void CDockWidgetInfoBar::ps_onStyleSheetsChanged()
{
if (!this->objectName().isEmpty()) { this->setMarginsFromSettings(); }
QString st = sGui->getStyleSheetUtility().style(CStyleSheetUtility::fileNameInfoBar());
this->setStyleSheet(st);
}

View File

@@ -58,7 +58,6 @@ namespace BlackGui
}
this->ps_setDockArea(Qt::TopDockWidgetArea);
this->iniFileBasedSettings();
this->connectTopLevelChanged();
this->setFeaturesForDockableWidgets(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable);
this->tabifyAllWidgets();
@@ -595,28 +594,6 @@ namespace BlackGui
return infoAreas;
}
void CInfoArea::iniFileBasedSettings()
{
// with Qt 5.5 still needed
const QString section(this->objectName());
const QSettings *settings = sGui->getStyleSheetUtility().iniFile();
if (settings && !section.isEmpty())
{
for (CDockWidgetInfoArea *dw : this->m_dockWidgetInfoAreas)
{
//! Margins when window is floating
dw->setMarginsFromSettings(section);
}
}
else
{
// 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
}
}
void CInfoArea::ps_emitInfoAreaStatus()
{
int sia = this->getSelectedDockInfoAreaIndex();
@@ -764,7 +741,6 @@ namespace BlackGui
void CInfoArea::ps_onStyleSheetChanged()
{
this->iniFileBasedSettings();
if (this->m_tabBar)
{
QString qss = sGui->getStyleSheetUtility().style(CStyleSheetUtility::fileNameDockWidgetTab());

View File

@@ -226,9 +226,6 @@ namespace BlackGui
//! \remarks result stored in m_dockableWidgets
QList<CDockWidgetInfoArea *> findOwnDockWidgetInfoAreas() const;
//! Settings based on ini file
void iniFileBasedSettings();
private slots:
//! Tab bar has been double clicked
void ps_tabBarDoubleClicked(int tabBarIndex);

View File

@@ -112,10 +112,6 @@ namespace BlackGui
QDir directory(CBuildConfig::getStylesheetsDir());
if (!directory.exists()) { return false; }
// ini file
const QString iniFile = CFileUtils::appendFilePaths(directory.absolutePath(), fileNameIniFile());
m_iniFile.reset(new QSettings(iniFile, QSettings::IniFormat));
// qss/css files
directory.setNameFilters({"*.qss", "*.css"});
directory.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
@@ -335,12 +331,6 @@ namespace BlackGui
return f;
}
const QString &CStyleSheetUtility::fileNameIniFile()
{
static const QString f("gui.ini");
return f;
}
const QStringList &CStyleSheetUtility::fontWeights()
{
static const QStringList w({"bold", "semibold", "light", "black", "normal"});

View File

@@ -61,9 +61,6 @@ namespace BlackGui
//! Read the *.qss files
bool read();
//! GUI ini file data
const QSettings *iniFile() const { return m_iniFile.data(); }
//! Get the font style
static QString fontStyle(const QString &combinedStyleAndWeight);
@@ -109,9 +106,6 @@ namespace BlackGui
//! File name swiftlauncher.qss
static const QString &fileNameSwiftLauncher();
//! File name ini file
static const QString &fileNameIniFile();
//! Font weights
static const QStringList &fontWeights();
@@ -151,7 +145,6 @@ namespace BlackGui
private:
QMap<QString, QString> m_styleSheets; //!< filename, stylesheet
QScopedPointer<QSettings> m_iniFile;
QFileSystemWatcher m_fileWatcher {this}; //!< Monitor my qss files
};
}