changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > demo / src/crates/ui/pages/text_edit.slint

changeset 22: ba323d8c0f93
parent: ui/pages/text_edit.slint@e4c9ec452eb6
author: ellis <ellis@rwest.io>
date: Sat, 03 Jun 2023 22:48:46 -0400
permissions: -rw-r--r--
description: refactor1
1 import { HorizontalBox, GroupBox, TextEdit } from "std-widgets.slint";
2 import { UiConfig } from "../config.slint";
3 import { Page } from "page.slint";
4 
5 export component TextEditPage inherits Page {
6  title: "TextEdit";
7  description: "Similar to LineEdit, but can be used to enter several lines of text. The widget can be imported from \"std-widgets.slint\".";
8 
9  HorizontalBox {
10  GroupBox {
11  vertical-stretch: 0;
12  title: "Word-Wrap";
13  te1 := TextEdit {
14  min-width: 200px;
15  text: "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.";
16  wrap: word-wrap;
17  enabled: !UiConfig.widgets-disabled;
18  }
19  }
20 
21  GroupBox {
22  title: "No-Wrap";
23  vertical-stretch: 0;
24  te2 := TextEdit {
25  min-width: 200px;
26  text <=> te1.text;
27  wrap: no-wrap;
28  enabled: !UiConfig.widgets-disabled;
29  }
30  }
31  }
32 }