Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual Console - Background image is applied to all components (frames, buttons, clocks etc) #1312

Open
universe-42 opened this issue Jan 13, 2022 · 7 comments

Comments

@universe-42
Copy link

universe-42 commented Jan 13, 2022

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:

  1. Open project file (see link bellow)
  2. Change Background to default for any component in Virtual console
  3. Save, close and open project again
  4. 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

@mcallegari
Copy link
Owner

mcallegari commented Jan 14, 2022

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.

@universe-42
Copy link
Author

universe-42 commented Jan 25, 2022

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 :(

@mcallegari
Copy link
Owner

Thanks, much clearer now
Will look into this

@mcallegari
Copy link
Owner

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

@universe-42
Copy link
Author

universe-42 commented Jan 26, 2022

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...

@mcallegari
Copy link
Owner

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)

@hjtappe
Copy link
Contributor

hjtappe commented Jan 30, 2022

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants