| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: MIT |
| 3 | |
| 4 | import { HorizontalBox, GroupBox, TextEdit } from "std-widgets.slint" ; |
| 5 | import { GallerySettings } from "../gallery_settings.slint" ; |
| 6 | import { Page } from "page.slint" ; |
| 7 | |
| 8 | export component TextEditPage inherits Page { |
| 9 | title: @tr("TextEdit" ); |
| 10 | description: @tr("Similar to LineEdit, but can be used to enter several lines of text. The widget can be imported from \"std-widgets.slint\"." ); |
| 11 | |
| 12 | HorizontalBox { |
| 13 | GroupBox { |
| 14 | title: @tr("Word-Wrap" ); |
| 15 | |
| 16 | te1 := TextEdit { |
| 17 | // min-width: 200px; |
| 18 | text: @tr("This is our TextEdit widget, which allows for editing text that spans over multiple paragraphs.\nFor example this line starts in a new paragraph.\n\nWhen the amount of lines - due to wrapping and number of paragraphs - exceeds the available vertical height, a vertical scrollbar is shown that allows scrolling.\nYou may want to enter a bit of text here then in order to make them visible." ); |
| 19 | placeholder-text: @tr("Add some text" ); |
| 20 | wrap: word-wrap; |
| 21 | enabled: GallerySettings.widgets-enabled; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | GroupBox { |
| 26 | title: @tr("No-Wrap" ); |
| 27 | te2 := TextEdit { |
| 28 | // min-width: 200px; |
| 29 | text <=> te1.text; |
| 30 | wrap: no-wrap; |
| 31 | enabled: GallerySettings.widgets-enabled; |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |