Bug report #9498
legend item vertical spacing (once again) broken for layers set to hidden
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||18089|
A regression slipped into QGIS master with regards to composer legend item's vertical spacing of layers set to hidden. Prior to 2.0 launch, work was done to allow for proper vertical spacing of layers for a simple scenario: for the vertical spacing between a multi-item layer (i.e. categorized layer) and a single-item layer (i.e. single symbol layer) to be equal. It's now broken again under QGIS master.
I've attached a screenshot showing the problem as well as a simple project to test this out.
Assigning to Radim who did a great job fixing this before 2.0, apologies if the assignment is wrong :)
#2 Updated by Mathieu Pellerin - nIRV about 6 years ago
- Priority changed from Normal to Severe/Regression
Marking as blocker since it's a regression.
In 2.0, the user could do this:
- Empty layer title string, which would remove the layer title row within the legend item.
- Set the layer title type to group or subgroup, and have the group or subgroup spacing set to 0
In the latest QGIS master, it's now impossible to have an empty layer title string, preventing users from relying on the above-mentioned workaround.
#4 Updated by Mathieu Pellerin - nIRV about 6 years ago
- File spacing-ok-selection-not.png added
If I re-enable the if ( currentLegendItem->style() != QgsComposerLegendStyle::Hidden ) condition, the legend's vertical spacing of hidden layer title acts as (IMO) one would expect (see attached screenshot).
The zebra selection outline is however broken (as shown in same screenshot).
#5 Updated by Mathieu Pellerin - nIRV about 6 years ago
- File proper_spacing_hidden_layer.patch added
Radim, I got something that seems to work OK, attaching the diff patch.
I've tested it using a bunch of layer item (group, subgroup, hidden) combinations, as well as multi-column, and all worked ok over here.
#7 Updated by Radim Blazek about 6 years ago
I am not sure the fix is OK. Basically each row in legend is a nucleon, group of nucleons is atom. Layer item is a nucleon and it should really be added only if it is not hidden. The fix adds the title as nucleon but does not render it. I believe that it should not be added at all. I'll look at it once more.