mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
If using SHIFT and navigator button reset to screen center
This commit is contained in:
@@ -267,6 +267,15 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (shift && floating) { this->resetPosition(); }
|
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()
|
void CDockWidget::toggleVisibility()
|
||||||
@@ -685,7 +694,8 @@ namespace BlackGui
|
|||||||
if (!sGui) { return; }
|
if (!sGui) { return; }
|
||||||
|
|
||||||
// pos can be null during init
|
// 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())
|
if (pos.isNull())
|
||||||
{
|
{
|
||||||
pos = CGuiApplication::currentScreen()->geometry().center() - this->rect().center();
|
pos = CGuiApplication::currentScreen()->geometry().center() - this->rect().center();
|
||||||
|
|||||||
@@ -575,7 +575,7 @@ namespace BlackGui
|
|||||||
if (init)
|
if (init)
|
||||||
{
|
{
|
||||||
// float
|
// float
|
||||||
QPoint offset(i * 25, i * 20);
|
const QPoint offset(i * 10, i * 10);
|
||||||
// after->setVisible(false);
|
// after->setVisible(false);
|
||||||
// after->setFloating(true);
|
// after->setFloating(true);
|
||||||
after->setOffsetWhenFloating(offset);
|
after->setOffsetWhenFloating(offset);
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ void SwiftGuiStd::init()
|
|||||||
|
|
||||||
// navigator
|
// navigator
|
||||||
m_navigator->addAction(this->getToggleWindowVisibilityAction(m_navigator.data()));
|
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->getWindowNormalAction(m_navigator.data()));
|
||||||
m_navigator->addAction(this->getWindowMinimizeAction(m_navigator.data()));
|
m_navigator->addAction(this->getWindowMinimizeAction(m_navigator.data()));
|
||||||
m_navigator->addAction(this->getToggleStayOnTopAction(m_navigator.data()));
|
m_navigator->addAction(this->getToggleStayOnTopAction(m_navigator.data()));
|
||||||
|
|||||||
Reference in New Issue
Block a user