Opened 2 years ago

Closed 23 months ago

Last modified 23 months ago

#14984 closed bug (fixed)

Controlgroup: Classes option is set incorrectly in child widgets

Reported by: Gabriel "_|Nix|_" Schulhof Owned by: Alexander Schmitz
Priority: blocker Milestone: git
Component: ui.controlgroup Version: git (not yet released)
Keywords: Cc:
Blocked by: Blocking:

Description

There are two problems:

  1. When the controlgroup instantiates a child widget, it does not consult the default classes option for that widget class when computing the options with which to instantiate the widget because it cannot find a widget instance from which to retrieve the default classes option.

The solution: If no instance is found, first instantiate the widget with default options, then retrieve the options and use them to compute the needed classes option.

  1. The variable used to store the per-instance options inside _initWigdets() has a per-widget-class scope rather than a per-widget-instance scope and it is being modified at each instance. So, if a non-corners-related class is present at a class key, it gets copied over and over inside the class key's value as many times as there are widgets of that class inside the controlgroup.

The solution: Clone the value of the variable established at the per-widget-class scope (options) into a new variable used at the per-instance scope (instanceOptions). Then, only the per-instance-scoped variable will be modified and it will be re-declared at the iteration for the next instance.

Change History (3)

comment:1 Changed 2 years ago by Scott González

Milestone: none1.12.0
Priority: minorblocker
Status: newopen

comment:2 Changed 23 months ago by Alexander Schmitz

Owner: set to Alexander Schmitz
Resolution: fixed
Status: openclosed

In 3a9a3c7:

Controlgroup: Correctly handle non-empty child class key

Fixes #14984
Closes gh-1713

comment:3 Changed 23 months ago by Scott González

Milestone: 1.12.0git
Note: See TracTickets for help on using tickets.