mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-28 11:45:40 +08:00
Ref T592, also fire signal after init and doube click of tab bar
This commit is contained in:
committed by
Mat Sutcliffe
parent
410b187a0e
commit
9fd782af71
@@ -24,6 +24,7 @@
|
|||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
#include <QPointer>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
#include <QSignalMapper>
|
#include <QSignalMapper>
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
@@ -76,6 +77,13 @@ namespace BlackGui
|
|||||||
this->statusBar()->hide();
|
this->statusBar()->hide();
|
||||||
this->statusBar()->setMaximumHeight(0);
|
this->statusBar()->setMaximumHeight(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fire an initial status
|
||||||
|
QPointer<CInfoArea> myself(this);
|
||||||
|
QTimer::singleShot(5000, this, [ = ]
|
||||||
|
{
|
||||||
|
if (myself) { myself->emitInfoAreaStatus(); }
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoArea::addToContextMenu(QMenu *menu) const
|
void CInfoArea::addToContextMenu(QMenu *menu) const
|
||||||
@@ -158,7 +166,7 @@ namespace BlackGui
|
|||||||
connect(showTabbar, &QAction::toggled, this, &CInfoArea::showTabBar);
|
connect(showTabbar, &QAction::toggled, this, &CInfoArea::showTabBar);
|
||||||
|
|
||||||
// tab bar position
|
// tab bar position
|
||||||
menu->addAction(CIcons::dockBottom16(), "Toogle tabbar position", this, &CInfoArea::toggleTabBarPosition);
|
menu->addAction(CIcons::dockBottom16(), "Toggle tabbar position", this, &CInfoArea::toggleTabBarPosition);
|
||||||
Q_UNUSED(c);
|
Q_UNUSED(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -672,7 +680,7 @@ namespace BlackGui
|
|||||||
void CInfoArea::onTabBarIndexChanged(int tabBarIndex)
|
void CInfoArea::onTabBarIndexChanged(int tabBarIndex)
|
||||||
{
|
{
|
||||||
emit this->changedInfoAreaTabBarIndex(tabBarIndex);
|
emit this->changedInfoAreaTabBarIndex(tabBarIndex);
|
||||||
emitInfoAreaStatus();
|
this->emitInfoAreaStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CInfoArea::countDockedWidgetInfoAreas() const
|
int CInfoArea::countDockedWidgetInfoAreas() const
|
||||||
@@ -783,6 +791,12 @@ namespace BlackGui
|
|||||||
CDockWidgetInfoArea *dw = this->getDockWidgetInfoAreaByTabBarIndex(tabBarIndex);
|
CDockWidgetInfoArea *dw = this->getDockWidgetInfoAreaByTabBarIndex(tabBarIndex);
|
||||||
if (!dw) { return; }
|
if (!dw) { return; }
|
||||||
dw->toggleFloating();
|
dw->toggleFloating();
|
||||||
|
|
||||||
|
QPointer<CInfoArea> myself(this);
|
||||||
|
QTimer::singleShot(1000, this, [ = ]
|
||||||
|
{
|
||||||
|
myself->emitInfoAreaStatus();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoArea::onWidgetTopLevelChanged(CDockWidget *dockWidget, bool topLevel)
|
void CInfoArea::onWidgetTopLevelChanged(CDockWidget *dockWidget, bool topLevel)
|
||||||
@@ -801,6 +815,7 @@ namespace BlackGui
|
|||||||
this->selectArea(dwia);
|
this->selectArea(dwia);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KB commented out with T592
|
||||||
// when toplevel is changed, I need a round in the event loop until
|
// when toplevel is changed, I need a round in the event loop until
|
||||||
// current tab bar widget is visible
|
// current tab bar widget is visible
|
||||||
// QTimer::singleShot(250, this, &CInfoArea::emitInfoAreaStatus);
|
// QTimer::singleShot(250, this, &CInfoArea::emitInfoAreaStatus);
|
||||||
|
|||||||
@@ -189,10 +189,6 @@ namespace BlackGui
|
|||||||
//! Toogle lock tabbar
|
//! Toogle lock tabbar
|
||||||
void toggleTabBarLocked(bool locked);
|
void toggleTabBarLocked(bool locked);
|
||||||
|
|
||||||
private slots:
|
|
||||||
//! Toggle tab position North - South
|
|
||||||
void toggleTabBarPosition();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<CDockWidgetInfoArea *> m_dockWidgetInfoAreas;
|
QList<CDockWidgetInfoArea *> m_dockWidgetInfoAreas;
|
||||||
QList<CInfoArea *> m_childInfoAreas;
|
QList<CInfoArea *> m_childInfoAreas;
|
||||||
@@ -202,6 +198,9 @@ namespace BlackGui
|
|||||||
bool m_showTabBar = true; //!< show the tab bar?
|
bool m_showTabBar = true; //!< show the tab bar?
|
||||||
bool m_lockTabBar = false; //!< locked: means double clicks ignored
|
bool m_lockTabBar = false; //!< locked: means double clicks ignored
|
||||||
|
|
||||||
|
//! Toggle tab position North - South
|
||||||
|
void toggleTabBarPosition();
|
||||||
|
|
||||||
//! Tabify the widgets
|
//! Tabify the widgets
|
||||||
void tabifyAllWidgets();
|
void tabifyAllWidgets();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user