ScrollableTextArea.qml 886 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright (c) 2019 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.10
  4. import QtQuick.Controls 2.3
  5. import UM 1.3 as UM
  6. import Cura 1.1 as Cura
  7. //
  8. // Cura-style TextArea with scrolls
  9. //
  10. ScrollView
  11. {
  12. property alias textArea: _textArea
  13. property var back_color: UM.Theme.getColor("main_background")
  14. property var do_borders: true
  15. clip: true
  16. background: Rectangle // Border
  17. {
  18. color: back_color
  19. border.color: UM.Theme.getColor("thick_lining")
  20. border.width: do_borders ? UM.Theme.getSize("default_lining").width : 0
  21. }
  22. TextArea
  23. {
  24. id: _textArea
  25. font: UM.Theme.getFont("default")
  26. color: UM.Theme.getColor("text")
  27. textFormat: TextEdit.PlainText
  28. renderType: Text.NativeRendering
  29. wrapMode: Text.Wrap
  30. selectByMouse: true
  31. }
  32. }