1

I have a strange problem. When I fix the backgroundColor in a MainView to "#F1E1A3" it doesn't show me the good color since when I draw a rectangle in the page with the same color, I see a difference (see picture). When you fix both to "black" there are no difference. What am I doing wrong? Is a background color clearer than the color you ask? Or is it a bug?

The picture is drawn using the "simple Touch UI" in Qt creator.Image with the color I want in the rectangle and a bad color on the background

import QtQuick 2.0
import Ubuntu.Components 0.1

MainView {
backgroundColor: "#F1E1A3"

width: units.gu(100)
height: units.gu(75)

Page {
    title: i18n.tr("Simple")

    Column {
        spacing: units.gu(1)
        anchors {
            margins: units.gu(2)
            fill: parent
        }

        Button {
            text: i18n.tr("Tap me!")
            color: "#F1E1A3"
        }
    }
}
}
2
  • Could you paste your code somewhere? This might make it easier to spot if there's any typo in the code or if it's an SDK issue. Jul 17, 2013 at 10:11
  • Thank you @DavidPlanella, I've just edited my question. I used the simple example from "Qt creator"
    – londumas
    Jul 17, 2013 at 13:30

1 Answer 1

1

The color of the background is faitful to what you set to backgroundColor. What is not though is Button. Button does some clever uses of the color you give it. Try Rectangle instead of Button and you will see.

2
  • Thank you @Kaleo for your answer but I don't think you're right since the color of a rectangle is the same than the button: Rectangle{ width: units.gu(10) height: units.gu(10) color: "#F1E1A3" } Also, when you set the color to "black", "blue" you don't have a different color between background and button and rectangle. And also the small square displaded when overing the "#F1E1A3" with the mouse has the color of the button and not the background
    – londumas
    Jul 18, 2013 at 1:23
  • I have filled a bug repport because I have tested and the problem only occures with yellow based collor. here is the link
    – londumas
    Jul 19, 2013 at 14:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .