Commit graph

39 commits

Author SHA1 Message Date
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
Olivier Goffart
e9b63552a7 Skeleton for a TODO app 2020-09-07 14:15:27 +02:00