mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
@@ -11,7 +11,11 @@
|
||||
</rect>
|
||||
</property>
|
||||
<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 name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
@@ -164,6 +168,8 @@
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../../blackmisc/blackmisc.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -124,6 +124,17 @@ namespace BlackGui
|
||||
menu->addAction(showMenuText);
|
||||
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()));
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
Q_ASSERT(position == QTabWidget::North || position == QTabWidget::South);
|
||||
|
||||
@@ -121,7 +121,8 @@ namespace BlackGui
|
||||
QList<CDockWidgetInfoArea *> m_dockableWidgets ;
|
||||
QTabBar *m_tabBar = nullptr;
|
||||
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
|
||||
void tabifyAllWidgets();
|
||||
@@ -181,6 +182,9 @@ namespace BlackGui
|
||||
//! Show the tab texts, or just the icons
|
||||
void ps_showTabTexts(bool show);
|
||||
|
||||
//! Toggle checkable setting
|
||||
void ps_toggleAutoAdjustFloatingWidget(bool adjust);
|
||||
|
||||
//! Tab position for docked widgets tab
|
||||
//! \remarks North or South working, East / West not
|
||||
void ps_setTabBarPosition(QTabWidget::TabPosition position);
|
||||
|
||||
@@ -118,6 +118,9 @@ namespace BlackGui
|
||||
}
|
||||
this->setNullTitleBar();
|
||||
this->setContentsMargins(this->m_marginsWhenFloating);
|
||||
if (this->m_autoAdjustWhenFloating) {
|
||||
this->adjustSize();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -50,6 +50,9 @@ namespace BlackGui
|
||||
//! Margins when widget is floating
|
||||
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
|
||||
const QString &windowTitleBackup() const { return this->m_windowTitleBackup; }
|
||||
|
||||
@@ -59,8 +62,6 @@ namespace BlackGui
|
||||
//! Show the window title when docked
|
||||
void showTitleWhenDocked(bool show);
|
||||
|
||||
|
||||
|
||||
public slots:
|
||||
//! Toggle floating
|
||||
void toggleFloating();
|
||||
@@ -100,6 +101,7 @@ namespace BlackGui
|
||||
QMargins m_marginsWhenDocked; //!< Offsets when window is floating
|
||||
QString m_windowTitleBackup; //!< original title, even if the widget title is deleted for layout purposes
|
||||
bool m_windowTitleWhenDocked = true;
|
||||
bool m_autoAdjustWhenFloating = true;
|
||||
|
||||
//! Empty widget with no size
|
||||
void initTitleBarWidgets();
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace BlackGui
|
||||
// Dockable widget's context menu
|
||||
CDockWidget::addToContextMenu(contextMenu);
|
||||
|
||||
// from main component
|
||||
// from main component (info area)
|
||||
contextMenu->addSeparator();
|
||||
mainWidget->addToContextMenu(contextMenu);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user