[Qt-qml] Shiny!

alan.westbrook at nokia.com alan.westbrook at nokia.com
Mon Jul 26 20:49:55 CEST 2010


I just realized this can get quite gaudy looking very quickly.

The easiest way to tone down the effect is to set the opacity to something like 0.5

You could also mess with the alpha channel of the effect itself if you want it a consistent shininess, although I notice some colors need more of the effect to show up.

Alan

On Jul 26, 2010, at 11:28 AM, ext alan.westbrook at nokia.com<mailto:alan.westbrook at nokia.com> wrote:

I was messing about with some controls I had written, and I wrote this to see if it might make something look shiny.

And it did!

So I'd like to share it with everyone.

It's pretty much a poor man's shine plastered on top of anything you stick it in.


---8<--- Shine.qml ---8<----------8<----------------------


import Qt 4.7

Rectangle {

    id: shine

    radius: parent.radius - 1

    smooth: true

    gradient: Gradient {

        GradientStop {

            position: 0

            color: "#aaffffff"

        }

        GradientStop {

            position: 1

            color: "#22ffffff"

        }

    }

    anchors.fill: parent

    anchors.bottomMargin: parent.height / 2

    anchors.topMargin: 1

    anchors.leftMargin: 1

    anchors.rightMargin: 1

}

---8<--------------------------8<-----------------------------

Just place a Shine  { } as the last item in an element, and Bam! lickable! =)

Alan

PS: Is there a site yet for sharing qml components?
<ATT00001..txt>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100726/23155ba4/attachment.html 


More information about the Qt-qml mailing list