Skip to content
Verified Commit df9ef9f9 authored by ivan tkachenko's avatar ivan tkachenko 🗯
Browse files

[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.
parent 2aec44fa
Pipeline #102385 passed with stage
in 4 minutes and 33 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment