Commit graph

42 commits

Author SHA1 Message Date
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
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
Simon Hausmann
6f19ab38e7 Use re-exports in the styles to simplify their code 2022-12-09 11:05:08 +01: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
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
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
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
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
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
Tobias Hunger
7ac4231150 Focus: Do not send keyboard event to invisible widgets
Do not send keyboard events to invisible widgets, reset the keyboard
focus instead.

That fixes #798 again with a bit less of a work-around. To properly fix
this we will need to make the tab widget (and probably others) more
intelligent though.
2022-04-21 12:37:32 +02:00
Tobias Hunger
09f9dbe371 Do not set focus on click for most FocusScopes 2022-04-20 17:07:02 +02:00
Tobias Hunger
2c82fd7618 Tab: Make tab accept keyboard 2022-04-13 14:42:32 +02:00
Tobias Hunger
c825eee228 janitor: Update global cspell
Update global cspell words and remove some file-wide words.

Also remove a manual test that is now also run as a proper test case.
2022-04-12 12:03:45 +02:00
Tobias Hunger
a50d1e7d02 fluent: Make ComboBox accept keyboard input 2022-04-12 10:48:09 +02:00
Tobias Hunger
f883b45a4b Make fluent CheckBox accept keyboard actions 2022-04-12 10:48:09 +02:00
Tobias Hunger
b33c407878 Make fluent Button accept keyboard focus 2022-04-12 10:48:09 +02:00
Tobias Hunger
73e178a840 Add enabled property to FocusScope 2022-04-12 10:48:09 +02:00
Tobias Hunger
a639cc5acb fluent: Make checkmark in Combobox look slimmer 2022-04-07 13:48:01 +02:00
Tobias Hunger
6795564414 fluent: Make ComboBox dropdown icon thinner
This is closer to the original.
2022-04-07 13:48:01 +02:00
Tobias Hunger
24d325a53b Do not eat all keypresses in SpinBox 2022-03-22 18:34:05 +01:00
Lukas Jung
8240531e6e move actual-current-item to FocusScope 2022-03-16 08:48:30 +01:00
Lukas Jung
9d18882f9d reset StandardListView's current-item if it is out of bounds 2022-03-16 08:48:30 +01:00
Olivier Goffart
c9319add6a Export the input-type from the LineEdit 2022-03-02 21:55:49 +01:00
Lukas Jung
103b069dde implement keyboard control for fluent widget 2022-03-02 17:51:31 +01:00
Olivier Goffart
9a6c306017 We can now access the global from other globals 2022-02-28 10:14:34 +01:00
Tobias Hunger
4230ac2572
Update copyright information to reflect name change
Also run resue over the codebase and fix complaints from that tool.
2022-02-09 10:27:47 +01:00
Olivier Goffart
2f420a4676 Re-export AboutSlint as AboutSixtyFPS 2022-02-02 16:40:06 +01:00
Tobias Hunger
2b55c488ca
Rename sixtyfps to slint in internal 2022-02-02 16:16:55 +01:00
Olivier Goffart
d706d63ce1 Replace references to the .60 files that are now renamed with .slint 2022-02-02 10:12:31 +01:00
Olivier Goffart
0308f86cd4 Rename sixtyfps_widgets.60 to std-widgets.slint 2022-02-01 18:58:54 +01:00
Tobias Hunger
e6b24bceec [reorg]: Set up and populate the internal directory
Move "internal" crates into the `internal` directory. This first batch
includes most of sixtyfps_runtime but leaves the rendering backends
alone for now.

pre-commit applied some cleanups to the moved files:
 - Consistent newline at end of file policy
 - trimming trailing whitespace
 - Formatting Cargo.toml files.
2022-01-31 16:00:50 +01:00