Commit graph

51 commits

Author SHA1 Message Date
Olivier Goffart
acb7da11d2 fix missing warning of missing export
... for last component when globals are exported
2024-06-21 11:57:49 +02:00
Olivier Goffart
58826ddd94 Testing C++ API: add a visitor over the ElementHandle 2024-06-10 15:52:40 +02:00
Olivier Goffart
ddeb824356 todo example: use the Palette color for the popup 2024-02-03 17:16:19 +01:00
Olivier Goffart
a3e3cccf0c Todo Android example: state saving/restore 2024-01-03 14:26:48 +01:00
Florian Blasius
4ec63a9c71
cleanup examples according to upcoming code guidelines (#3809) 2023-11-02 11:04:40 +01:00
Florian Blasius
2324b35d12
napi test driver setup (#3635)
* Export interpreter stuff on private_api namespace

* Update api/napi/src/interpreter/value.rs

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update tests/driver/napi/build.rs

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

* Update tests/driver/napi/Cargo.toml

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


* Avoid unwanted prompt on Windows when running npm run build twice

Don't generate "napi.js" as then Windows will try to open it when running just "napi",
if nodejs registered .js as extension.

* Remove windows path workaround

It doesn't look like that it is needed.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2023-10-11 12:48:27 +02:00
Olivier Goffart
08b6393af9 material style todo demo polish
- Remove extra padding from the todo demo. Box in Box causes the
   padding to be added twice otherwise. And the Box have extra big
   padding with the material style.

 - Fixup the combobox size to be consistant with fluent wrt sizing

 - Use the proper color for the checkbox border, following the
   style specification
2023-09-26 08:42:31 +02:00
Olivier Goffart
11dea135f7 Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Aurindam Jana
e4338300de
Change license for examples to MIT (#2887) 2023-06-15 11:23:17 +02:00
Olivier Goffart
6441968a43 Janitor: Remove trailing spaces in most files 2023-05-04 08:14:28 +02: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
129ee0acae
Florian/sort todo (#1721)
Implement `set_row_data` for `SortModel` and `FilterModel` (rust and cpp). Add sort and filter example to the todo example.
2022-10-11 18:58:00 +02:00
Olivier Goffart
737109e60e todo example: use a Dialog for the popup menu
So the button looks native.

and limit its size to the size of the window because it looks
bad if it is outside of the bounds.
2022-03-17 14:49:12 +01:00
Lukas Jung
2d678078d3 Add close-callback to rust todo example 2022-03-17 08:51:00 +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
03534039d6 Replace more .60 by .slint
Mainly an automated change with
    git grep -O"sed -i 's/\.60/.slint/g'" -w "\.60"

and some manual checks
2022-02-02 10:12:31 +01:00
Olivier Goffart
0c0a783095 Rename all our .60 files to .slint 2022-02-02 10:05:45 +01:00
Olivier Goffart
0308f86cd4 Rename sixtyfps_widgets.60 to std-widgets.slint 2022-02-01 18:58:54 +01:00
Tobias Hunger
bfca0e3573 Mass update copyright messages to be more REUSE compliant 2021-12-22 10:06:12 +01:00
Olivier Goffart
54c848fca4 Todo example: clear the line edit when adding a Todo item 2021-09-30 13:21:02 +02:00
Tobias Hunger
aea4ecca99 Apply pre-commit hooks to all files 2021-08-17 22:38:16 +02:00
Olivier Goffart
ffccef4e0c Examples: replace all _ by - in identifiers 2021-08-10 22:21:01 +02:00
Olivier Goffart
6aa6dec9b4 Small simplification on the usages of ListView
Now that the height computation is done properly
2021-07-22 17:29:53 +02:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +02:00
Olivier Goffart
962dc0075c Layout: Make the default padding and spacing 0
and add Box widgets that have proper defaults

Closes #200
2021-06-21 14:29:53 +02:00
Olivier Goffart
fbdbe69fe7 Window: make hight and width fixed size, preferred-* property set the initial size
Issue #227
2021-05-18 10:23:06 +02:00
Olivier Goffart
0d2d48be4f Rename "signal" to "callback" 2020-12-18 09:51:01 +01:00
Olivier Goffart
5517b368eb Todo: add a small spacing 2020-12-08 16:21:08 +01:00
Simon Hausmann
e87913634a Use layout alignment
That allows removing a FIXME
2020-11-06 11:09:22 +01:00
Simon Hausmann
9df18a3747 Apply default layout spacing and padding from the style
Extract the StyleMetrics from the style and pass it to the layout
lowering pass for application.

The tests were adjusted to explicitly specify the padding/spacing to
override the ugly style default.
2020-11-04 15:20:43 +01:00
Olivier Goffart
72f22c8aad Make a StyleMetrics global in the style and use it from todo just to test 2020-11-02 17:19:57 +01:00
Simon Hausmann
cd75556ab1 Minor clean up in the todo app
* Show a placeholder text for the todo entry
* Disable the "Add Entry" button if there's nothing to be added
2020-10-30 15:55:19 +01:00
Olivier Goffart
d3801e26d3 Change the syntax of structures to require the struct keyword 2020-10-27 16:09:05 +01:00
Olivier Goffart
47be71e16d Introduce layout stretching 2020-10-26 16:40:35 +01:00
Olivier Goffart
ed01d8369a Start working on VerticalLayout/HorizontalLayout 2020-10-23 14:08:58 +02:00
Simon Hausmann
aad9306d54 Added a node version of the todo app 2020-10-21 13:49:18 +02:00
Simon Hausmann
713cfd8157 Fix colspan/rowspan usage in todo demo
Accidental swap :-)
2020-10-20 10:52:02 +02:00
Simon Hausmann
6aa292eac1 Change the names of the logical and physical pixel units
The logical pixels are now just called "px" and the less frequently
used physical pixels have the "phx" suffix.

The existing markup was adapted using the syntax updater and the
following patch:

    +    if node.kind() == SyntaxKind::NumberLiteral {
    +        if node.text().ends_with("lx") {
    +            return write!(
    +                file,
    +                "{}px",
    +                node.text().as_str().split_at(node.text().as_str().len() - 2).0
    +            );
    +        }
    +        if node.text().ends_with("px") {
    +            return write!(
    +                file,
    +                "{}phx",
    +                node.text().as_str().split_at(node.text().as_str().len() - 2).0
    +            );
    +        }
    +    }

Fixes #49
2020-10-16 07:19:40 +02:00
Olivier Goffart
c7e5b39973 Layout the items in the ListView 2020-10-02 18:07:39 +02:00
Olivier Goffart
f10c2bfd7c More ListView WIP 2020-10-02 18:07:39 +02:00
Olivier Goffart
4cf61b5617 Make the "remove done items" button work in the Todo rust example 2020-09-30 17:57:19 +02:00
Olivier Goffart
6dd0d178a0 Rename ScrollArea to ScrollView 2020-09-28 10:52:29 +02:00
Olivier Goffart
5caeb601ff Remove the accepted_text workaround now that we have the two way bindings 2020-09-25 16:47:24 +02:00
Olivier Goffart
3f0d06b290 Use the ScrollArea in the todo example even if it is ugly 2020-09-22 20:11:43 +02:00
Simon Hausmann
b857eb4671 Add an accepted signal to TextInput and LineEdit 2020-09-21 13:18:53 +02:00
Simon Hausmann
93a08c5207 Add a LineEdit widget to the ugly and native style 2020-09-18 18:54:37 +02:00
Simon Hausmann
2da84fee46 Add a boilerplate TextInput item 2020-09-18 16:34:24 +02:00
Olivier Goffart
221bb853d7 Change the exaple to used named struct for models 2020-09-17 14:00:50 +02:00
Simon Hausmann
625cb6c6b8 Add a constructor to Text and let the color default to black
We really shouldn't require specifying a color for every Text {} element just in order
to see *some* text.

For Rectangle OTOH transparent is a good default (and thus for Color), hence
this change just to Text.

Right now the constructor bit is also a bit repetitive, this could
perhaps be folded into BuiltinItem to generate the ffi, default impl and
forward to an init function if it exists.
2020-09-16 08:20:13 +02:00
Olivier Goffart
0d8a38577d Todo example: make the "add todo" button do something 2020-09-14 16:38:45 +02:00