From ed0e4b4bacb1c5cc73fc1efb6a664e98cb1ccdf4 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Tue, 17 Oct 2023 17:43:43 +0100 Subject: [PATCH] Make ScrollBarCornerFiller Windows specific --- .../+windows/ScrollBarCornerFiller.qml | 43 +++++++++++++++++++ .../Shared/Controls/ScrollBarCornerFiller.qml | 20 +-------- source/shared/ui/shared.qrc | 1 + 3 files changed, 45 insertions(+), 19 deletions(-) create mode 100644 source/shared/ui/qml/app/graphia/Shared/Controls/+windows/ScrollBarCornerFiller.qml diff --git a/source/shared/ui/qml/app/graphia/Shared/Controls/+windows/ScrollBarCornerFiller.qml b/source/shared/ui/qml/app/graphia/Shared/Controls/+windows/ScrollBarCornerFiller.qml new file mode 100644 index 000000000..37dda5fbf --- /dev/null +++ b/source/shared/ui/qml/app/graphia/Shared/Controls/+windows/ScrollBarCornerFiller.qml @@ -0,0 +1,43 @@ +/* Copyright © 2013-2023 Graphia Technologies Ltd. + * + * This file is part of Graphia. + * + * Graphia is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graphia is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graphia. If not, see . + */ + +import QtQuick +import QtQuick.Controls + +Rectangle +{ + property ScrollBar horizontalScrollBar + property ScrollBar verticalScrollBar + + width: verticalScrollBar && verticalScrollBar.size < 1 ? verticalScrollBar.width : 0 + height: horizontalScrollBar && horizontalScrollBar.size < 1 ? horizontalScrollBar.height : 0 + + anchors.right: parent.right + anchors.bottom: parent.bottom + + color: + { + if(!horizontalScrollBar || !horizontalScrollBar.background) + return "transparent"; + + if(!verticalScrollBar || !verticalScrollBar.background) + return "transparent"; + + return palette.midlight; + } +} diff --git a/source/shared/ui/qml/app/graphia/Shared/Controls/ScrollBarCornerFiller.qml b/source/shared/ui/qml/app/graphia/Shared/Controls/ScrollBarCornerFiller.qml index 37dda5fbf..15f4380e0 100644 --- a/source/shared/ui/qml/app/graphia/Shared/Controls/ScrollBarCornerFiller.qml +++ b/source/shared/ui/qml/app/graphia/Shared/Controls/ScrollBarCornerFiller.qml @@ -17,27 +17,9 @@ */ import QtQuick -import QtQuick.Controls -Rectangle +Item { property ScrollBar horizontalScrollBar property ScrollBar verticalScrollBar - - width: verticalScrollBar && verticalScrollBar.size < 1 ? verticalScrollBar.width : 0 - height: horizontalScrollBar && horizontalScrollBar.size < 1 ? horizontalScrollBar.height : 0 - - anchors.right: parent.right - anchors.bottom: parent.bottom - - color: - { - if(!horizontalScrollBar || !horizontalScrollBar.background) - return "transparent"; - - if(!verticalScrollBar || !verticalScrollBar.background) - return "transparent"; - - return palette.midlight; - } } diff --git a/source/shared/ui/shared.qrc b/source/shared/ui/shared.qrc index 467821650..d1399dc67 100644 --- a/source/shared/ui/shared.qrc +++ b/source/shared/ui/shared.qrc @@ -21,6 +21,7 @@ qml/app/graphia/Shared/Controls/+nativemenu/PlatformMenuSeparator.qml qml/app/graphia/Shared/Controls/PointingCursorOnHoverLink.qml qml/app/graphia/Shared/Controls/SaveFileDialog.qml + qml/app/graphia/Shared/Controls/+windows/ScrollBarCornerFiller.qml qml/app/graphia/Shared/Controls/ScrollBarCornerFiller.qml qml/app/graphia/Shared/Controls/ScrollableTextArea.qml qml/app/graphia/Shared/Controls/SlidingPanel.qml