mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Dock widget minor style issues
This commit is contained in:
committed by
Mat Sutcliffe
parent
62e74092ba
commit
4183a67e1f
@@ -266,6 +266,7 @@ namespace BlackGui
|
||||
this->setAllowedAreas(Qt::NoDockWidgetArea);
|
||||
}
|
||||
|
||||
// with shift ALWAYS reset
|
||||
if (shift && floating) { this->resetPosition(); }
|
||||
if (floating)
|
||||
{
|
||||
@@ -559,7 +560,7 @@ namespace BlackGui
|
||||
|
||||
void CDockWidget::showContextMenu(const QPoint &pos)
|
||||
{
|
||||
QPoint globalPos = this->mapToGlobal(pos);
|
||||
const QPoint globalPos = this->mapToGlobal(pos);
|
||||
QScopedPointer<QMenu> contextMenu(new QMenu(this));
|
||||
this->addToContextMenu(contextMenu.data());
|
||||
QAction *selectedItem = contextMenu.data()->exec(globalPos);
|
||||
@@ -695,15 +696,17 @@ namespace BlackGui
|
||||
if (!sGui) { return; }
|
||||
|
||||
// pos can be null during init
|
||||
QWidget *mw = CGuiUtility::mainApplicationWidget();
|
||||
const QWidget *mw = CGuiUtility::mainApplicationWidget();
|
||||
QPoint pos = mw && mw->isVisible() ? CGuiUtility::mainWidgetGlobalPosition() : QPoint();
|
||||
if (pos.isNull())
|
||||
{
|
||||
pos = CGuiApplication::currentScreen()->geometry().center() - this->rect().center();
|
||||
}
|
||||
|
||||
const int x = pos.x() + m_offsetWhenFloating.x();
|
||||
const int y = pos.y() + m_offsetWhenFloating.y();
|
||||
const int osFloatingX = m_offsetWhenFloating.x();
|
||||
const int osFloatingY = m_offsetWhenFloating.y();
|
||||
const int x = pos.x() + osFloatingX;
|
||||
const int y = pos.y() + osFloatingY;
|
||||
this->move(x, y);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace BlackGui
|
||||
|
||||
// tab bar position
|
||||
menu->addAction(CIcons::dockBottom16(), "Toggle tabbar position", this, &CInfoArea::toggleTabBarPosition);
|
||||
Q_UNUSED(c);
|
||||
Q_UNUSED(c)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ namespace BlackGui
|
||||
void CInfoArea::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
CStyleSheetUtility::useStyleSheetInDerivedWidget(this, QStyle::PE_FrameWindow);
|
||||
Q_UNUSED(event);
|
||||
Q_UNUSED(event)
|
||||
}
|
||||
|
||||
void CInfoArea::keyPressEvent(QKeyEvent *event)
|
||||
@@ -805,7 +805,7 @@ namespace BlackGui
|
||||
void CInfoArea::onWidgetTopLevelChanged(CDockWidget *dockWidget, bool topLevel)
|
||||
{
|
||||
Q_ASSERT(dockWidget);
|
||||
Q_UNUSED(topLevel);
|
||||
Q_UNUSED(topLevel)
|
||||
if (!dockWidget) { return; }
|
||||
|
||||
// fix pixmaps
|
||||
@@ -841,7 +841,7 @@ namespace BlackGui
|
||||
this->addToContextMenu(contextMenu.data());
|
||||
|
||||
QAction *selectedItem = contextMenu.data()->exec(globalPos);
|
||||
Q_UNUSED(selectedItem);
|
||||
Q_UNUSED(selectedItem)
|
||||
}
|
||||
|
||||
void CInfoArea::showTabTexts(bool show)
|
||||
|
||||
Reference in New Issue
Block a user