Bug report #12973

layer panel's symbol are drawn with excessive width if they are located >=2nd-level of a rule-based tree

Added by Mathieu Pellerin - nIRV over 8 years ago. Updated over 6 years ago.

Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:worksforme
Crashes QGIS or corrupts data:No Copied to github as #:21051


The layer panel will draw symbols for polygons located in 2nd level of a rule-based tree with a width twice a large as normal. It's a bit difficult to explain in words, but the attached screenshot (bug-legend.png) should make it easy to understand.

Steps to reproduce:
  1. Create a new project
  2. Add a polygon dataset
  3. Open the layer property window, and set the symbology to rule-based
  4. Add a root rule (simple fill), add a sub-rule to that root rule (also simple fill), and apply the symbology
  5. Look at your layer panel, you'll notice the sub-rule legend symbol's width is abnormally large

It's not a huge issue, but for people who like to keep the layer panel a small as possible, the extra space taken by the legend symbol's extra width is unfortunate.

bug-legend.png (361 KB) Mathieu Pellerin - nIRV, 2015-06-15 09:36 PM

layers.png (31.1 KB) Johannes Kroeger, 2017-08-02 10:19 PM


#1 Updated by Giovanni Manghi almost 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#2 Updated by Johannes Kroeger over 6 years ago

I cannot confirm this bug in QGIS 2.18.11.

I loaded NE countries.
Added a rule on "labelrank" = 3 with a simple fill.
Used "Refine selected rules" -> "Add categories to rule" (which I guess nIRV meant by sub-rule) on the level attribute. Also used a simple fill.

All style "icons" in the layer tree look square and the same size.

#3 Updated by Giovanni Manghi over 6 years ago

  • Description updated (diff)
  • Status changed from Open to Feedback

#4 Updated by Mathieu Pellerin - nIRV over 6 years ago

  • Resolution set to worksforme
  • Status changed from Feedback to Closed

Also available in: Atom PDF