mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 20:40:29 +08:00
refs #512, removed ini file for offsets
This commit is contained in:
@@ -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
|
|
||||||
@@ -59,7 +59,7 @@ QFileDialog QToolButton {
|
|||||||
Required when dock widget is floating
|
Required when dock widget is floating
|
||||||
1) background-image not working on QDockWidget, so I use direct children for that
|
1) background-image not working on QDockWidget, so I use direct children for that
|
||||||
2) seems to have only effect as normal (floating) window
|
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 {
|
BlackGui--CDockWidgetInfoArea {
|
||||||
background-color: green; /* Use green or red here to adjust the borders */
|
background-color: green; /* Use green or red here to adjust the borders */
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CDockWidgetInfoBar::ps_onStyleSheetsChanged()
|
void CDockWidgetInfoBar::ps_onStyleSheetsChanged()
|
||||||
{
|
{
|
||||||
if (!this->objectName().isEmpty()) { this->setMarginsFromSettings(); }
|
|
||||||
QString st = sGui->getStyleSheetUtility().style(CStyleSheetUtility::fileNameInfoBar());
|
QString st = sGui->getStyleSheetUtility().style(CStyleSheetUtility::fileNameInfoBar());
|
||||||
this->setStyleSheet(st);
|
this->setStyleSheet(st);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->ps_setDockArea(Qt::TopDockWidgetArea);
|
this->ps_setDockArea(Qt::TopDockWidgetArea);
|
||||||
this->iniFileBasedSettings();
|
|
||||||
this->connectTopLevelChanged();
|
this->connectTopLevelChanged();
|
||||||
this->setFeaturesForDockableWidgets(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable);
|
this->setFeaturesForDockableWidgets(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable);
|
||||||
this->tabifyAllWidgets();
|
this->tabifyAllWidgets();
|
||||||
@@ -595,28 +594,6 @@ namespace BlackGui
|
|||||||
return infoAreas;
|
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()
|
void CInfoArea::ps_emitInfoAreaStatus()
|
||||||
{
|
{
|
||||||
int sia = this->getSelectedDockInfoAreaIndex();
|
int sia = this->getSelectedDockInfoAreaIndex();
|
||||||
@@ -764,7 +741,6 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CInfoArea::ps_onStyleSheetChanged()
|
void CInfoArea::ps_onStyleSheetChanged()
|
||||||
{
|
{
|
||||||
this->iniFileBasedSettings();
|
|
||||||
if (this->m_tabBar)
|
if (this->m_tabBar)
|
||||||
{
|
{
|
||||||
QString qss = sGui->getStyleSheetUtility().style(CStyleSheetUtility::fileNameDockWidgetTab());
|
QString qss = sGui->getStyleSheetUtility().style(CStyleSheetUtility::fileNameDockWidgetTab());
|
||||||
|
|||||||
@@ -226,9 +226,6 @@ namespace BlackGui
|
|||||||
//! \remarks result stored in m_dockableWidgets
|
//! \remarks result stored in m_dockableWidgets
|
||||||
QList<CDockWidgetInfoArea *> findOwnDockWidgetInfoAreas() const;
|
QList<CDockWidgetInfoArea *> findOwnDockWidgetInfoAreas() const;
|
||||||
|
|
||||||
//! Settings based on ini file
|
|
||||||
void iniFileBasedSettings();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//! Tab bar has been double clicked
|
//! Tab bar has been double clicked
|
||||||
void ps_tabBarDoubleClicked(int tabBarIndex);
|
void ps_tabBarDoubleClicked(int tabBarIndex);
|
||||||
|
|||||||
@@ -112,10 +112,6 @@ namespace BlackGui
|
|||||||
QDir directory(CBuildConfig::getStylesheetsDir());
|
QDir directory(CBuildConfig::getStylesheetsDir());
|
||||||
if (!directory.exists()) { return false; }
|
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
|
// qss/css files
|
||||||
directory.setNameFilters({"*.qss", "*.css"});
|
directory.setNameFilters({"*.qss", "*.css"});
|
||||||
directory.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
|
directory.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
|
||||||
@@ -335,12 +331,6 @@ namespace BlackGui
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &CStyleSheetUtility::fileNameIniFile()
|
|
||||||
{
|
|
||||||
static const QString f("gui.ini");
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QStringList &CStyleSheetUtility::fontWeights()
|
const QStringList &CStyleSheetUtility::fontWeights()
|
||||||
{
|
{
|
||||||
static const QStringList w({"bold", "semibold", "light", "black", "normal"});
|
static const QStringList w({"bold", "semibold", "light", "black", "normal"});
|
||||||
|
|||||||
@@ -61,9 +61,6 @@ namespace BlackGui
|
|||||||
//! Read the *.qss files
|
//! Read the *.qss files
|
||||||
bool read();
|
bool read();
|
||||||
|
|
||||||
//! GUI ini file data
|
|
||||||
const QSettings *iniFile() const { return m_iniFile.data(); }
|
|
||||||
|
|
||||||
//! Get the font style
|
//! Get the font style
|
||||||
static QString fontStyle(const QString &combinedStyleAndWeight);
|
static QString fontStyle(const QString &combinedStyleAndWeight);
|
||||||
|
|
||||||
@@ -109,9 +106,6 @@ namespace BlackGui
|
|||||||
//! File name swiftlauncher.qss
|
//! File name swiftlauncher.qss
|
||||||
static const QString &fileNameSwiftLauncher();
|
static const QString &fileNameSwiftLauncher();
|
||||||
|
|
||||||
//! File name ini file
|
|
||||||
static const QString &fileNameIniFile();
|
|
||||||
|
|
||||||
//! Font weights
|
//! Font weights
|
||||||
static const QStringList &fontWeights();
|
static const QStringList &fontWeights();
|
||||||
|
|
||||||
@@ -151,7 +145,6 @@ namespace BlackGui
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QMap<QString, QString> m_styleSheets; //!< filename, stylesheet
|
QMap<QString, QString> m_styleSheets; //!< filename, stylesheet
|
||||||
QScopedPointer<QSettings> m_iniFile;
|
|
||||||
QFileSystemWatcher m_fileWatcher {this}; //!< Monitor my qss files
|
QFileSystemWatcher m_fileWatcher {this}; //!< Monitor my qss files
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user