Open wxbit opened 6 years ago
Do you observe this phenomenon in the Companion, compiled apps, or both?
Both in the compiled app and the companion, the background color is black when I use dark theme.
Ok, so then your concern is with the designer not reflecting the theme change?
Yes, users will mistake it for a white background, It's actually black.
Maybe should remove the dark theme?
The designer has never been truly WYSIWYG--there are a number of components that don't quite reflect their appearance on the device. That being said, I think this should be an easy enough fix to implement.
I am looking forward to resolving this issue, can I get some direction to where in the code base this is?
@me9Manisha Currently the background color is set on lines 496-503 in components/src/com/google/appinventor/client/editor/simple/components/MockForm.java. Theme setting is handled starting on line 670. Note that the dark theme is controlled by adding/removing a "Dark" style to the form, but in setBackgroundColorProperty we always assume white as the default background color. What we should do instead is remove any existing background color when using the default and let the CSS do the work.
After analyzing both the designer and companion sides very closely for the dark theme I came to the point that the problems in: 1.Companion side The label widget text got invisible only when text color is black but visible with other Text colors. rest is working fine in companion with a dark theme.
2.Designer side In this case, the dark theme is only reflected for buttons, not for others.
according to your suggestion, why do we need to remove the existing one as we have already a statement at line 502 deciding or setting the value for the background?
can't we follow the same concept for other widgets like buttons in the designer side for the dark theme?
The theory behind my suggestion builds on how CSS works. Rules are applied from least specific to most specific (and by order of CSS files, but that's irrelevant here), but styles on elements override any inferred style from CSS. So, we should really define a base style for components, then have the light/dark themes apply the relevant CSS to get that style. Then, when the developer sets a non-default property, we override the default by updating the style on the specific element. This is a more robust approach than needing every MockComponent to be aware of the theme set on the form (and in theory allows for future themes).
.