mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-21 12:09:13 +08:00
Add scrollable area around text messages
CURA-9374
This commit is contained in:
parent
0432b76b4e
commit
a3d664571a
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user