mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 23:35:33 +08:00
@@ -11,7 +11,11 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Frame</string>
|
<string>Info status bar</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="../../blackmisc/blackmisc.qrc">
|
||||||
|
<normaloff>:/own/icons/own/swift/swift24.png</normaloff>:/own/icons/own/swift/swift24.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
@@ -164,6 +168,8 @@
|
|||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="../../blackmisc/blackmisc.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -124,6 +124,17 @@ namespace BlackGui
|
|||||||
menu->addAction(showMenuText);
|
menu->addAction(showMenuText);
|
||||||
connect(showMenuText, &QAction::toggled, this, &CMainInfoAreaComponent::ps_showTabTexts);
|
connect(showMenuText, &QAction::toggled, this, &CMainInfoAreaComponent::ps_showTabTexts);
|
||||||
|
|
||||||
|
// auto adjust floating widgets
|
||||||
|
QAction *autoAdjustFloatingWidget = new QAction(menu);
|
||||||
|
autoAdjustFloatingWidget->setObjectName("AutoAdjustFloatingWidgets");
|
||||||
|
autoAdjustFloatingWidget->setIconText("Auto adjust floating widgets");
|
||||||
|
autoAdjustFloatingWidget->setIcon(CIcons::resize16());
|
||||||
|
autoAdjustFloatingWidget->setCheckable(true);
|
||||||
|
autoAdjustFloatingWidget->setChecked(this->m_autoAdjustFloatingWidgets);
|
||||||
|
menu->addAction(autoAdjustFloatingWidget);
|
||||||
|
connect(autoAdjustFloatingWidget, &QAction::toggled, this, &CMainInfoAreaComponent::ps_toggleAutoAdjustFloatingWidget);
|
||||||
|
|
||||||
|
// tab bar position
|
||||||
menu->addAction(CIcons::dockBottom16(), "Toogle tabbar position", this, SLOT(ps_toggleTabBarPosition()));
|
menu->addAction(CIcons::dockBottom16(), "Toogle tabbar position", this, SLOT(ps_toggleTabBarPosition()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -506,6 +517,18 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMainInfoAreaComponent::ps_toggleAutoAdjustFloatingWidget(bool adjust)
|
||||||
|
{
|
||||||
|
if (adjust == this->m_autoAdjustFloatingWidgets) return;
|
||||||
|
this->m_autoAdjustFloatingWidgets = adjust;
|
||||||
|
QList<CDockWidgetInfoArea *>::iterator i;
|
||||||
|
for (i = this->m_dockableWidgets.begin(); i != this->m_dockableWidgets.end(); ++i)
|
||||||
|
{
|
||||||
|
CDockWidgetInfoArea *dw = (*i);
|
||||||
|
dw->setAutoAdjustWhenFloating(adjust);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CMainInfoAreaComponent::ps_setTabBarPosition(QTabWidget::TabPosition position)
|
void CMainInfoAreaComponent::ps_setTabBarPosition(QTabWidget::TabPosition position)
|
||||||
{
|
{
|
||||||
Q_ASSERT(position == QTabWidget::North || position == QTabWidget::South);
|
Q_ASSERT(position == QTabWidget::North || position == QTabWidget::South);
|
||||||
|
|||||||
@@ -121,7 +121,8 @@ namespace BlackGui
|
|||||||
QList<CDockWidgetInfoArea *> m_dockableWidgets ;
|
QList<CDockWidgetInfoArea *> m_dockableWidgets ;
|
||||||
QTabBar *m_tabBar = nullptr;
|
QTabBar *m_tabBar = nullptr;
|
||||||
bool m_showTabTexts = true;
|
bool m_showTabTexts = true;
|
||||||
bool m_infoAreaFloating = false; //!< whole info area floating
|
bool m_infoAreaFloating = false; //!< whole info area floating
|
||||||
|
bool m_autoAdjustFloatingWidgets = true; //!< auto ajdust the floating widgets
|
||||||
|
|
||||||
//! Tabify the widgets
|
//! Tabify the widgets
|
||||||
void tabifyAllWidgets();
|
void tabifyAllWidgets();
|
||||||
@@ -181,6 +182,9 @@ namespace BlackGui
|
|||||||
//! Show the tab texts, or just the icons
|
//! Show the tab texts, or just the icons
|
||||||
void ps_showTabTexts(bool show);
|
void ps_showTabTexts(bool show);
|
||||||
|
|
||||||
|
//! Toggle checkable setting
|
||||||
|
void ps_toggleAutoAdjustFloatingWidget(bool adjust);
|
||||||
|
|
||||||
//! Tab position for docked widgets tab
|
//! Tab position for docked widgets tab
|
||||||
//! \remarks North or South working, East / West not
|
//! \remarks North or South working, East / West not
|
||||||
void ps_setTabBarPosition(QTabWidget::TabPosition position);
|
void ps_setTabBarPosition(QTabWidget::TabPosition position);
|
||||||
|
|||||||
@@ -118,6 +118,9 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
this->setNullTitleBar();
|
this->setNullTitleBar();
|
||||||
this->setContentsMargins(this->m_marginsWhenFloating);
|
this->setContentsMargins(this->m_marginsWhenFloating);
|
||||||
|
if (this->m_autoAdjustWhenFloating) {
|
||||||
|
this->adjustSize();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ namespace BlackGui
|
|||||||
//! Margins when widget is floating
|
//! Margins when widget is floating
|
||||||
void setMarginsWhenDocked(int left, int top, int right, int bottom) { this->m_marginsWhenDocked = QMargins(left, top, right, bottom); }
|
void setMarginsWhenDocked(int left, int top, int right, int bottom) { this->m_marginsWhenDocked = QMargins(left, top, right, bottom); }
|
||||||
|
|
||||||
|
//! Auto adjust size when floating
|
||||||
|
void setAutoAdjustWhenFloating(bool autoAdjust) { this->m_autoAdjustWhenFloating = autoAdjust; }
|
||||||
|
|
||||||
//! Window title backup
|
//! Window title backup
|
||||||
const QString &windowTitleBackup() const { return this->m_windowTitleBackup; }
|
const QString &windowTitleBackup() const { return this->m_windowTitleBackup; }
|
||||||
|
|
||||||
@@ -59,8 +62,6 @@ namespace BlackGui
|
|||||||
//! Show the window title when docked
|
//! Show the window title when docked
|
||||||
void showTitleWhenDocked(bool show);
|
void showTitleWhenDocked(bool show);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
//! Toggle floating
|
//! Toggle floating
|
||||||
void toggleFloating();
|
void toggleFloating();
|
||||||
@@ -100,6 +101,7 @@ namespace BlackGui
|
|||||||
QMargins m_marginsWhenDocked; //!< Offsets when window is floating
|
QMargins m_marginsWhenDocked; //!< Offsets when window is floating
|
||||||
QString m_windowTitleBackup; //!< original title, even if the widget title is deleted for layout purposes
|
QString m_windowTitleBackup; //!< original title, even if the widget title is deleted for layout purposes
|
||||||
bool m_windowTitleWhenDocked = true;
|
bool m_windowTitleWhenDocked = true;
|
||||||
|
bool m_autoAdjustWhenFloating = true;
|
||||||
|
|
||||||
//! Empty widget with no size
|
//! Empty widget with no size
|
||||||
void initTitleBarWidgets();
|
void initTitleBarWidgets();
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace BlackGui
|
|||||||
// Dockable widget's context menu
|
// Dockable widget's context menu
|
||||||
CDockWidget::addToContextMenu(contextMenu);
|
CDockWidget::addToContextMenu(contextMenu);
|
||||||
|
|
||||||
// from main component
|
// from main component (info area)
|
||||||
contextMenu->addSeparator();
|
contextMenu->addSeparator();
|
||||||
mainWidget->addToContextMenu(contextMenu);
|
mainWidget->addToContextMenu(contextMenu);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user