Commit Graph

32 Commits

Author SHA1 Message Date
Samuel Ghinet
b9b2121ae1 QmlDesigner: Show a placeholder text in the Content Library when empty
When QDS starts for the first time, and there is no internet connection
(to download the materials bundle and the textures bundle), tell the
user that the problem might be the internet connection.

Task-number: QDS-9539
Change-Id: I81311bf00c830b76019e0edb53eeb980362a1339
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2023-03-30 09:12:28 +00:00
Mahmoud Badri
0b79db5c17 QmlDesigner: Close section's context-menu on view focus out
When clicking outside any view that has sections and a section's
context-menu is visible, it is now closed.

Fixes: QDS-9564
Change-Id: I73cd3a9754c5a18360427525a2a943c2c549e83f
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2023-03-30 07:31:24 +00:00
Samuel Ghinet
77720c1122 Download textures and materials only by clicking the download icon
Previously, clicking the texture thumbnail itself would start the
download.

Also, improved the look of the download icon:
* added a margin to the right
* the inside "arrow" is now black, instead of transparent

Task-number: QDS-9398
Change-Id: I58f958493f1c6072a57402288ea155135909e117
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2023-03-27 17:59:05 +00:00
Tim Jenßen
feabda3aa7 Merge remote-tracking branch 'origin/10.0' into qds/dev
bigger conflicts resolved at:
  src/plugins/qmldesigner/CMakeLists.txt
  src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I08e2a109d8e37cbd77225129854e9e633725bfc7
2023-03-26 16:26:18 +02:00
Samuel Ghinet
98be6d289f Make Content Library Materials downloadable
Task-number: QDS-9267
Change-Id: Ib4da1871cd1d9f0bf52323793b7d8d1b028ae170
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2023-03-21 12:30:31 +00:00
Miikka Heikkinen
15ebc22aeb QmlDesigner: Allow setting Section category
Section collapse all and expand all functionalities are controlled via
a singleton instance. Since multiple views are now sharing QML engine,
they also share this controller singleton. Therefore it is necessary
to allow user of the Section to specify which category the section
belongs to, so that invoking expand all from one view doesn't
expand sections in another view, but only sections in the same
category.

This also allows fine tuning which sections are grouped within a view,
which was not possible previously.

Fixes: QDS-9248
Change-Id: I0a1c870e6746580255a02f91d590eb80ce6ebcbe
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-13 08:34:54 +00:00
Mahmoud Badri
a0df1fd61a QmlDesigner: Allow changing downloaded textures path
For now changing the path triggers the "restart needed" dialog. Some
refactoring (for future) is needed to make the change works right away.

Also added few missing ContentLibraryBackend uses.

Fixes: QDS-9233
Change-Id: I3a576d397b0452a70d9940edaaa38193c41af347
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2023-03-09 11:47:01 +00:00
Mahmoud Badri
e3b37edb15 QmlDesigner: Fix adding bundle material from context menu
Was broken by 57448021b8

Change-Id: Id4822b75038dadac6c898191bce2b4f60de79232
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2023-03-09 09:30:39 +00:00
Thomas Hartmann
fb685307f9 QmlDesigner: Use StudioQuickWidget in content library
The event filter has to be installed on the actual QQuickWidget.
Using registerPropertyMap instead of global context properties.

Task-number: QDS-9124
Change-Id: I148ecc6b489f6d72d80a345aa195f74676a92d51
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2023-03-09 08:10:12 +00:00
Miikka Heikkinen
333ebb5bc2 QmlDesigner: Fix content library textures tooltip width
Width calculation didn't account for possible status text.

Change-Id: I58378a2dd185ea9ad47459ce107c1c227c2f6fd8
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-07 14:24:47 +00:00
Miikka Heikkinen
9a55bb0fd0 QmlDesigner: Take content library texture metadata file in use
Metadata file texture_bundle.json will be included with bundle icons,
and it contains details about the texture (format, dimensions, and size)
that are useful to know before downloading the texture.

Metadata is used to generate proper tooltip for non-downloaded textures
in content library.

Also removed default suffix from displayed filename in case metadata is
missing, as it was misleading.

Fixes: QDS-9230
Change-Id: Icbe0bbb7f1e663e0adc41d379231b7f41dc79e31
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-06 12:22:54 +00:00
Samuel Ghinet
6c8d75e690 QmlDesigner: Fix textures becoming misaligned in a search
When doing a search, some textures appeared misaligned. This was caused
by the fact that the "invisible" (i.e. hidden) textures had their Image
set correctly as invisible but the delegate itself remained visible.

Task-number: QDS-9234
Change-Id: Ia2cd6f4f6795bb435567b8915e770b78461babed
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2023-02-23 09:55:00 +00:00
Henning Gruendl
5c9758a104 QmlDesigner: Fix SearchBox resizing
Task-number: QDS-9235
Change-Id: I8802582f5a1574961dfbffdb599b1e10192bc196
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2023-02-22 15:01:30 +00:00
Samuel Ghinet
f45080e619 QmlDesigner: Don't show the context menu for not-downloaded textures
Task-number: QDS-9227
Change-Id: I1f0c147e2dfd69bee9da0872b15d796741b57609
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2023-02-21 12:41:46 +00:00
Samuel Ghinet
bf61be5cc0 QmlDesigner: Allow texture download only via left mouse button
Previously, the user would have downloaded the real texture even when
clicking with the right mouse button.

Task-number: QDS-9226
Change-Id: I4040cda4a8c541edc12b4bfe821a09c76eb7efc4
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2023-02-21 12:38:48 +00:00
Samuel Ghinet
87f76d9bfa QmlDesigner: Fix downloading textures no longer working after some clicks
A "locking" mechanism was implemented to prevent multiple textures from
being downloaded at the same time. However, there was a mistake made,
which made it so that when a texture that had already been downloaded
was clicked again, this locking would be enforced and not released.

Also, fixed minor issues:
* The download button now has a black outline, so as to better
distinguish it inside black-and-white textures
* Canceling the download of a texture no longer marks the download as
failed -- it should show it as if the download was never attempted.
* Fixed tooltips not showing the texture size for downloaded textures
- and now we also update the tooltip text after the real texture has been
downloaded.
* Always creating the "target path" in the FileExtractor, if it does not
exist -- this is different from the "target folder" name, which is an
folder that can optionally be created inside this "target path"

Task-number: QDS-8664
Change-Id: Ieac0e81a5595a8bff3d1aa7ff6252e16c2509c2e
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2023-02-21 11:47:01 +00:00
Samuel Ghinet
1a6cc6fa5e QmlDesigner: Make ContentLibrary textures downloadable
At this point the textures_bundle is still required, but only because
of the icons of the textures. Also, some changes should be done for the
visuals of the downloading.

Also, did a fix in FileDownloader: In case the URL given does not look
to be an image file, we should cancel the download instead of treating
it as a zip archive--it can be that eg we were redirected to a sign-in
page and we don't want to download the content of the page and save it
as a zip file.

Task-number: QDS-8664
Change-Id: Iec40e540c116030288df76e1922eab56ba323d1e
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2023-02-20 12:28:44 +00:00
Henning Gruendl
fbb79bb4e4 QmlDesigner: Fix SearchBox related QML toolbars
Change-Id: I88962fe48acd4345c29233cb00f72ec2ac6b6ca9
Reviewed-by: Brook Cronin <brook.cronin@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-02-15 10:59:03 +00:00
Brook Cronin
28bb9d7d72 QmlDesigner: Add toolbar to content library
Change-Id: I28045fdd0346ad08d9636c25c3942a3facaf00fe
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2023-02-13 10:50:18 +00:00
Mahmoud Badri
ce1092ea50 QmlDesigner: Fix content library autoscrolls after drag-n-drop
Fixes: QDS-8711
Change-Id: I1ca399928a299d4917814bf651a8291b981f0f32
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2023-02-07 11:56:26 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Mahmoud Badri
e4af787ff6 QmlDesigner: Add image info to content library texture tooltip
Fixes: QDS-8489
Change-Id: I1afbf91ad12839cc93a46f0a608ab3bda135b76b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-12-20 11:29:30 +00:00
Miikka Heikkinen
df622c9c3c QmlDesigner: Fix expand all and collapse all in content library
Fixes: QDS-8413
Change-Id: I98931c52f63bbbfd7a42e522a762d77b469df5da
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-12-09 13:27:25 +00:00
Mahmoud Badri
2987f5a96c QmlDesigner: Show content library material + button only on hover
Fixes: QDS-8486
Change-Id: I2207e6558d2124bd9f602e6571ac3958da3c9cdf
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-12-05 12:14:47 +00:00
Miikka Heikkinen
57448021b8 QmlDesigner: Fix content library visibility logic
Also fix enable logic of context menus in content library.

Fixes: QDS-8446
Change-Id: I82f80779f507aa5336ebafac5cffc36365238fc5
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-02 08:19:56 +00:00
Mahmoud Badri
b5befc6945 QmlDesigner: Fix content library sections not collapsing after search
Also enabled the auto expand for textures and environments tabs

Fixes: QDS-8443
Change-Id: I190f919ccb2cff90c7cd151e65b77ebd52f0a87c
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-11-29 14:55:31 +00:00
Miikka Heikkinen
34b966c21d QmlDesigner: Show informative message when texture library is not found
Fixes: QDS-8444
Change-Id: Ief36595fda27b075ef3362d6f393655c56fd9940
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-11-29 12:03:28 +00:00
Miikka Heikkinen
26c1747ae6 QmlDesigner: Fix issues with adding texture as light probe
Changed resolving the currently active scene environment to be done
on demand instead of trying to track it realtime, since resolving it
is relatively cheap operation, so it doesn't cause noticeable delay
at context menu opening. The alternative would be to implement multiple
different notification handlers in ContentLibraryView, which would slow
down all operations and would be much more complex to ensure all edge
cases are covered.

Fixes: QDS-8437
Change-Id: Ib33cd1ad549d836b9d780f9b0f92e70d223e2a25
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-29 11:06:54 +00:00
Mahmoud Badri
397e5f3022 QmlDesigner: Prevent content lib scroll when context-menu is open
Fixes: QDS-8441
Change-Id: Idfc3400fac43668d14cd5ff85cb42d745ef97dfe
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-11-28 15:42:45 +00:00
Mahmoud Badri
4b6b81cd76 QmlDesigner: Fix content library material unimport
Change-Id: I3737682b578cdd991ca761da92cfdcc5506b3629
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-11-21 14:17:25 +00:00
Mahmoud Badri
bb64505cab QmlDesigner: Implement adding a bundle texture as light probe
Fixes: QDS-8205
Change-Id: Icb57287fa36df5d44d59ffc64e26fa3d778d24d6
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-11-10 12:13:58 +00:00
Mahmoud Badri
d5a7f25e60 QmlDesigner: Implement content library view
Fixes: QDS-8058
Fixes: QDS-8059
Change-Id: I1adfdc7ac15141e010467813ec6e673060269241
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-11-08 10:04:43 +00:00