Minor code move, so next diff is short

This commit is contained in:
Sergio Martins
2020-09-13 12:48:25 +01:00
parent 85b533d4c4
commit a2054359a2

View File

@@ -73,6 +73,17 @@ public:
}
#endif
static Qt::WindowFlags windowFlagsToUse()
{
if (KDDockWidgets::usesNativeDraggingAndResizing())
return Qt::Window;
if (Config::self().flags() & Config::Flag_DontUseUtilityWindowsForFloating)
return Qt::Window;
return Qt::Tool;
}
static MainWindowBase* hackFindParentHarder(Frame *frame, MainWindowBase *candidateParent)
{
// TODO: Using a parent helps the floating windows stay in front of the main window always.
@@ -103,17 +114,6 @@ static MainWindowBase* hackFindParentHarder(Frame *frame, MainWindowBase *candid
}
}
static Qt::WindowFlags windowFlagsToUse()
{
if (KDDockWidgets::usesNativeDraggingAndResizing())
return Qt::Window;
if (Config::self().flags() & Config::Flag_DontUseUtilityWindowsForFloating)
return Qt::Window;
return Qt::Tool;
}
FloatingWindow::FloatingWindow(MainWindowBase *parent)
: QWidgetAdapter(parent, windowFlagsToUse())
, Draggable(this, KDDockWidgets::usesNativeDraggingAndResizing()) // FloatingWindow is only draggable when using a native title bar. Otherwise the KDDockWidgets::TitleBar is the draggable