Changed initial position of floating widgets

This commit is contained in:
Uwe Kindler 2019-11-28 13:35:58 +01:00
parent a1de28c969
commit 3332f6050e
3 changed files with 10 additions and 3 deletions

View File

@ -232,8 +232,9 @@ void MainWindowPrivate::createContent()
// Test creation of floating dock widgets // Test creation of floating dock widgets
DockWidget = createFileSystemTreeDockWidget(ViewMenu); DockWidget = createFileSystemTreeDockWidget(ViewMenu);
auto FloatingWidget = DockManager->addDockWidgetFloating(DockWidget); auto FloatingWidget = DockManager->addDockWidgetFloating(DockWidget);
FloatingWidget->move(QPoint(0,0)); FloatingWidget->move(QPoint(0, 0));
FloatingWidget = DockManager->addDockWidgetFloating(createLongTextLabelDockWidget(ViewMenu)); FloatingWidget = DockManager->addDockWidgetFloating(createLongTextLabelDockWidget(ViewMenu));
FloatingWidget->move(QPoint(100, 100));
auto Action = ui.menuView->addAction(QString("Set %1 floating").arg(DockWidget->windowTitle())); auto Action = ui.menuView->addAction(QString("Set %1 floating").arg(DockWidget->windowTitle()));
DockWidget->connect(Action, SIGNAL(triggered()), SLOT(setFloating())); DockWidget->connect(Action, SIGNAL(triggered()), SLOT(setFloating()));
@ -326,7 +327,7 @@ CMainWindow::CMainWindow(QWidget *parent) :
// uncomment the follwing line if you want to use non opaque undocking and splitter // uncomment the follwing line if you want to use non opaque undocking and splitter
// moevements // moevements
//CDockManager::setConfigFlags(CDockManager::DefaultNonOpaqueConfig); CDockManager::setConfigFlags(CDockManager::DefaultNonOpaqueConfig);
// Now create the dock manager and its content // Now create the dock manager and its content
d->DockManager = new CDockManager(this); d->DockManager = new CDockManager(this);

View File

@ -509,7 +509,7 @@ void CFloatingDockContainer::startFloating(const QPoint &DragStartMousePos,
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
if (DraggingFloatingWidget == DragState) if (DraggingFloatingWidget == DragState)
{ {
setAttribute(Qt::WA_X11NetWmWindowTypeDock, true); setAttribute(Qt::WA_X11NetWmWindowTypeDock, true);
d->MouseEventHandler = MouseEventHandler; d->MouseEventHandler = MouseEventHandler;
if (d->MouseEventHandler) if (d->MouseEventHandler)
{ {

View File

@ -177,6 +177,12 @@ CFloatingOverlay::CFloatingOverlay(QWidget* Content, QWidget* parent) :
setAttribute(Qt::WA_TranslucentBackground); setAttribute(Qt::WA_TranslucentBackground);
} }
#ifdef Q_OS_LINUX
auto Flags = windowFlags();
Flags |= Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint;
setWindowFlags(Flags);
#endif
setWindowOpacity(0.6); setWindowOpacity(0.6);
// We install an event filter to detect mouse release events because we // We install an event filter to detect mouse release events because we
// do not receive mouse release event if the floating widget is behind // do not receive mouse release event if the floating widget is behind