Commit graph

100 commits

Author SHA1 Message Date
Simon Hausmann
7cea088a2c Add support for letter-spacing in text
This is conveniently supported by femtovg and Qt
2021-02-16 22:14:50 +01:00
Simon Hausmann
2dd5ea61bb Add support for Path.fill-rule
For some reason it's not working with the Qt renderer though
2021-02-10 14:08:32 +01:00
Olivier Goffart
f7a76dc352 Add ImageFit::cover, and fix ImageFit::contain 2021-02-09 10:52:04 +01:00
Olivier Goffart
9bdb793ec1 Rename Window::color to background 2021-02-05 09:38:40 +01:00
Olivier Goffart
0e2471f76b Image::colorize support
(Qt only)
2021-02-04 17:44:01 +01:00
Simon Hausmann
3f541972ef Change Rectangle::border-color to be a brush
This allows things like filling a thick border with a gradient.
2021-02-04 17:05:00 +01:00
Simon Hausmann
1a9419638d Change the type of the color property for Text and TextInput to be a brush
This allows filling glyphs with gradients. However femtovg
appears to apply the start/end position per-glyph
instead of globally - resulting in a different result than Qt.
2021-02-04 11:54:57 +01:00
Simon Hausmann
31f3c45291 Fix typo in docs 2021-02-04 09:53:22 +01:00
Simon Hausmann
66df71a3ca Convert Path to support brushes
* Rename `fill-color` to `fill`
* Rename `stroke-colo` to `stroke`
* Support using a brush for both properties
2021-02-03 15:45:33 +01:00
Simon Hausmann
246398fcb3 Issue a warning when accessing deprecated properties through member lookups 2021-02-02 22:42:02 +01:00
Simon Hausmann
e61529976e Issue warnings when creating bindings against deprecated properties 2021-02-02 22:42:02 +01:00
Simon Hausmann
43dd0e2915 Add missing return value for key-pressed handler in FocusScope docs 2021-01-28 14:30:28 +01:00
Simon Hausmann
6a4f2aa572 Added the two missing path sub-elements for quadratic and cubic curves 2021-01-28 14:14:24 +01:00
Simon Hausmann
0c7a4da321 Fix the syntax of the sub-element Path example
Can't mix `commands` and path sub-elements
2021-01-28 13:42:42 +01:00
Simon Hausmann
14bb19d96c Formatting fix 2021-01-28 13:32:28 +01:00
Simon Hausmann
c4df7748db First draft of docs of Path sub-elements 2021-01-28 13:29:16 +01:00
Simon Hausmann
d074806dd7 Start with Path docs
More to come, but starting with this to also see how it renders the example
2021-01-28 11:57:43 +01:00
Olivier Goffart
23a511b380 Replace img!"..." by @image-url("...") 2021-01-28 11:49:24 +01:00
Simon Hausmann
e2499e5137 Some docs for the drop shadow properties 2021-01-28 08:54:09 +01:00
Olivier Goffart
647f7effcd Add TextWrap and TextOverflow enum and corresponding property in Text
Although they ar enot working yet
2021-01-27 11:40:09 +01:00
Olivier Goffart
cb12a4582d Documentation the EventResult 2021-01-26 17:31:03 +01:00
Simon Hausmann
31eedea4ef Minor doc formatting fix
Adding missing parentheses
2021-01-25 14:58:46 +01:00
Simon Hausmann
5a4fd71dcc Fix links to alignment enums in Text and TextInput 2021-01-25 14:29:26 +01:00
Simon Hausmann
c18a751e97 Added boilerplate docs for the text alignment enums 2021-01-25 11:07:33 +01:00
Simon Hausmann
2801e82658 Changed the KeyEvent in .60 to be an object
This exposes the text as well as the keyboard modifiers and is a little
more extensible.
2021-01-22 18:05:34 +01:00
Olivier Goffart
f1d0a647a4 Document FocusScope 2021-01-20 13:02:11 +01:00
Olivier Goffart
61399e566a Add a title to the Window
also add a color, but not yet implemented
2020-12-18 16:47:14 +01:00
Olivier Goffart
0d2d48be4f Rename "signal" to "callback" 2020-12-18 09:51:01 +01:00
Simon Hausmann
625978fe1a WIP: Add an image-fit property to Image/ClippedImage 2020-12-15 10:26:54 +01:00
Olivier Goffart
f3f18259ae Some items default size is the parent size
Fixes #122
2020-12-02 18:36:23 +01:00
Olivier Goffart
564d6a0744 Fix Popup in C++ 2020-12-01 10:24:37 +01:00
Olivier Goffart
99e66a6b55 doc for the PopupWindow 2020-11-30 18:44:45 +01:00
Simon Hausmann
8c477998dc Load the logo in the examples off the website
This will allow moving them out of the repo and also makes the urls shorter.
2020-11-25 09:34:47 +01:00
Olivier Goffart
3ae7c6e0b5 Hover effect 2020-11-24 18:09:32 +01:00
Simon Hausmann
d80868bbf4 Add support for font_weight to Text and TextInput
This allows implementing another sliding puzzle theme feature, the
boldness of the tile number text in the simple theme when the tile is in
the correct position. For the other themes the weight is constant and
it's bold.

More cleanup to follow later: unify the font handle and FontCacheKey
handling, improve the API to allow for the use of symbolic constants
(normal, bold, etc.) instead of the CSS number values.
2020-11-24 10:10:00 +01:00
Simon Hausmann
3d85e45ec3 Add support for source clipping to the Image element
This allows rendering only a sub-rectangle of the original image, which
we can use right away in the sliding puzzle demo.
2020-11-23 15:46:59 +01:00
Olivier Goffart
08fe5f6c72 Add a Clip 2020-11-20 15:45:45 +01:00
Olivier Goffart
183f300a85 Implement the temperature converter in the .60 code
A edited signal was required on the line edit
2020-11-03 18:23:37 +01:00
Olivier Goffart
4a182ef4d0 Layout alignment 2020-11-03 12:22:34 +01:00
Olivier Goffart
07589f3037 Document HoizontalLayout and VerticalLayout 2020-10-26 19:25:24 +01: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
Simon Hausmann
9c23d9b571 Alternate fix for image loading in docs preview
Revert commit 9f488bba3b for now and
instead resort to an absolute url to the image. This way we
don't have to use the wrong base url.
2020-10-13 09:44:25 +02:00
Simon Hausmann
9f488bba3b Try to get the image loading work in the embedded doc preview
By specifying the CORS-friendly github raw url as base url for the interpreter,
we can load images using relative paths.

According to the inspector the image is loaded successfully,
so what seems to be left to fix is an event loop related issue.
2020-10-13 09:31:42 +02:00
Simon Hausmann
b3a591cef0 Small grammar fix 2020-10-12 21:27:01 +02:00
Simon Hausmann
7e0e7b43f0 Add support for calling focus() on TextInput elements
This allows activating text inputs in signal handlers connected for
example to buttons.

This implements parts of #55
2020-10-01 08:52:45 +02:00
Simon Hausmann
9ad8968529 Add support for the initial_focus synthetic property
Setting it will translate to a set_focus_item call in the constructor.

This implements parts of #55
2020-09-30 15:11:01 +02:00
Simon Hausmann
2da84fee46 Add a boilerplate TextInput item 2020-09-18 16:34:24 +02:00
Simon Hausmann
adec90e8d2 Ident all builtin elements by one level
Looks much nicer in the C++ docs :)
2020-09-03 09:48:53 +02:00
Simon Hausmann
8b45efd16d Put all builtin element names into blocks 2020-09-03 09:39:08 +02:00
Olivier Goffart
8a7afbc238 Documents the elements 2020-09-02 18:57:24 +02:00