Commit graph

386 commits

Author SHA1 Message Date
Olivier Goffart
6e87385cb3 Style: Harmonize the in/out properties accross styles 2023-01-20 16:21:59 +01:00
Olivier Goffart
6e4b1b3468 Rename the std-widgets files of style base so they are not considered as a style
This is just so they don't appear in the error message, and also not
being tested by #2076 (https://github.com/slint-ui/slint/pull/2076#issuecomment-1385408167)
2023-01-17 16:21:53 +01:00
Florian Blasius
520df46998
Update examples to new syntax (#2067)
* run slint-updater on examples
* manual syntax updates
2023-01-16 12:11:25 +00:00
Florian Blasius
f2aab576f4
Add StandardTableView widget (#2032)
* Text only StandardTableView with column and rows
* Text editing of cells
* Sort by column ascending and descending
* Variants of the TableView for native, fluent and material
2023-01-12 19:41:12 +01:00
Olivier Goffart
7947d44e59 Run the syntax_updater on our widgets
This is commit is just the output of running the syntax updater on the
files in the internal/compiler/widgets directory.
No extra manual steps were done.

Note: In order to run the updater, I did a hack so that the updater wouldn't
choke on internal item used by the styles by commenting out the check in
ElementType::lookup_type_for_child_element
2023-01-11 10:52:48 +01:00
ogoffart
ce07d078ce Bump version number to 0.3.4 2022-12-16 09:36:15 +00:00
Simon Hausmann
6f19ab38e7 Use re-exports in the styles to simplify their code 2022-12-09 11:05:08 +01:00
Olivier Goffart
d468bbec05 ListView: Warn when we have other elements than just a for
This is not supported right now, the other elements will not be part of
the layout, and two `for` will be in the same listview, creating bad
situation with the scrollbar.

This is a warning since it would be a breaking change to make it an
error.

For example, we used a FocusScope in the StandardListView implementation so
I had to go trough one level of indirection

CC: #860
2022-11-30 11:17:22 +01:00
ogoffart
fb02b4118b Bump version number to 0.3.3 2022-11-28 13:11:11 +00:00
Simon Hausmann
885fcc1ac8 Express material design typographic tokens in relative-font-size
The spec at https://m3.material.io/styles/typography/type-scale-tokens defines
label-large, label-medium, etc.
relative to 16px.
2022-11-24 13:56:31 +01:00
Florian Blasius
0b66628fc4
md: add ripple effect (#1892)
* Add `StateLayer` component
* Add `Ripple` component (used by StateLayer)
* use `StateLayer` in material `Button`
* use `StateLayer` in material `Item`
2022-11-23 17:03:46 +01:00
Olivier Goffart
609b6d3a60
Use in/out/in-out in our styles 2022-11-23 13:41:28 +01:00
Simon Hausmann
883e3c472e Fix Material Design's choice of default font
* Apply the "Roboto" family by default to the Window.
* Don't use "Roboto XXX" as that is not the name that's encoded as family name in the TrueType fonts. The variants should be chose based on the weight, not the family name.
* Don't apply the font family in the MD's LineEdit - that should not be necessary anymore.
2022-11-22 20:20:53 +01:00
Simon Hausmann
fd64060b26
Fix placeholder text rendered on top of cursor when empty LineEdit is focused (#1888)
Render the placeholder underneath.
2022-11-22 17:51:41 +01:00
Florian Blasius
1e23f3c34f md: fix api of LineEdit 2022-11-17 11:42:30 +01:00
Florian Blasius
61c39b5fa1 Add support for dispatching key events through the public platform API
This change adds `KeyPress` and `KeyRelease` variants to the
`WindowEvent` enum, along with the new `slint::Key` enum, that allows
encoding keys.
2022-11-15 10:34:17 +01:00
Florian Blasius
575f093baf
Fixed: md TextEdit text not displayed (#1854) 2022-11-14 13:40:32 +01:00
Olivier Goffart
6ab6ae63d4 input output property: fix semantic with two ways bindings 2022-11-11 13:02:53 +01:00
Florian Blasius
15d9a2665b
Update background of material slider (#1841) 2022-11-11 11:43:24 +01:00
Florian Blasius
a3e1f9f246
Design refresh of the gallery example (#1820)
* Visual refresh of the gallery example
* Add new Navigation
* Improve layout
* Fix layout behavior of material GroupBox
2022-11-09 14:39:16 +01:00
Florian Blasius
7a01e3c0cb
md: adjust GroupBox, CheckBox and SpinBox (#1812)
Now it's also possible to toggle checked by click on the text of the CheckBox similar to fluent design

GroupBox now respect the minimum width of the title, to avoid elision

Adopt SpinBox: set focus when buttons are clicked #1795 on md SpinBox
2022-11-02 17:25:44 +01:00
Olivier Goffart
2ceafc6392 New syntax: Make it an error to set the value of a builtin output property
With the old syntax, this becomes a warning
2022-11-01 12:51:45 +01:00
Simon Hausmann
cecdb330f8 material design style: Replace remaining uses of pt with px
This is consistent with the use of `px` for the sizes and matches the expected
conversion to css pixels.
2022-10-31 21:12:52 +01:00
Florian Blasius
072d8fabcb
Add material, material-light and material-dark widgets (#1784)
Add material, material-light and material-dark widgets and make it available by the `env` `SLINT_STYLE`.
2022-10-31 14:54:50 +01:00
Tasuku Suzuki
6c4e4850f9 SpinBox: set focus when buttons are clicked 2022-10-29 09:19:55 +02:00
Simon Hausmann
ab1341878f
Make SlintInternal.dark-color-scheme a property instead of a function (#1790)
That's a more idiomatic API - the compiler can map the lookup straight
to a function call.
2022-10-28 14:20:20 +02:00
ogoffart
2171773a3e Bump version number to 0.3.2 2022-10-28 09:30:14 +00:00
Simon Hausmann
871a06224f Add support for fluent-light and fluent-dark styles
These variants of the fluent style will use either the light or the dark color scheme,
regardless of the system wide setting.
2022-10-26 13:30:09 +02:00
Florian Blasius
c58c704f16
Change type of Window background from color to brush (#1755) 2022-10-21 16:17:22 +02:00
Olivier Goffart
94a37c8e16 Move dark-color-sheme builtin in an internal namespace 2022-10-19 15:23:41 +02:00
Olivier Goffart
6ee932883a Rename stark-style to dark-color-scheme
That's the term used by CSS
2022-10-19 15:23:41 +02:00
Olivier Goffart
0ba468c236 Use a builtin function to access the dark-style
instead of a property on NativeStyleMetrics
2022-10-19 15:23:41 +02:00
Simon Hausmann
77441c6686 Fix AboutSlint not adjusting to the dark style
The dark-style property needs to be kept up-to-date with the NativeStyle, like the Palette.
2022-10-18 15:54:57 +02:00
Simon Hausmann
75487f0a9d Add a dark theme for the fluent style
This is computed via the fluent theme designer by swapping text and background.
2022-10-18 15:54:57 +02:00
Simon Hausmann
8cba0622f5 Initial input method support for the winit backend and the FemtoVG/Skia renderers
Known caveats:

- winit doesn't forward mouse events to the IME, so clicking
  with the mouse while composing results in funny effects such
  as the pre-edit text following the cursor.
- With FemtoVG there's no text decoration support, thus no underlining
  of the preedit area.
2022-10-07 11:16:36 +02:00
ogoffart
261614b914 Bump version number to 0.3.1 2022-09-15 14:39:51 +02:00
ogoffart
05a49da906 Bump version number to 0.3.0 2022-09-06 13:00:22 +02:00
Olivier Goffart
f6a3e741cf Fix the AboutSlint in fluent style with dark style desktop
The widget should not reach into the NativeStyleMetrics directly,
it should get the information from the StyleMetrics which return
the right value (which is not dark style, for the fluent style)
2022-07-22 12:23:36 +02:00
Simon Hausmann
a23a941cf5 Fix slint compiler warning about two-way bindings and missing default 2022-07-08 19:07:20 +02:00
Tobias Hunger
20c1c45253
Button: Implement support to make the Button a toggle (#1384)
Add flags that enable the Button to be used as a Toggle, e.g. for use in toolbars or similar places.

Co-authored-by: Simon Hausmann <hausmann@gmail.com>
2022-07-08 16:17:06 +02:00
ogoffart
6b15d2e479 Bump version number to 0.2.6 2022-07-06 09:58:14 +00:00
Olivier Goffart
a2484cfc64 fluent TabWidget: ensure the minimum width is the one of the tabbar
This is what the native style does

Fixes #1363
2022-06-27 10:07:54 +02:00
Tobias Hunger
07ad20a09c
Basic Slint accessibility support (#1294)
Implement basic accessibility (a11y) support, using the Qt backend.

_This should get us started, but accessibility support is an additional way to interact with UIs that is very different from the "graphical way" most users will interact with the UI. No single PR will "make a toolkit accessibility", this needs to be an ongoing effort!_

Parts of this PR:

* Add functions to access a11y-related properties to Component
* Add helper functions to Item struct 
* Handle accessible- properties in the compiler
* Add documentation, add description, enforce some basic rules
* Make the Text element accessible by default
* Don't optimize away accessibility property in the LLR
* Ensure that accessibility property are marked as used
* Add some accessibility properties to the native style widgets
* Support for bool and integer `accessible` properties
* Implement basic support for accessibility
* Make basic widgets accessible by default
* Make slider focus-able and interactable with keyboard
* Tell a11y layer about value changes
* Generate QAccessible constants using bindgen
* Don't expose the `accessible` properties when using the MCU backend: There is no backend to make use of them
* Handle focus change based on keyboard focus of the window
* Report accessible widgets at correct positions
* Allow for (virtual) focus delegation at the a11y level
* Calculate value step size dynamically
* Make sure to not send notifications to a11y backend about dead objects
2022-06-08 20:42:10 +02:00
pubg-hacks
aed71311ca Add a read-only propery to TextInput, LineEdit and TextEdit 2022-06-08 09:23:01 +02:00
Florian Fetz
d824eef2c5 ScrollBar background is now Palette.white 2022-05-15 14:42:09 +02:00
ogoffart
3709ded44d Bump version number to 0.2.5 2022-05-09 16:16:00 +00:00
ogoffart
c160ec2aef Bump version number to 0.2.4 2022-05-09 13:49:25 +00:00
ogoffart
6395cdfc09 Bump version number to 0.2.3 2022-05-04 12:32:58 +00:00
Olivier Goffart
8a4d6a34ba Revert #1049
This breaks the printer demo USB page, it makes it impossible to
change the current item.
That's because the printer demo do `current-item: 1;` to preselect the cat.
But that breaks the property binding that makes current-item follow the
actual-current-item.

 * Revert "move actual-current-item to FocusScope"
   This reverts commit 8240531e6e.

 * Revert "reset StandardListView's current-item if it is out of bounds"
   This reverts commit 9d18882f9d.
2022-05-02 14:13:37 +02:00
Olivier Goffart
9fe4992a23 StandardListView: restore behavior to get focus on click
In previous versions of Slint, the StandardListView gets the focus
on click so we can move the selected items with the up and down arrow
2022-04-22 12:49:46 +02:00