From a3d664571a847c510bf2557614b12a5782d1697b Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 18 Aug 2023 14:45:02 +0200 Subject: [PATCH 1/3] 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 5dd8ac6fc4..849df5925e 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 a3d4b60221..c92709e954 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 e0954dc55e..3debd8e707 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 7c3b1adfc3..20380f3938 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 6406d65756..eefadbdacf 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 7d8f6b886d..0000000000 --- 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 From 0c405288e010ac341f4ce9965d0f9dd4ebe79535 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 21 Aug 2023 15:50:52 +0200 Subject: [PATCH 2/3] Add wrapper to Cura.ScrollableTextArea Add wrapper to legacy Cura.ScrollableTextArea class which has now moved to Uranium, in order to keep plugins working in case they use it. CURA-9374 --- .../Marketplace/resources/qml/LicenseDialog.qml | 2 +- .../resources/qml/MultipleLicenseDialog.qml | 2 +- plugins/SliceInfoPlugin/MoreInfoWindow.qml | 2 +- resources/qml/WelcomePages/ChangelogContent.qml | 2 +- resources/qml/WelcomePages/WhatsNewContent.qml | 2 +- resources/qml/Widgets/ScrollableTextArea.qml | 14 ++++++++++++++ 6 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 resources/qml/Widgets/ScrollableTextArea.qml diff --git a/plugins/Marketplace/resources/qml/LicenseDialog.qml b/plugins/Marketplace/resources/qml/LicenseDialog.qml index 849df5925e..775e53f7aa 100644 --- a/plugins/Marketplace/resources/qml/LicenseDialog.qml +++ b/plugins/Marketplace/resources/qml/LicenseDialog.qml @@ -52,7 +52,7 @@ UM.Dialog } } - UM.ScrollableTextArea + Cura.ScrollableTextArea { Layout.fillWidth: true Layout.fillHeight: true diff --git a/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml b/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml index c92709e954..b251aeab85 100644 --- a/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml +++ b/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml @@ -66,7 +66,7 @@ UM.Dialog } } - UM.ScrollableTextArea + Cura.ScrollableTextArea { Layout.fillWidth: true Layout.fillHeight: true diff --git a/plugins/SliceInfoPlugin/MoreInfoWindow.qml b/plugins/SliceInfoPlugin/MoreInfoWindow.qml index 3debd8e707..76b9e651c7 100644 --- a/plugins/SliceInfoPlugin/MoreInfoWindow.qml +++ b/plugins/SliceInfoPlugin/MoreInfoWindow.qml @@ -74,7 +74,7 @@ Window wrapMode: Text.WordWrap } - UM.ScrollableTextArea + Cura.ScrollableTextArea { anchors { diff --git a/resources/qml/WelcomePages/ChangelogContent.qml b/resources/qml/WelcomePages/ChangelogContent.qml index 20380f3938..9be3c30373 100644 --- a/resources/qml/WelcomePages/ChangelogContent.qml +++ b/resources/qml/WelcomePages/ChangelogContent.qml @@ -26,7 +26,7 @@ Item font: UM.Theme.getFont("huge") } - UM.ScrollableTextArea + Cura.ScrollableTextArea { id: changelogTextArea diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index eefadbdacf..787b280095 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -90,7 +90,7 @@ Item source: manager.getSubpageImageSource(index) } - UM.ScrollableTextArea + Cura.ScrollableTextArea { id: subpageText diff --git a/resources/qml/Widgets/ScrollableTextArea.qml b/resources/qml/Widgets/ScrollableTextArea.qml new file mode 100644 index 0000000000..3f0db28058 --- /dev/null +++ b/resources/qml/Widgets/ScrollableTextArea.qml @@ -0,0 +1,14 @@ +// 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.7 as UM +import Cura 1.1 as Cura + + +// Wrapper to UM.ScrollableTextArea which was originally placed here +UM.ScrollableTextArea +{ +} From 89cb69a376faf93b880d88a33f833cc7dbb4a8c2 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 21 Aug 2023 15:57:36 +0200 Subject: [PATCH 3/3] Restored QML import versions Restore versions to minimize the impact of CURA-9374 --- plugins/Marketplace/resources/qml/LicenseDialog.qml | 2 +- plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml | 2 +- plugins/SliceInfoPlugin/MoreInfoWindow.qml | 2 +- resources/qml/WelcomePages/ChangelogContent.qml | 2 +- resources/qml/WelcomePages/WhatsNewContent.qml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/Marketplace/resources/qml/LicenseDialog.qml b/plugins/Marketplace/resources/qml/LicenseDialog.qml index 775e53f7aa..5dd8ac6fc4 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.7 as UM +import UM 1.6 as UM import Cura 1.6 as Cura UM.Dialog diff --git a/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml b/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml index b251aeab85..a3d4b60221 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.7 as UM +import UM 1.5 as UM import Cura 1.6 as Cura UM.Dialog diff --git a/plugins/SliceInfoPlugin/MoreInfoWindow.qml b/plugins/SliceInfoPlugin/MoreInfoWindow.qml index 76b9e651c7..e0954dc55e 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.7 as UM +import UM 1.5 as UM import Cura 1.1 as Cura Window diff --git a/resources/qml/WelcomePages/ChangelogContent.qml b/resources/qml/WelcomePages/ChangelogContent.qml index 9be3c30373..7c3b1adfc3 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.7 as UM +import UM 1.5 as UM import Cura 1.1 as Cura diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index 787b280095..6406d65756 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.7 as UM +import UM 1.5 as UM import Cura 1.1 as Cura