Commit graph

430 commits

Author SHA1 Message Date
Tobias Hunger
2f6be7b31f Mass-add copyright headers into Cargo.toml files 2022-01-19 11:25:21 +01:00
Olivier Goffart
6699067351 TabWidget: focus the tab when clicking on it
The Tab currently doesn't do anything with the focus, but this
serves as a workaround for #798 so that inner widget of a tab can't
keep the focus when they are hidden

cc #798
2022-01-12 14:54:04 +01:00
Tobias Hunger
43e4b262c2
janitor: Remove some more unnecessary clone() calls 2022-01-09 14:34:03 +01:00
Tobias Hunger
2d2c560220 janitor: Remove unnecessary return statements
Some of these actually seem to make some stylistc sense
2022-01-09 13:46:33 +01:00
Tobias Hunger
11d46892e4
janitor: Remove some unnecessary lazy evaluation 2022-01-04 18:22:49 +01:00
Tobias Hunger
3e448f75eb
janitor: Remove some unnecessary references
These are immediently dereferenced by the compiler according to clippy.

Remove some now unnecessary muts to make things build again.
2022-01-04 18:22:15 +01:00
Olivier Goffart
f5cf60ea23 NativeComboBox: don't show the combobox as open
Because we currently don't have a way to detect when the popup is closed
we workaround the problem by never show the combo box as open.

Workaround #456
2022-01-03 12:52:20 +01:00
Tobias Hunger
bfca0e3573 Mass update copyright messages to be more REUSE compliant 2021-12-22 10:06:12 +01:00
Simon Hausmann
215cf68152 Add a simple frames per second counter to the GL and Qt backend
It can be activated using the `SIXTYFPS_DEBUG_PERFORMANCE` environment
variable, which takes a comma separated list of options.

This could be extended in the future with different locations for the
overlay (corner_top_left, corner_top_right, etc.) - but this is a simple
start.

cc #728
2021-12-20 15:32:20 +01:00
Simon Hausmann
e0a942dc1c Avoid the use of symlinks for source files
On Windows 10, the creation of symlinks by normal users requires
enabling the developer mode, which may or may not be acceptable in
corporate environments with restricted IT setups.

We introduced the symlinks for the shared special key codes mapping,
which instead this patch places into a shared sixtyfps-common crate.
2021-12-13 15:51:10 +01:00
Olivier Goffart
733d4ed365 Handle more non printable key
Share the code that defines the key with a macro over all the backends using
a symlink.

This is a symlink rather than exposing the macro directly since we add this
module in every backend, and each backend re-declares the macro to handle
the part that it needs. This needs to be a symlink because it will also be shared
with the compiler that does not depends on sixtyfps-corelib
2021-12-10 11:28:09 +01:00
Lukas Jung
25dc48ae27 remove move cursor from MouseCursor 2021-12-07 22:41:24 +01:00
Lukas Jung
588a7b0c5c Format mouse-cursor changes with rustfmt 2021-12-07 22:41:24 +01:00
Lukas Jung
45942fbd82 Add mouse-cursor support to qt backend 2021-12-07 22:41:24 +01:00
Lukas Jung
d2abab5232 Add Qt::CursorShape to key_generated.rs 2021-12-07 22:41:24 +01:00
Olivier Goffart
9e1e7e3937 Qt backend: simplify the way we set the no-frame flag on the QWidget 2021-12-06 18:52:10 +01:00
Olivier Goffart
310bf897cd Native ComboBox: style the background of the popup
Fixes: #720
2021-12-06 18:52:10 +01:00
Olivier Goffart
2ffa83db0e Native Style: hover effect on NativeStandardListViewItem 2021-12-06 18:52:10 +01:00
Simon Hausmann
6ca63aac9c Make it possible to delegate the timer handling to the backend
When building with no_std, the backend can provide the global
instant.
2021-11-30 17:27:55 +01:00
Simon Hausmann
8f4b256da0 Fix components being inadvertendly shown when using Qt
Remove a spurious show() call, only an explicit show() should bring up the widget on the screen.
2021-11-30 12:31:51 +01:00
Simon Hausmann
6233cc64f2 Fix build with Qt 5
The QPalette workaround is only needed for Qt 6.
2021-11-29 17:18:23 +01:00
Simon Hausmann
e512feb952 Fix reacting to palette changes when using Qt
Due to a bug in Qt's implicit sharing in QPalette, the resolve mask of
QGuiApplicationPrivate::app_pal would get changed with an unrelated setColor
call and thus break color resolution from a new base palette when the theme changes.
2021-11-29 17:18:23 +01:00
Olivier Goffart
e4bd6bbfb8 Native style: respond to the StyleChange event
So that color scheme is updated when switching to the dark style, for example

Fixes #687
2021-11-29 17:18:23 +01:00
Olivier Goffart
80c0602277 WIP: start making the corelib crate a no_std crate
Does not compile yet with no_std because of the lack of
alternative for thread_local
2021-11-25 12:02:16 +01:00
ogoffart
3278b39549 Bump version number to 0.1.6 2021-11-24 14:19:09 +00:00
Olivier Goffart
d1cae710df preprocess the images at compile time
For the MCU port, we need to proccess the image to save them in the binary
in a convenient format.
This patch start this work by trying to anaylyze what format should an image
be using, and saving it as a texture in the binary.

The current graphical backend and the C++ frontend are not yet supported
2021-11-19 15:54:45 +01:00
Olivier Goffart
f138887857 QPainter and QBrush are now exposed by qttypes 0.2.5 2021-11-19 12:43:47 +01:00
Olivier Goffart
cd14e1d70c Move the NativeButtonVTable in the right module 2021-11-18 10:23:06 +01:00
unc0
54ae34f9fb Set MSVC to use UTF-8 character sets on c++ source files,
so it won't throw error on `u"string"` when running in
other codepage, for example cp936.
Ref: https://docs.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8
2021-11-17 19:35:12 +01:00
Olivier Goffart
becb4574c1 Qt backend: don't set Qt::AA_PluginApplication when using the backend
Otherwise Qt won't set the hidpi mode on windows, for example
2021-11-17 09:05:24 +01:00
Olivier Goffart
40a6f3e740 Polish the Native Spinbox: There is a line edit that need to be drawn inside 2021-11-17 08:44:08 +01:00
Simon Hausmann
ad1b251966 Internal cleanup
Centralize the setting of the width/height on the window item in the core library.
2021-11-11 11:47:54 +01:00
Olivier Goffart
28c485c161 Handle the tab key in the Qt backend
Completes #639
2021-11-08 16:16:56 +01:00
Simon Hausmann
13de800ba3 Internal cleanup: Rename layouting_info to layout_info
That's making the call on the Component VTable consistent(ish) with the Item VTable.
2021-11-08 10:24:30 +01:00
Simon Hausmann
67579ec560 Simplify drop implementation of generated components
Avoid creating an intermediate array of items to free the graphics resources.
Instead call run-time function with the item tree as a parameter, which is traversed.

It's practically the same data structure that was previously created, except
that it is shared/global and has little holes for the dynamic tree items, but those are easy to skip.
2021-11-01 08:58:53 +01:00
Simon Hausmann
d57edfbb7c Simplify free_graphics_resources API in the backend
Take an iterator reference instead of a slice, so that we can change the call sites in the future.
2021-10-30 13:03:52 +02:00
ogoffart
b25ae6fbcd Bump version number to 0.1.5 2021-10-26 07:36:54 +00:00
Olivier Goffart
18ce1087d5 Hardcode the Qt license
Because the install qt github action does not install the documentation
2021-10-22 14:32:17 +02:00
Simon Hausmann
dec6c6ca51 Work around crash in Qt mac style when drawing scrollbars with invalid size
Fixes #595
2021-10-19 12:36:26 +02:00
Olivier Goffart
4436b422e5 Fix LineEdit.has-focus witht he native style
The property had the wrong name.

Also it is not a native-output
2021-10-14 15:34:25 +02:00
Simon Hausmann
e305f0e61c Fix sixtyfps::quit_event_loop() not exiting the event loop with Qt 6 on macOS
As per commit 0c02f133f3daee146b805149e69bba8cee6727b2 in qtbase (qt6),
quit() on QCoreApplication on macOS calls [NSApp terminate], which will
not return to main. The latter however is documented behavior, and
sixtyfps-viewer for example relies on it.
2021-10-11 16:55:32 +02:00
Robert Broketa
52ff84c0a1 Add changelog entry and move no-frame logic to cpp closure 2021-10-11 10:21:21 +02:00
Robert Broketa
c3c7765f80 Add no-frame property for a borderless/frameless window 2021-10-11 10:21:21 +02:00
Olivier Goffart
b0c87cb089 Fix the middle mouse button with Qt 2021-10-08 17:30:15 +02:00
ogoffart
77fcd5221b Bump version number to 0.1.4 2021-10-07 09:36:43 +00:00
Simon Hausmann
7aa6545046 Enable support for gzipped SVG
usvg detects gzipped SVG by looking at the first bytes, and Qt supports it as well.
2021-10-06 21:24:44 +02:00
Simon Hausmann
7102f9b997 Fix standard button OK text
Ok -> OK
2021-10-06 16:16:39 +02:00
Simon Hausmann
6dce5ab32e Fix rendering of push buttons with QStyle on macOS
The button bevel was rendered upside down, which happens due to some
weird double y-axis inversion, which goes away when passing the QWidget
pointer to the style. When using the Qt backend, we can do that.
2021-10-06 14:39:56 +02:00
Olivier Goffart
db10bf2187 Fix embedded window icon with the Qt backend
Also add a window icon to the gallery
2021-10-06 12:39:22 +02:00
Simon Hausmann
4c6c8233c0 Qt style: Improve default layout spacing on macOS
When the PM_LayoutHorizontalSpacing pixel metric is negative, we're supposed to call
layoutSpacing() on the style. Until we have a detailed
overview over the controls, a default spacing is better than -1 :-)
2021-10-06 11:10:58 +02:00