Commit graph

5155 commits

Author SHA1 Message Date
Simon Hausmann
9b5e05e41b Provide a macOS version of the sysinfo bash script 2021-10-04 16:38:18 +02:00
Olivier Goffart
aef4b024b4 sysinfo_linux.sh: WIP to show the partitions 2021-10-04 16:38:18 +02:00
Simon Hausmann
e464b473d6 Initial version of a shell script that uses the json mode to show system info 2021-10-04 16:38:18 +02:00
Olivier Goffart
8150bb027b Fix ListView not always making the window to be redrawn when a model change
Example: expending or collapsing the cargo-ui dependency tree after scrolling.
2021-10-04 16:15:36 +02:00
Olivier Goffart
94f55ba29e Janitor: Make sure the variable means what it says
The variable "geometry_changed" was true when the geometry was not updated.
Rename the variable and make it sure it has a proper meaning.
(Doesn't change the logic of the program)
2021-10-04 15:53:51 +02:00
Simon Hausmann
0e8efea2ff Further speed up font handling in the GL backend
Use the new fontdb API:

* When registering embedded fonts, we don't need to make a copy of the
  embedded font data anymore.
* We don't have to mmap the font files ourselves anymore, fontdb can
  do this now for us.
2021-10-04 15:11:55 +02:00
Olivier Goffart
2716e4b4dd TouchArea: add the pointer-event callback
... instead of `pressed-changed`

This allows to see what mouse button was pressed.

Closes #535
2021-10-04 14:39:49 +02:00
Simon Hausmann
137ad32886 Fix abrupt process abort when showing a window with constraints in Weston/Wayland
Don't apply constraints to the winit window if we're in fullscreen mode,
as that might result in us allocating a surface that's bigger than the
screen, which in turn may result in the process exiting right away.

Fixes #532
2021-10-02 09:07:57 +02:00
Olivier Goffart
28fd5a3fc1 Fluent style: The Slider and ScrollBar now updates as the mouse moves
Fixes #494
2021-10-01 14:53:25 +02:00
Olivier Goffart
0aecece4ef Add moved and pressed-changed callback to TouchArea 2021-10-01 14:53:25 +02:00
Olivier Goffart
dc10916129 Attempt to improve a bit the look of the native scrollbar
This tries to adjust the position of the scrollbar depending of the value of
SH_ScrollView_FrameOnlyAroundContents
2021-10-01 12:58:00 +02:00
Olivier Goffart
e858b3e8d5 Fix TabWidget drawing with the Qt Fusion style
- The Tab must be drawn before the contents, because the style draws something under the active tab,
   outside of its region
 - Also set the QStyleOptionTab::HasFrame flag since we are in the equivalent of a QTabWidget
2021-09-30 19:43:53 +02:00
Olivier Goffart
5935b99c73 Fix indentation 2021-09-30 19:11:40 +02:00
Olivier Goffart
c7227f35cc Native style: Fix size of button with icon
Some styles recompute the size based on the contents given in the QStyleOptionButton,
Some styles need to be given the icon in their content size. And this was not done properly
2021-09-30 19:10:00 +02:00
Olivier Goffart
672c95db42 Add an example using bash and jq 2021-09-30 17:51:14 +02:00
Olivier Goffart
d0f953f0e5 CI: Try using the rust-cache action instead of doing our own thing 2021-09-30 17:08:28 +02:00
Simon Hausmann
f6f06a8ccb Fix compilation with Qt 6.2.0 and MSVC
Apply the same fix as woboq/qmetaobject-rs@fb6e8cda64
2021-09-30 15:45:14 +02:00
Simon Hausmann
7a2f365941 Bump corrosion sha1
This includes improved cargo version parsing and better error messages when rustc isn't found.
2021-09-30 15:03:40 +02:00
Simon Hausmann
c564482343 Update dependencies as per release checklist 2021-09-30 14:58:49 +02:00
Simon Hausmann
4bda3c16db Bump GL backend dependencies
Various third-party bumps and femtovg bumped to include a fix for exact
GLES 2.0 detection. Glutin may give us a 3.x GLES context even if we ask
for 2.0 (https://github.com/rust-windowing/glutin/issues/1282) and I can
reproduce that for example on Raspbian with MESA. But femtovg should
work with both, hence the update.
2021-09-30 14:40:19 +02:00
Simon Hausmann
87dc98b5d9 GL backend: Fix rendering of SVGs with text inside
It works with the Qt backend, and it should work with the GL backend as
well. usvg supports it, uses the same underlying shaper and the API even
allows sharing the font database.
2021-09-30 14:32:46 +02:00
Olivier Goffart
5c7a8e7842 Fix test 2021-09-30 13:42:56 +02:00
Olivier Goffart
54c848fca4 Todo example: clear the line edit when adding a Todo item 2021-09-30 13:21:02 +02:00
Olivier Goffart
33e0512448 Qt backend: Fix drawing of the TextInput with vertical alignement
This aligns the text properly in the LineEdit
2021-09-30 13:17:16 +02:00
Olivier Goffart
a72c442b58 Native style: use the QPalette for the placeholder color in a LineEdit 2021-09-30 12:50:30 +02:00
Olivier Goffart
fd435ec270 Fix the default Text color overriding a color specified in a two way binding
We just need to adjust the priority of the default binding to be a high value
(eg, less priority) since the other values must always win.

This fixes the placeholder text color
2021-09-30 12:48:19 +02:00
Olivier Goffart
465857c42e Handle the Keypad Enter as Return
Fixes #525 : LineEdit::accepted doesn't react on numpad Enter
2021-09-30 11:48:09 +02:00
Olivier Goffart
cf2e189245 Small fix to the viewer docs 2021-09-30 11:48:09 +02:00
Simon Hausmann
d3dfd43bdc Tweak dialog error messages
Replace "should" with "must"/"can only" to emphasize that this is an error.
2021-09-30 11:27:50 +02:00
Simon Hausmann
684fcc8dff Fix support for OpenGL ES 2.0
We default to querying GlLatest from glutin, which might run into a code
path in glutin's `bind_and_get_api` in `egl/mod.rs` that will return
None as version and pass that to `choose_fbconfig`. That function will
panic with unimplemented() if the bound API is GLES, because we need to
know which version of GLES. The bound API in turn might be GLES if
desktop GL is not supported.

To accomodate for this situation, this patch changes the GL context
creation logic to first try explicitly GLES 2.0 and then fall back to
the GlLatest variants.

In addition this pulls in a newer version of femtovg to fix FBO
rendering with stencil with GLES 2.0.
2021-09-30 11:10:42 +02:00
Simon Hausmann
001d8442a8 Remove unnecessary glow dependency
We depend on glow through femtovg, but we don't use any APIs of it anymore.
2021-09-30 10:58:48 +02:00
Olivier Goffart
efae60ae7e
Add README for the sixtyfps-viewer 2021-09-30 10:26:12 +02:00
Olivier Goffart
7db9f3dfa9 Dialog: automatically add clicked callback for the standard button
And make the viewer listen to them and set them to automatically close dialogs
2021-09-30 10:21:13 +02:00
Simon Hausmann
dd92c84ea2 Apply suggestions from code review
* Remove stray debug statement
* Fix typo

Co-authored-by: Olivier Goffart <ogoffart@sixtyfps.io>
2021-09-29 17:03:46 +02:00
Simon Hausmann
91ffb4d41f Initial support for mmapping fonts directly into femtovg
This version doesn't require the change to fontdb yet, but uses the new
femtovg API to allow feeding in shared (mmapped) font data. On macOS
this saves 4-5 MB of ram just for the gallery, on my default Ubuntu it's
roughly ~40MB.
2021-09-29 17:03:46 +02:00
Olivier Goffart
9936dfc0eb Apply suggestions from code review
Co-authored-by: Simon Hausmann <simon.hausmann@sixtyfps.io>
2021-09-29 16:25:44 +02:00
Olivier Goffart
7f05bfa309 Add the Dialog element 2021-09-29 16:25:44 +02:00
Olivier Goffart
3cf9089293 Refactor: Builtin can now have default binding on properties that are inherited from a NativeClass
And make the Window have a NativeClass parent, so it can be re-used for the Dialog
2021-09-29 16:25:44 +02:00
Olivier Goffart
671df0f24f New widget: StandardButton 2021-09-29 16:25:44 +02:00
Simon Hausmann
21f9850b43 Small spelling fix 2021-09-29 14:55:08 +02:00
Simon Hausmann
fc491b167f Add a doctest for sixtyfps::Image::path() 2021-09-28 08:52:27 +02:00
Simon Hausmann
4eef8c7688 Add API to sixtyfps::Image in Rust and C++ to access the optional path 2021-09-28 08:52:27 +02:00
Olivier Goffart
bbe178aadf Add links to the template repositories 2021-09-28 08:24:44 +02:00
Simon Hausmann
cbefe741fc Link to the template repos from the README 2021-09-27 10:47:37 +02:00
Olivier Goffart
f2774a41a5 Document logical and comparison operators 2021-09-24 09:43:23 +02:00
Olivier Goffart
28932a32a5 Mention the bool type in the docs 2021-09-24 09:26:00 +02:00
Olivier Goffart
0eb223b2ca Update tools/viewer/main.rs
Co-authored-by: Simon Hausmann <simon.hausmann@sixtyfps.io>
2021-09-24 09:23:48 +02:00
Olivier Goffart
321d985242 Viewer: add ability to load and save property values from/to json
issue #238
2021-09-24 09:23:48 +02:00
Simon Hausmann
fa89758dc5 Fix background color of window when viewing non-window elements
The synthetic window we "inject" in the ensure_window() pass did not
have the window-background from the style applied. This is visible
for example when viewing something like

    Rectangle { background: blue; border-radius: height / 2 }
2021-09-23 19:19:06 +02:00
Olivier Goffart
730cbf1ef9 Interpreter: add type checking for declared properties
issue #512
2021-09-23 19:17:17 +02:00