qtquick: Implement the rubber band
When hovering a drop indicator we now see the blue rubberband
This commit is contained in:
@@ -92,6 +92,7 @@ if(${PROJECT_NAME}_QTQUICK)
|
||||
private/quick/TitleBarQuick.cpp
|
||||
private/quick/QmlTypes.cpp
|
||||
private/quick/FrameQuick.cpp
|
||||
private/quick/RubberBandQuick.cpp
|
||||
private/quick/MainWindowQuick.cpp
|
||||
private/quick/MainWindowWrapper.cpp
|
||||
)
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
# include "quick/FrameQuick_p.h"
|
||||
# include "quick/TitleBarQuick_p.h"
|
||||
# include "quick/FloatingWindowQuick_p.h"
|
||||
# include "quick/RubberBandQuick.h"
|
||||
# include "multisplitter/Separator_quick.h"
|
||||
#endif
|
||||
|
||||
@@ -199,7 +200,7 @@ Layouting::Separator *DefaultWidgetFactory::createSeparator(Layouting::Widget *p
|
||||
|
||||
QWidgetOrQuick *DefaultWidgetFactory::createRubberBand(QWidgetOrQuick *parent) const
|
||||
{
|
||||
return new QWidgetOrQuick(parent);
|
||||
return new RubberBandQuick(parent);
|
||||
}
|
||||
|
||||
SideBar *DefaultWidgetFactory::createSideBar(SideBarLocation loc, MainWindowBase *parent) const
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<file>private/quick/qml/DropArea.qml</file>
|
||||
<file>private/quick/qml/FloatingWindow.qml</file>
|
||||
<file>private/quick/qml/Frame.qml</file>
|
||||
<file>private/quick/qml/RubberBand.qml</file>
|
||||
<file>private/quick/qml/TitleBarBase.qml</file>
|
||||
<file>private/quick/qml/TitleBar.qml</file>
|
||||
<file>private/quick/qml/TitleBarButton.qml</file>
|
||||
|
||||
25
src/private/quick/RubberBandQuick.cpp
Normal file
25
src/private/quick/RubberBandQuick.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
*/
|
||||
|
||||
#include "RubberBandQuick.h"
|
||||
#include "Config.h"
|
||||
|
||||
using namespace KDDockWidgets;
|
||||
|
||||
RubberBandQuick::RubberBandQuick(QQuickItem *parent)
|
||||
: QWidgetAdapter(parent)
|
||||
{
|
||||
setVisible(false);
|
||||
setZ(1000);
|
||||
QQuickItem *visualItem = createItem(Config::self().qmlEngine(), QStringLiteral("qrc:/kddockwidgets/private/quick/qml/RubberBand.qml"));
|
||||
visualItem->setParent(this);
|
||||
visualItem->setParentItem(this);
|
||||
}
|
||||
29
src/private/quick/RubberBandQuick.h
Normal file
29
src/private/quick/RubberBandQuick.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
*/
|
||||
|
||||
#ifndef KDDOCKWIDGETS_RUBBERBAND_H
|
||||
#define KDDOCKWIDGETS_RUBBERBAND_H
|
||||
|
||||
#include "QWidgetAdapter.h"
|
||||
|
||||
namespace KDDockWidgets
|
||||
{
|
||||
|
||||
class RubberBandQuick : public QWidgetAdapter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit RubberBandQuick(QQuickItem *parent = nullptr);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
25
src/private/quick/qml/RubberBand.qml
Normal file
25
src/private/quick/qml/RubberBand.qml
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
*/
|
||||
|
||||
import QtQuick 2.9
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
color: "#555ca1c5"
|
||||
|
||||
radius: 1
|
||||
border {
|
||||
color: "#5ca1c5"
|
||||
width: 1
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
}
|
||||
Reference in New Issue
Block a user