qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.63k stars 3.01k forks source link

Add option to sync (or not) map layout and project background colors #49153

Open cupain opened 2 years ago

cupain commented 2 years ago

What is the bug or the crash?

If the backgroung colour of the project is changed while a composer layout has been created yet, the colour is not updated in the composer. The map in the composer has to be deleted and created one more time.

Steps to reproduce the issue

  1. Create a QGIS project
  2. Import a layer
  3. Create a composer layout (named Layout_1)
  4. Add a map in the composer
  5. Go back to the project, and change the background colour (Project --> Properties)
  6. Open the Layout_1 composer
  7. Refresh the layers / maps --> the background colour is not updated with the new colour

Versions

Version de QGIS | 3.16.11-Hannover | Révision du code | 26cc1c76 -- | -- | -- | -- Compilé avec Qt | 5.15.2 | Utilisant Qt | 5.15.2 Compilé avec GDAL/OGR | 3.3.1 | Utilisé avec GDAL/OGR | 3.3.1 Compilé avec GEOS | 3.9.1-CAPI-1.14.2 | Utilisé avec GEOS | 3.9.1-CAPI-1.14.2 Compilé avec SQLite | 3.35.2 | Fonctionne avec SQLite | 3.35.2 Version du client PostgreSQL | 13.0 | Version de SpatiaLite | 5.0.1 Version de QWT | 6.1.3 | Version de QScintilla2 | 2.11.5 Compilé avec PROJ | 8.1.1 | Fonctionne avec PROJ | Rel. 8.1.1, September 1st, 2021 Version de l'OS | Windows 10 Version 2009 Extensions Python actives | cadastre; GeometryShapes; openlayers_plugin; QRectangleCreator; db_manager; MetaSearch; processing Version de QGIS 3.16.11-Hannover Révision du code [26cc1c76](https://github.com/qgis/QGIS/commit/26cc1c76) Compilé avec Qt 5.15.2 Utilisant Qt 5.15.2 Compilé avec GDAL/OGR 3.3.1 Utilisé avec GDAL/OGR 3.3.1 Compilé avec GEOS 3.9.1-CAPI-1.14.2 Utilisé avec GEOS 3.9.1-CAPI-1.14.2 Compilé avec SQLite 3.35.2 Fonctionne avec SQLite 3.35.2 Version du client PostgreSQL 13.0 Version de SpatiaLite 5.0.1 Version de QWT 6.1.3 Version de QScintilla2 2.11.5 Compilé avec PROJ 8.1.1 Fonctionne avec PROJ Rel. 8.1.1, September 1st, 2021 Version de l'OS Windows 10 Version 2009 Extensions Python actives cadastre; GeometryShapes; openlayers_plugin; QRectangleCreator; db_manager; MetaSearch; processing ### Supported QGIS version - [X] I'm running a supported QGIS version according to the roadmap. ### New profile - [ ] I tried with a new QGIS profile ### Additional context _No response_
baswein commented 2 years ago

Have you seen the conversation in this issue? https://github.com/qgis/QGIS/issues/48931

baswein commented 2 years ago

Because this is the second time this has come up recently and it seems that the layout background following the project background is the expected behavior perhaps it makes sense to change this to a feature request. I could see this being solved either by:

  1. Adding an option in the background color of the Map Item property to follow the project background color. (this could be on by default)
  2. Exposing the project background color as a data defined variable in expressions (unless it is already available and I am missing it)
  3. Adding data defined functionality to the project color picker so you could set both to a named color. This would also allow you to make the background color change depending on other factors.
  4. All of the above :)
cupain commented 2 years ago

I missed that discussion, sorry. Indeed, because when we add a map to the print layout, the project background color is automatically used in the layout, I expect the color to be updated in the layout when it is changed in the project. I think the background color of the layout should either always follow the color of the project, or never follow it. The actual behavior is a bit confusing

baswein commented 2 years ago

No problem- Would you consider changing the title of this to something like: Add option to sync map/project background colors.