From a3d664571a847c510bf2557614b12a5782d1697b Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 18 Aug 2023 14:45:02 +0200 Subject: [PATCH] Add scrollable area around text messages CURA-9374 --- .../resources/qml/LicenseDialog.qml | 4 +- .../resources/qml/MultipleLicenseDialog.qml | 4 +- plugins/SliceInfoPlugin/MoreInfoWindow.qml | 4 +- .../qml/WelcomePages/ChangelogContent.qml | 4 +- .../qml/WelcomePages/WhatsNewContent.qml | 4 +- resources/qml/Widgets/ScrollableTextArea.qml | 44 ------------------- 6 files changed, 10 insertions(+), 54 deletions(-) delete mode 100644 resources/qml/Widgets/ScrollableTextArea.qml diff --git a/plugins/Marketplace/resources/qml/LicenseDialog.qml b/plugins/Marketplace/resources/qml/LicenseDialog.qml index 5dd8ac6fc41..849df5925e8 100644 --- a/plugins/Marketplace/resources/qml/LicenseDialog.qml +++ b/plugins/Marketplace/resources/qml/LicenseDialog.qml @@ -6,7 +6,7 @@ import QtQuick.Window 2.2 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.6 as UM +import UM 1.7 as UM import Cura 1.6 as Cura UM.Dialog @@ -52,7 +52,7 @@ UM.Dialog } } - Cura.ScrollableTextArea + UM.ScrollableTextArea { Layout.fillWidth: true Layout.fillHeight: true diff --git a/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml b/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml index a3d4b60221d..c92709e954e 100644 --- a/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml +++ b/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml @@ -6,7 +6,7 @@ import QtQuick.Window 2.2 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.5 as UM +import UM 1.7 as UM import Cura 1.6 as Cura UM.Dialog @@ -66,7 +66,7 @@ UM.Dialog } } - Cura.ScrollableTextArea + UM.ScrollableTextArea { Layout.fillWidth: true Layout.fillHeight: true diff --git a/plugins/SliceInfoPlugin/MoreInfoWindow.qml b/plugins/SliceInfoPlugin/MoreInfoWindow.qml index e0954dc55e1..3debd8e707b 100644 --- a/plugins/SliceInfoPlugin/MoreInfoWindow.qml +++ b/plugins/SliceInfoPlugin/MoreInfoWindow.qml @@ -5,7 +5,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Window 2.2 -import UM 1.5 as UM +import UM 1.7 as UM import Cura 1.1 as Cura Window @@ -74,7 +74,7 @@ Window wrapMode: Text.WordWrap } - Cura.ScrollableTextArea + UM.ScrollableTextArea { anchors { diff --git a/resources/qml/WelcomePages/ChangelogContent.qml b/resources/qml/WelcomePages/ChangelogContent.qml index 7c3b1adfc31..20380f39389 100644 --- a/resources/qml/WelcomePages/ChangelogContent.qml +++ b/resources/qml/WelcomePages/ChangelogContent.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.5 as UM +import UM 1.7 as UM import Cura 1.1 as Cura @@ -26,7 +26,7 @@ Item font: UM.Theme.getFont("huge") } - Cura.ScrollableTextArea + UM.ScrollableTextArea { id: changelogTextArea diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index 6406d657562..eefadbdacf9 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -5,7 +5,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.5 as UM +import UM 1.7 as UM import Cura 1.1 as Cura @@ -90,7 +90,7 @@ Item source: manager.getSubpageImageSource(index) } - Cura.ScrollableTextArea + UM.ScrollableTextArea { id: subpageText diff --git a/resources/qml/Widgets/ScrollableTextArea.qml b/resources/qml/Widgets/ScrollableTextArea.qml deleted file mode 100644 index 7d8f6b886de..00000000000 --- a/resources/qml/Widgets/ScrollableTextArea.qml +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2022 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.10 -import QtQuick.Controls 2.3 - -import UM 1.5 as UM -import Cura 1.1 as Cura - - -// -// Cura-style TextArea with scrolls -// -Flickable -{ - id: scrollableTextAreaBase - property bool do_borders: true - property var back_color: UM.Theme.getColor("main_background") - property alias textArea: flickableTextArea - - ScrollBar.vertical: UM.ScrollBar {} - - TextArea.flickable: TextArea - { - id: flickableTextArea - - background: Rectangle //Providing the background color and border. - { - anchors.fill: parent - anchors.margins: -border.width - - color: scrollableTextAreaBase.back_color - border.color: UM.Theme.getColor("thick_lining") - border.width: scrollableTextAreaBase.do_borders ? UM.Theme.getSize("default_lining").width : 0 - } - - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - textFormat: TextEdit.PlainText - renderType: Text.NativeRendering - wrapMode: Text.Wrap - selectByMouse: true - } -} \ No newline at end of file