qlcplus
qlcplus copied to clipboard
Virtual Console - Background image is applied to all components (frames, buttons, clocks etc)
Describe the bug When I have "built" all layout components with cues, frames and many buttons and then decide to change main background (meaning main canvas only) its applied to all (child) components. Then when I go throw individual components and manually change background to default and save workspace project and reopen again the whole changes are lost. Meaning that background image is applied to all components again (even if I change background color of specific frame and so on).
To Reproduce Steps to reproduce the behavior:
- Open project file (see link bellow)
- Change Background to default for any component in Virtual console
- Save, close and open project again
- Changes are not applied
But in .qxw file everything looks valid, button is not.
<Appearance>
<FrameStyle>None</FrameStyle>
<ForegroundColor>Default</ForegroundColor>
<BackgroundColor>Default</BackgroundColor>
<BackgroundImage>None</BackgroundImage>
<Font>Default</Font>
</Appearance>
Expected behavior So as I see there are two issues:
- Apply background image (action from top panel menu) only for main layout layer
- fix saving background image | background color for all components
Project file Project file: https://drive.google.com/file/d/1H2OfFzyGUKYDSWaYKdU0WP_FHjzIuzkM/view?usp=sharing
Desktop (please complete the following information):
- OS: Windows 10 pro
- QLC+ Version 4.12.4
- AMD Ryzen 7 64bit (x64)
Edit I tried the same project also on Ubuntu 21.10 and changing background to default (for components like buttons...) doesn't work at all (when I open project attached above).
Thanks for any help
How do you do this from within QLC+?
Change Background to default for any component in Virtual console
If I change it via text editor in the file it works correctly
Also, changing a frame background color (or image) doesn't apply to its children too.
I am sorry for late. For better explanation please see video: https://drive.google.com/file/d/1XDJUYoFoOYAr_vb4M4uZ3_JWGS-15Xk1/view?usp=sharing
Thanks for any help here
Sorry for the invisible mouse :(
Thanks, much clearer now Will look into this
After a preliminary analysis, it turns out this is an inner Qt behavior. Not quite QLC+ code. Widget's children property propagation is implicit and this is also the reason why resetting background to default doesn't have any effect on project loading. The main virtual console frame propagates the custom background to every child frame and then the "default" background means "do nothing", so they keep the main frame background.
This is more complicated than I thought. Needs more time of investigation
Hmm I see, that in qxw file is everything fine, but as you said the "default value" should be relative to some settings (each for every type of component) and then load specific value when default is set (this can be done completely without any UI for now*).
I would like to help somehow, but i don't know how. But this is extremally low priority issue as it has nothing to do with lights itself.
*latter we can have dialog default settings where we can set all parameters for each component (or groups because some are identical for this case). This giving users extra flexibility for building their Virtual console because they can easily change (for example) fonts for all Frame boxes...
The patch itself is pretty simple but it breaks the current look of many consoles, so I'm not sure if people will be happy about it. I'll keep it here, but if you agree I would delay or abandon this.
diff --git a/ui/src/virtualconsole/vcwidget.cpp b/ui/src/virtualconsole/vcwidget.cpp
index 60413a04d..ff9172360 100644
--- a/ui/src/virtualconsole/vcwidget.cpp
+++ b/ui/src/virtualconsole/vcwidget.cpp
@@ -839,7 +839,9 @@ bool VCWidget::loadXMLAppearance(QXmlStreamReader &root)
else if (root.name() == KXMLQLCVCWidgetBackgroundColor)
{
QString str = root.readElementText();
- if (str != KXMLQLCVCWidgetColorDefault)
+ if (str == KXMLQLCVCWidgetColorDefault)
+ resetBackgroundColor();
+ else
setBackgroundColor(QColor(str.toUInt()));
}
else if (root.name() == KXMLQLCVCWidgetBackgroundImage)
@mcallegari, would it make sense to include this once the version 5 is released as the layout will be somehow different anyways, so a breaking change could be expected for the major version?