Why isn't my text appearing inside the rectangle even though they have entirely different color? #6879
Answered
by
tronical
timelessnesses
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
tronical
Nov 25, 2024
Replies: 1 comment 2 replies
-
I think it is related to declaring properties and only then assigning into them... If I avoid that it works for me: export component MainWindow inherits Window {
width: 300px;
height: 200px;
in property <color> background-color: black;
in property <color> text-color: cyan;
Rectangle {
background: text-color;
Text {
text: "Pass";
vertical-alignment: center;
color: background-color;
}
}
} This works because it actually changes your example only sets the window background to |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To clarify further:
color: background-color;
for theText
element.in property <color> background-color;
background: black;
. Thereforebackground-color
remains initialised to transparent.background: black;
to