Commit graph

145 commits

Author SHA1 Message Date
notfirefox
e2aeb56263 Show focus for NativeComboBox 2024-04-15 15:25:23 +02:00
Aurindam Jana
0cfeec1a31
Update Slint Community License (#4994)
Updated the version from 1.1 to 1.2 
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
2024-04-15 15:18:55 +02:00
Simon Hausmann
68083243b2
Add an in-out boolean color-scheme property to Palette (#4701)
This allows applications to force dark/light mode, as well as determine
which mode is active.
2024-03-26 15:44:22 +01:00
Simon Hausmann
f27c185daf
Add a released callback to Slider (#4821)
The released callback is invoked when the user finished changing the value, for example
when the arrow key is released.

As a bonus, for the Qt implementation this fixes a few bugs in the keyboard handling:
  - Handle orientation
  - Implement click-to-focus
  - Emit released also on key release

Co-authored-by: Luke D. Jones <luke@ljones.dev>
2024-03-26 14:15:52 +01:00
Olivier Goffart
5c381fd73e Fix clipping and border-radius
Fix #4854
2024-03-14 23:48:16 +01:00
Paul Zinselmeyer
73e05aebdb Added flicked-Callback on Flickable
As requested in #1462, I've added a `flicked`-Callback that gets
triggered when the `viewport_x`- or `viewport_y` -Properties are changed
by a mouse drag or mouse wheel movement.
2024-02-26 12:17:31 +01:00
Olivier Goffart
5e7ddf3a19 Image Tiling
(Doesn't work yet with 9slice)
2024-02-26 12:16:41 +01:00
Olivier Goffart
ce6c7f5527 Image: add horizontal and vertical alignment 2024-02-08 18:59:26 +01:00
J-P Nurmi
cc5d2b24e5 Add BasicBorderRectangle to avoid unnecessary xxx-border-radius bindings 2024-02-06 18:01:35 +01:00
J-P Nurmi
031742246c Implement clipping 2024-02-06 18:01:35 +01:00
J-P Nurmi
51457025bf Add BorderRectangle::border_top|bottom_left|right_radius 2024-02-06 18:01:35 +01:00
Simon Hausmann
6fefe75a1c Don't require components that use forward-focus to be inlined
Achieve this by generating a `focus()` function for such components
and call it from the outside.

This replaces the previous focus handling with what should be cleaner:

- Any `forward-focus: some-element;` is basically syntactic sugar for
 `public function focus() { some-element.focus(); }`.
- The init code gets simplified to calling focus() on the root, if it's
  available.

Since the `focus()` functions are now generated in the imports pass,
they become visible in the style checker. That means the checker
requires consistent focus handling between the styles.
2024-01-26 12:16:09 +01:00
Brandon Fowler
3e8940660b
Add set-selection-offsets function to TextInput, TextEdit, and LineEdit (#4197)
The function accepts two arguments that specify the start and the end of the text to select.

Fixes #4164
2024-01-06 11:12:53 +01:00
Florian Blasius
e587c09d9c
Added colorize-icon to Button (#4152)
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2023-12-14 12:07:55 +01:00
Olivier Goffart
5d4c390b0f
Compiler: Error when assigning to compile time properties
Some property need to be known at compile time. We already had checks
that the binding is a compile time constant, but there was no check to
prevent, say

    self.row = 42;

which wouldn't work or could even cause panic or miscompilation of
generated code

Closes #4037
2023-12-12 21:51:56 +01:00
Florian Blasius
6da8120dfa
added palette global (#3984)
* Update docs/reference/src/language/builtins/globals.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>

* Update docs/reference/src/language/builtins/globals.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>

* Update docs/reference/src/language/builtins/globals.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>

* Update docs/reference/src/language/builtins/globals.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>

* Update docs/reference/src/language/builtins/globals.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>


---------

Co-authored-by: Florian Blasius <florian.blasius@slint-ui.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
Co-authored-by: Florian Blasius <flovansl@fedora.fritz.box>
2023-12-11 14:44:05 +00:00
Tobias Hunger
2bdcbc8e9f
core: Add a double-click callback to the TouchArea (#4060)
Co-authored-by: Simon Hausmann <hausmann@gmail.com>
Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2023-12-08 12:12:41 +01:00
Florian Blasius
6d6b18300a
added focus state to StandardLIstView (#4086)
* added focus state to StandardLIstView

* (wip) focus handling for qt style

* Update CHANGELOG.md

Co-authored-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>

* Share StandardListView between all styles

* Update internal/compiler/widgets/material-base/combobox.slint

Co-authored-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>

* code review feedback

---------

Co-authored-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
2023-12-08 10:58:58 +01:00
Tobias Hunger
2ad9e07225 component_container: Add has-component property
... that returns a bool when a component is set up in the
ComponentContainer.
2023-11-28 10:38:46 +01:00
Tobias Hunger
83e37f7c51 component_container: Do not auto-match the parent's size
This fixes the widget having the right size and sifes some strange
issues I had been wondering about for a while now!

Pass own size to children instead, so that they will always have
matching sizes.
2023-11-01 17:25:42 +01:00
Florian Blasius
3e3dd03566
Added focus-changed-event callback to FocusScope (#3650) 2023-10-17 17:30:19 +02:00
Olivier Goffart
4c0a435196 Implement TouchArea::scroll-event
Closes #1280
2023-10-07 07:59:53 +02:00
Guiguiprim
05cdf88871
Add spacing-horizontal and spacing-vertical to layout (#3532) 2023-09-28 13:49:28 +02:00
Guilhem Vallat
5cf1a45e41 Remove duplicated geometry properties from items 2023-09-13 16:08:37 +02:00
Olivier Goffart
2a8ebb9752 Flickable: don't make the viewport special
Instead: add the viewport propety directly in the Flickable

Simplifies the compiler's code generation a bit
2023-09-13 16:08:37 +02:00
Olivier Goffart
4920224be0
Rename Slider::vertical to Slider::orientation 2023-08-30 13:43:59 +02:00
Eric
4b9fb89332
add property for slider to support vertical orientation (#3236) 2023-08-16 09:58:50 +02:00
darknight
37488f015d Refactoring: define macro rules to group builtin structs
apply new macro for struct declaration, type register,
doc generation, cpp header generation, struct-value conversion.
2023-08-03 11:01:18 +02:00
Tobias Hunger
eb84994e7a Add lower_component_container pass
Do some diagnostics in that pass.
2023-07-27 12:04:16 +02:00
Tobias Hunger
05e9ce078a Add a simplistic ComponentContainer element
It just registers the type, nothing more.
2023-07-27 12:04:16 +02:00
Eric
1b0d3b1061
Add edited callback for SpinBox (#3096)
* add edited callback for SpinBox
* fix compile error
* add inline comment for callback definition
2023-07-18 07:53:54 +02:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 (#2994) 2023-07-10 10:12:11 +02:00
Olivier Goffart
eb257774e8
Add modifiers to PointerEvent
* Add modifiers to PointerEvent

Closes #2686
2023-07-06 09:54:43 +02:00
Olivier Goffart
7a88dba2e7 Add clear-selection() to all our input fields 2023-06-28 17:07:55 +02:00
Olivier Goffart
1b9e245b4e Remove the NativeSwitch
It is identical to the NativeCheckBox  (Qt don't have a switch widget)
2023-06-23 11:02:46 +02:00
Simon Hausmann
ab0e38c76d
Merge absolute-x and absolute-y "virtual" properties into absolute-position (#2942)
The type of thep property is `Point`, which existed before. It was
mapped to `slint::private_unstable_api::re_exports::Point` (euclid) and
is now mapped to slint::LogicalPosition (also in C++).
2023-06-21 08:17:57 +02:00
Florian Blasius
2656dfad7d
Refactor ProgressIndicator api according to api review. (#2937)
* Refactor ProgressIndicator api according to api review.

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Capping progress also for native.

---------

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2023-06-20 12:27:48 +02:00
Olivier Goffart
11dea135f7 Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Olivier Goffart
033263127b
Qt Combobox: make it look proper when the style show the comobox in popup mode
As discusseed in https://github.com/slint-ui/slint/discussions/2893

Also initialize the current item the same way as fluent and material
2023-06-15 17:14:28 +02:00
Aurindam Jana
039e54a5de
Add royalty free license to files except examples and docs (#2888) 2023-06-15 11:20:50 +02:00
Florian Blasius
94a0327af6
Add primary flag toButton (#2820)
* Add default flag to button

* Code review feedback

* Update CHANGELOG.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update examples/gallery/ui/pages/controls_page.slint

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Code review feedback

---------

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2023-06-06 15:41:23 +02:00
Simon Hausmann
1bf05eae7c
Add support for absolute-x and absolute-y properties on any element (#2823)
Fixes #1691
2023-06-06 14:37:53 +02:00
Simon Hausmann
0f54b9599b Add support for manually closing PopupWindows
This patch adds a `close()` function that can be called to close a popup
window, and a `close-to-click` boolean that can be set to false to
disable the default behavior.
2023-06-02 18:07:49 +02:00
Simon Hausmann
c428601370
Add support for select-all(), cut(), copy() and paste() functions on text input elements (#2804)
In the compiler this is still very primitive, but an attempt to start a
generic interface. The basic assumption is that all item functions will
eventually need access to the window adapter and itemrc. Support for
additional arguments is still missing.

Also missing is support for the function access via rtti in the
interpreter, hence the hardcoding at the moment.
2023-06-01 16:04:53 +02:00
Florian Blasius
0755af3b6d Change progress property of ProgressIndicator from in-out to out 2023-06-01 12:19:43 +02:00
Simon Hausmann
3cf1b38a48 Add basic support for italic font face selection to Text and TextInput
This is implemented for FemtoVG, Skia, and Qt.
2023-05-31 18:47:39 +02:00
Florian Blasius
b4472b9118
Added switch widget (#2798)
* Add material Switch

* Add fluent switch

* Add native Switch and cleanup

* Rebase fix

* Update internal/compiler/widgets/fluent-base/std-widgets-impl.slint

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Code review

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Code review

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update examples/gallery/ui/pages/controls_page.slint

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Code review tweak on gallery layout

* Code review tweak on gallery layout

---------

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2023-05-31 14:57:23 +02:00
Florian Blasius
9e267bcc94
Add ProgressIndicator widgets (#2792)
* Add material ProgressIndicator and documentation

* Add fluent ProgressIndicator

* Add native ProgressIndicator

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Code review

* Update internal/compiler/widgets/fluent-base/std-widgets-base.slint

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update changelog

---------

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2023-05-31 09:57:12 +02:00
Cole Lawrence
af30896e4a Add always-on-top property to Window element 2023-04-15 13:58:47 +02:00
Olivier Goffart
a57c7eb6bc Added TextInputInterface.text-input-focused 2023-04-12 14:49:08 +02:00