mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
If using SHIFT and navigator button reset to screen center
This commit is contained in:
committed by
Mat Sutcliffe
parent
f20855b613
commit
2e6eac45bd
@@ -267,6 +267,15 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
if (shift && floating) { this->resetPosition(); }
|
||||
if (floating)
|
||||
{
|
||||
// check where we are, otherwise reset if NOT appropriate
|
||||
const QPoint p = this->rect().topLeft();
|
||||
if (p.x() < 1 || p.y() < 1)
|
||||
{
|
||||
this->resetPosition();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CDockWidget::toggleVisibility()
|
||||
@@ -685,7 +694,8 @@ namespace BlackGui
|
||||
if (!sGui) { return; }
|
||||
|
||||
// pos can be null during init
|
||||
QPoint pos = CGuiUtility::mainWidgetGlobalPosition();
|
||||
QWidget *mw = CGuiUtility::mainApplicationWidget();
|
||||
QPoint pos = mw && mw->isVisible() ? CGuiUtility::mainWidgetGlobalPosition() : QPoint();
|
||||
if (pos.isNull())
|
||||
{
|
||||
pos = CGuiApplication::currentScreen()->geometry().center() - this->rect().center();
|
||||
|
||||
@@ -575,7 +575,7 @@ namespace BlackGui
|
||||
if (init)
|
||||
{
|
||||
// float
|
||||
QPoint offset(i * 25, i * 20);
|
||||
const QPoint offset(i * 10, i * 10);
|
||||
// after->setVisible(false);
|
||||
// after->setFloating(true);
|
||||
after->setOffsetWhenFloating(offset);
|
||||
|
||||
@@ -111,7 +111,7 @@ void SwiftGuiStd::init()
|
||||
|
||||
// navigator
|
||||
m_navigator->addAction(this->getToggleWindowVisibilityAction(m_navigator.data()));
|
||||
m_navigator->addActions(ui->comp_MainInfoArea->getInfoAreaToggleFloatingActions(m_navigator.data()));
|
||||
m_navigator->addActions(ui->comp_MainInfoArea->getInfoAreaToggleFloatingActions(m_navigator.data())); // here we add the actions for the main windows
|
||||
m_navigator->addAction(this->getWindowNormalAction(m_navigator.data()));
|
||||
m_navigator->addAction(this->getWindowMinimizeAction(m_navigator.data()));
|
||||
m_navigator->addAction(this->getToggleStayOnTopAction(m_navigator.data()));
|
||||
|
||||
Reference in New Issue
Block a user