| | |
| | | #include "quickwindowagent.h" |
| | | #include "quickwindowagent_p.h" |
| | | |
| | | #include "quickitemdelegate_p.h" |
| | | |
| | | #include <QtQuick/QQuickWindow> |
| | | #include <QtQuick/private/qquickanchors_p.h> |
| | | |
| | | #include "quickitemdelegate_p.h" |
| | | |
| | | namespace QWK { |
| | | |
| | | QuickWindowAgentPrivate::QuickWindowAgentPrivate() { |
| | | } |
| | | QuickWindowAgentPrivate::QuickWindowAgentPrivate() = default; |
| | | |
| | | QuickWindowAgentPrivate::~QuickWindowAgentPrivate() { |
| | | } |
| | | QuickWindowAgentPrivate::~QuickWindowAgentPrivate() = default; |
| | | |
| | | void QuickWindowAgentPrivate::init() { |
| | | } |
| | |
| | | : QuickWindowAgent(*new QuickWindowAgentPrivate(), parent) { |
| | | } |
| | | |
| | | QuickWindowAgent::~QuickWindowAgent() { |
| | | } |
| | | QuickWindowAgent::~QuickWindowAgent() = default; |
| | | |
| | | bool QuickWindowAgent::setup(QQuickWindow *window) { |
| | | Q_ASSERT(window); |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (!d->setup(window, new QuickItemDelegate())) { |
| | | return true; |
| | | } |
| | | d->setup(window, new QuickItemDelegate()); |
| | | d->hostWindow = window; |
| | | |
| | | #ifdef Q_OS_WINDOWS |
| | | d->setupWindows10BorderWorkaround(); |
| | | #endif |
| | | return true; |
| | | } |
| | | |
| | | const QQuickItem *QuickWindowAgent::titleBar() const { |
| | | QQuickItem *QuickWindowAgent::titleBar() const { |
| | | Q_D(const QuickWindowAgent); |
| | | return static_cast<const QQuickItem *>(d->context->titleBar()); |
| | | return static_cast<QQuickItem *>(d->context->titleBar()); |
| | | } |
| | | |
| | | void QuickWindowAgent::setTitleBar(const QQuickItem *item) { |
| | | void QuickWindowAgent::setTitleBar(QQuickItem *item) { |
| | | Q_D(QuickWindowAgent); |
| | | if (!d->context->setTitleBar(item)) { |
| | | return; |
| | |
| | | Q_EMIT titleBarWidgetChanged(item); |
| | | } |
| | | |
| | | const QQuickItem *QuickWindowAgent::systemButton(SystemButton button) const { |
| | | QQuickItem *QuickWindowAgent::systemButton(SystemButton button) const { |
| | | Q_D(const QuickWindowAgent); |
| | | return static_cast<const QQuickItem *>(d->context->systemButton(button)); |
| | | return static_cast<QQuickItem *>(d->context->systemButton(button)); |
| | | } |
| | | |
| | | void QuickWindowAgent::setSystemButton(SystemButton button, const QQuickItem *item) { |
| | | void QuickWindowAgent::setSystemButton(SystemButton button, QQuickItem *item) { |
| | | Q_D(QuickWindowAgent); |
| | | if (!d->context->setSystemButton(button, item)) { |
| | | return; |
| | |
| | | d->context->setHitTestVisible(item, visible); |
| | | } |
| | | |
| | | void QuickWindowAgent::setHitTestVisible(const QRect &rect, bool visible) { |
| | | Q_D(QuickWindowAgent); |
| | | d->context->setHitTestVisible(rect, visible); |
| | | } |
| | | |
| | | QuickWindowAgent::QuickWindowAgent(QuickWindowAgentPrivate &d, QObject *parent) |
| | | : CoreWindowAgent(d, parent) { |
| | | : WindowAgentBase(d, parent) { |
| | | d.init(); |
| | | } |
| | | } |
| | | |
| | | } |