[applets/batterymonitor] Optimization: avoid creating reference slider
Optimize previous patch that introduced extra margins for the battery's progress bar in order to make its labels visually match the distance of brightness sliders on top of it. This patch moves `referenceSlider` property to the root component of BatteryItem.qml, so that an existing item can be passed from the outside. It keeps the default value there just in case, but it won't be instantiated by QML engine when the property is overriden at component declaration. (Note: this won't be true if the slider had an id set.) Since we are defining some properties on the top-level component, we might as well move the `extraMargin` here, so that the actual ProgressBar component now won't have any properties on its own, and thus QML engine won't create an extra runtime QML type just for it.
Please register or sign in to comment