diff --git a/docs/builtin_elements.md b/docs/builtin_elements.md index 1634757a3..0d74c528b 100644 --- a/docs/builtin_elements.md +++ b/docs/builtin_elements.md @@ -576,22 +576,43 @@ FIXME: write docs ## `Flickable` -FIXME: write docs - The `Flickable` is a lower-level item that is the base for scrollable elements, such as the ScrollView widget. When the viewport-width or the viewport-height is greater than the parent width or parent height respectively the element becomes scrollable although the `Flickable` -does not create a scrollbar. When using a for loop to populate the -elements, the viewport-width and viewport-height are not automatically -calculated and scrolling will not work properly until the viewport-width -or viewport-height are set manually for the horizontal and vertical -scrolling respectively. The ability to automatically calculate the -viewport-width and viewport-height when using for loops may be added in -the future and is tracked in issue #407. - +does not create a scrollbar. The viewport-width and viewport-height are +calculated automatically except for when using a for loop to populate +the elements. In that case they are not automatically calculated. The +ability to automatically calculate the viewport-width and +viewport-height when using for loops may be added in the future and is +tracked in issue #407. When not part of a layout, its width or height defaults to 100% of the parent element when not specified. +### Properties + +* **`viewport-height`** (*length*): The total scrollable height +* **`viewport-width`** (*length*): The total scrollable width +* **`viewport-x: native_output`** (*length*): +* **`viewport-y: native_output`** (*length*): +* **`interactive: true (*bool*): + +### Example + +```60 +Example := Window { + width: 270px; + height: 100px; + + Flickable { + viewport-height: 300px; + Text { + y: 150px; + text: "This is some text that you have to scroll to see"; + } + } +} +``` + ## `TextInput` The `TextInput` is a lower-level item that shows text and allows entering text. @@ -824,4 +845,4 @@ depends on the role and the platform. * **`apply`**: This is the role of the "Apply" button * **`reset`**: This is the role of the "Reset" button * **`help`**: This is the role of the "Help" button -* **`action`**: This is the role of any other button that perform another action. \ No newline at end of file +* **`action`**: This is the role of any other button that perform another action. diff --git a/docs/widgets.md b/docs/widgets.md index de9ab55a0..d02454571 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -225,15 +225,14 @@ Example := Window { ## `ScrollView` -A Scrollview contains a viewport that is bigger than the view and can be scrolled. -It has scrollbar to interact with. -When using a for loop to populate the elements, the viewport-width and -viewport-height are not automatically calculated and scrolling will not -work properly until the viewport-width or viewport-height are set -manually for the horizontal and vertical scrolling respectively. -The ability to automatically calculate the viewport-width and -viewport-height when using for loops may be added in the future and is -tracked in issue #407. +A Scrollview contains a viewport that is bigger than the view and can be +scrolled. It has scrollbar to interact with. The viewport-width and +viewport-height are calculated automatically to create a scollable view +except for when using a for loop to populate the elements. In that case +the viewport-width and viewport-height are not calculated automatically +and must be set manually for scrolling to work. The ability to +automatically calculate the viewport-width and viewport-height when +using for loops may be added in the future and is tracked in issue #407. ### Properties