KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
flutter/views/ClassicIndicatorsWindow.cpp
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2019 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6
7 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8
9 Contact KDAB at <info@kdab.com> for commercial licensing options.
10*/
11
13#include "kddockwidgets/core/indicators/ClassicDropIndicatorOverlay.h"
14#include "kddockwidgets/core/Group.h"
15#include "View.h"
16#include "core/Utils_p.h"
17#include "core/Logging_p.h"
18#include "core/View_p.h"
19#include "flutter/Platform.h"
20
21using namespace KDDockWidgets;
22using namespace KDDockWidgets::Core;
23using namespace KDDockWidgets::flutter;
24
26 : flutter::View(controller, ViewType::DropAreaIndicatorOverlay, parent)
27 , classicIndicators(controller)
28{
30}
31
36
41
43{
44 if (!isMounted())
45 return DropLocation_None;
46
47 if (m_updatePending)
49
50 const Point localPos = mapFromGlobal(globalPos);
51 return hover_flutter(localPos);
52}
53
55{
56 auto sz = size();
57 const bool updated = updatePositions_flutter(sz.width(), sz.height(),
58 classicIndicators->hoveredGroup(), visibleDropIndicatorLocations());
59 m_updatePending = !updated;
60}
61
63{
64 // Nothing to do for flutter, it's raised
65}
66
71
73{
74 // Not needed for flutter
75}
76
85
90
92{
93 return true;
94}
95
97{
98 return classicIndicators->hoveredGroup();
99}
100
102{
103 KDDW_WARN("IndicatorWindow::posForIndicator_flutter: Implemented in dart instead");
104 return {};
105}
106
108{
109 KDDW_WARN("IndicatorWindow::hover_flutter: Implemented in dart instead");
110 return {};
111}
112
114{
115 KDDW_WARN("IndicatorWindow::updatePositions_flutter: Implemented in dart instead");
116 return false;
117}
118
120{
121 return classicIndicators->rubberBand();
122}
123
124int IndicatorWindow::visibleDropIndicatorLocations() const
125{
126 int result = 0;
127
128 for (auto loc : { DropLocation_Left,
137 if (classicIndicators->dropIndicatorVisible(loc))
138 result |= loc;
139 }
140
141 return result;
142}
virtual bool dropIndicatorVisible(DropLocation) const
Returns whether the specified drop indicator should be visible.
virtual bool is(ViewType) const
Returns whether the view is of the specified type Virtual so it can be overridden by ViewWrapper....
virtual Point posForIndicator_flutter(DropLocation) const
implemented in dart. workaround for multi-inheritance binding limitations
IndicatorWindow(Core::ClassicDropIndicatorOverlay *, Core::View *parent)
When we have proper multi-window support in flutter, we can remove the parent.
virtual bool updatePositions_flutter(int overlayWidth, int overlayHeight, Core::Group *hoveredGroup, int visibleLocations)
virtual void onDropIndicatorOverlayDestroyed(flutter::IndicatorWindow *)
virtual void onDropIndicatorOverlayCreated(flutter::IndicatorWindow *)
Point mapFromGlobal(Point globalPt) const override
void setVisible(bool visible) override
void setGeometry(Rect geometry) override
ViewType
Each View type also has a specific Controller associated with, except for ViewType::None.
Definition Controller.h:26
Class to abstract QAction, so code still works with QtQuick and Flutter.
DropLocation
Enum describing the different drop indicator types.

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8