Commit graph

81 commits

Author SHA1 Message Date
Simon Hausmann
ac1233491d cupertino: Fix missing title in GroupBox widget
Regression from commit c931cc28ae, which removed the two-way binding.
2025-05-06 17:26:10 +02:00
Simon Hausmann
904bc56e62 Introduce Platform.style-name
This replaces the previously hidden `StyleMetrics.style-name` that was only accessible for internal use.
2025-05-06 13:06:27 +02:00
FloVanGH
c931cc28ae
ChangeLog: std-widgets: added content-padding to GroupBox (#8314)
* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-05-02 07:11:52 +00:00
Bryce Happel Walton
769f85584d
Fix ScrollView scrollbar actions not triggering scrolled callback
Fixes #8170
2025-04-28 10:56:30 +02:00
Simon Hausmann
8761eaadeb
Move Palette.style-name to internal protected StyleMetrics.style-name (#8200)
This is only exposed when internal types are exposed (such as in the lsp).

The plan is to make this public under a new name/global after the release.

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2025-04-19 10:20:52 +02:00
Nigel Breslaw
538f8bde19
Allow checking at runtime about the current theme (#8049)
Although std-widgets provides many properties that adapt to the current theme users who would like to go beyond these properties and do theme dependent changes are limited. One option would be to add even more properties to the Palette, however this would potentially bloat the object, it's not obvious what properties users care about and this approach doesn't scale. In many cases developers could simply create their own properties if they knew what the current runtime theme was.

This simple change allows an app to know what the current theme is and present theme appropriate UI's.
2025-04-04 14:44:14 +03:00
Olivier Goffart
e5289af154 Introduce MenuSeparator
Fixes #7790
2025-04-02 11:50:45 +02:00
Olivier Goffart
6010cf724c Hover on MenuBar should activate menu if a menu is already open
Fixes #7822
2025-03-31 14:06:24 +02:00
Arnold Loubriat
615be362b2 Disable built-in TextInput accessibility for Spinbox 2025-03-17 14:27:08 +01:00
FloVanGH
390f8aaf50
scrollview: fixed scrollthumb size on small sizes (#7809)
* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-03-05 16:46:45 +01:00
autofix-ci[bot]
617aa386bc [autofix.ci] apply automated fixes 2025-02-27 12:13:44 +01:00
FloVanGH
f6cec29fed menu: finished cupertino style 2025-02-27 12:13:44 +01:00
FloVanGH
be7c125726
menus: fluent style and refactoring (#7723)
* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-24 17:01:22 +01:00
Olivier Goffart
39191e5acd
Menu API changes
`ContextMenu` -> `ContextMenuArea`

`ContextMenu` must have a `Menu` child.
`MenuItem` can no longer be put dirrectly in `MenuBar` and can no longer
have children
`Menu` is used now for sub menus
2025-02-21 16:03:47 +01:00
Simon Hausmann
368ec3459b
Improve default accessibility of TextInput elements
Apply similar logic as to LineEdit and TextEdit, so that when folks build their own text input widgets, they're accessible by default. Also fixed the docs while at it to mention default applications.

Amends #7669
2025-02-20 13:44:16 +01:00
Arnold Loubriat
cc91de2d38 Add the accessible-read-only property 2025-02-19 09:16:41 +01:00
Arnold Loubriat
90c337f1d1
Add AccessibleRole::Image and use it in the AboutSlint widget (#7593)
* Add `AccessibleRole::Image`

* Improve accessibility of the `AboutSlint` widget

* Filter out some images from the accessibility tree
2025-02-18 09:43:53 +01:00
Olivier Goffart
c85b20d431 ContextMenu on the LineEdit and TextEdit
With usual copy/paste entries

We need to make sure that showing the popup window don't clear the
selection in the TextInput which happens if the TextInput gets a
FocusOut event.
2025-02-11 10:30:11 +01:00
Olivier Goffart
9853384f56
CombBox: Don't change on scroll unless we have focus / not at all on cupertino
* ComboBox: Don't change on scroll uless we have focus

This is what native Windows combobox does.
Otherwise this causes problem when combobox are in scrollable

Fixes #5929

* ComboBox: Don't scroll at all with the wheel on Mac.

This is also Qt's behavior
https://doc.qt.io/qt-6/qstyle.html#:~:text=SH_ComboBox_AllowWheelScrolling
2025-02-07 13:52:14 +01:00
Olivier Goffart
2846c35055
TextInput: implement page up/down
CC #474
2025-02-06 14:52:28 +01:00
FloVanGH
2f03bad1cc
added missing properties to StandardTableView (#7543) 2025-02-05 10:02:22 +00:00
Olivier Goffart
88cc96ba73
Make forward-focus in a PopupWindow work 2025-02-04 12:31:06 +01:00
Arnold Loubriat
358e42a8d5 Add the accessible-action-expand action 2025-02-03 20:32:45 +01:00
Arnold Loubriat
79b4950f41 Remove combo box's inner label from the accessibility tree 2025-02-03 20:32:45 +01:00
Arnold Loubriat
f30f953ffd Add the accessible-expanded property 2025-02-03 20:32:45 +01:00
Arnold Loubriat
53fd7b12e4 Add the accessible-expandable property 2025-02-03 20:32:45 +01:00
Arnold Loubriat
e442965889 Set accessible-value on ComboBox widgets 2025-02-03 20:32:45 +01:00
Olivier Goffart
3f54e6cbc1 Fix ScrollView on cupertino not showing the last few pixels
Within the cupertino's ScrollView, the Flickable is positioned
with a 2 pixel margin with the `x` and `y` properties
property, so the width and height should also account for that margin.

Fix the test_cpp_elements_listview in test-driver-cpp
2025-01-22 19:52:02 +01:00
Simon Hausmann
aa332202c5 Rename AccessibleRole.GroupBox to AccessibleRole.Groupbox
While unfortunate in casing, this is consistent with Checkbox, Combobox, and Spinbox.
2025-01-10 16:27:14 +01:00
Olivier Goffart
3e94bd2167 Janitor: Remove trailing whitespaces from all files
`git grep -I -l -O'sed -i "s/[[:space:]]*$//"' -e ''`
2025-01-10 13:23:22 +01:00
Arnold Loubriat
f7b9da96d4 Set accessible-enabled on group box widgets 2025-01-07 23:08:03 +01:00
Arnold Loubriat
8b95752de7 Set accessible-label on group box widgets 2025-01-07 23:08:03 +01:00
Arnold Loubriat
49196728a7 Add AccessibleRole::GroupBox 2025-01-07 23:08:03 +01:00
Arnold Loubriat
9c25040b00 Set accessible-action-default on tabs 2025-01-06 09:30:11 +01:00
Arnold Loubriat
60aacc8f82 Set accessible-item-selected on tabs 2025-01-06 09:30:11 +01:00
Arnold Loubriat
67f6e1a737 Set accessible-item-selectable on tabs 2025-01-06 09:30:11 +01:00
Arnold Loubriat
23e37ce4de Set accessible-item-index on tabs 2025-01-06 09:30:11 +01:00
Arnold Loubriat
38499962a9 Set accessible-item-count on tab bar widgets 2025-01-06 09:30:11 +01:00
Arnold Loubriat
c3cfa6044a Remove tab title label from the accessibility tree 2025-01-06 09:30:11 +01:00
Olivier Goffart
60c10213d2
Remove LayoutSpec and undeprecate StyleMetrics.layout-* properties (#7069)
StyleMetrics is the right name for these
2024-12-16 14:52:28 +01:00
FloVanGH
e0ad561c86
widgets: added key-pressed and key-released callbacks to all text input components (#7081)
* widgets: removed rejected event
* widgets: added key-pressed, key-released callbacks to text input components
* Update docs/astro/src/content/docs/reference/std-widgets/lineedit.mdx
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>

---------

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2024-12-12 16:20:45 +00:00
Olivier Goffart
69d201d6a0 ComboBox: key event when popup is open
Fixes #4826

The previous patch changed that the ComboBox was no longer focused when
the popup is shown, so make a hack around that
2024-12-09 15:58:16 +01:00
Olivier Goffart
a3dad45f0b Accessibility: rename a few properties after API review:
- Rename `accessible-selectable` and `accessible-selected` to `accessible-item-{selectable,selected}`.
   Because the property is for items in list rather than eg Text
 - Rename `accessible-position-in-set` to `accessible-item-index`.
 - Rename `accessible-size-of-set` to `accessible-item-count` and move
   the property to the container element rather than the item itself
2024-12-07 08:25:42 +01:00
asuper0
387220227d
Add step property to Slider (#6981)
Closes #4549

ChangedLog: Slider: added `step` property
2024-12-05 11:50:08 +01:00
FloVanGH
901afde11f
api review: callback parameters and properties name adjustements 2024-12-02 16:22:39 +00:00
szecket
ba14285332
Szecket/cupertino colours (#6801)
* creating a lookup table of colors based on the set on apple docs
then selecting from these colors rather than always typing hex
also added an in property for setting selected color (future)

* splitting out method of changing selection colour for later

* forgot to pull CupertinoColors from import

* Squashed commit of the following:

commit 4924aa908d6e039a7bf1f79ede3dc7c26f71007f
Author: szecket <szecket@magrittescow.com>
Date:   Fri Nov 15 17:31:45 2024 -0500

    use  defined Palette for states

commit 80711ee7188f37b1b29ce11855b6a636d7a39306
Author: szecket <szecket@magrittescow.com>
Date:   Fri Nov 15 17:29:51 2024 -0500

    make control colour consistent with style and other controls

commit 1cfd39e6da6643600e8b553dfab2418c8552cdc4
Author: szecket <szecket@magrittescow.com>
Date:   Fri Nov 15 13:58:07 2024 -0500

    selection of controls when focused is not current cupertino style and too strong

commit 4bf4ae6ad385e118687f752362b34e079c03fe22
Author: szecket <szecket@magrittescow.com>
Date:   Fri Nov 15 13:42:58 2024 -0500

    make foreground color contrast when selected

* removing property that is only in cupertino
2024-11-22 08:18:27 +13:00
Olivier Goffart
f225f79d49 compiler: Put the argument names in the Type
That simplifies things a bit and will allow to have names for builtin callback and functions
2024-11-21 09:53:17 +01:00
Olivier Goffart
5bd20def0e Experimental support for MenuBar
Introduces `MenuBar{ ... }` that can be put in a Window
2024-11-20 09:25:37 +01:00
FloVanGH
5ea05e18af
std-widgets: added horizontal-alignment to SpinBox (#6778) 2024-11-15 08:05:57 +00:00
FloVanGH
c84af1a8d7
std-widgets: added LayoutSpec global (#6711) 2024-11-06 14:47:04 +00:00