~ubuntu-branches/ubuntu/vivid/qtcreator-plugin-ubuntu/vivid

« back to all changes in this revision

Viewing changes to share/qtcreator/ubuntu/welcome/Link.qml

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Benjamin Zeller
  • Date: 2015-01-30 06:05:59 UTC
  • mfrom: (1.1.81)
  • Revision ID: package-import@ubuntu.com-20150130060559-1kirdtmm6bl6eb26
Tags: 3.1.1+15.04.20150130-0ubuntu1
[ Benjamin Zeller ]
Refactoring of the publish Tab

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2013 Canonical Ltd.
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or modify
5
 
 * it under the terms of the GNU Lesser General Public License as published by
6
 
 * the Free Software Foundation; version 2.1.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful,
9
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
 * GNU Lesser General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU Lesser General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 *
16
 
 * Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com>
17
 
 */
18
 
 
19
 
import QtQuick 2.0
20
 
 
21
 
Rectangle {
22
 
    id: linkRoot
23
 
    width: linkTitle.paintedWidth
24
 
    height: 60
25
 
    color: "transparent"
26
 
    opacity: 0.8
27
 
 
28
 
    property alias title : linkTitle.text
29
 
    property url link
30
 
    property color defaultColor : "#DD4814"
31
 
    property color hoverColor : "#eee"
32
 
 
33
 
    signal clicked()
34
 
 
35
 
    Rectangle {
36
 
        id: background
37
 
        color: hoverColor
38
 
        opacity: 0
39
 
        anchors.fill: parent
40
 
 
41
 
        Behavior on opacity {
42
 
            NumberAnimation { duration: 250 }
43
 
        }
44
 
    }
45
 
 
46
 
    Text {
47
 
        id: linkTitle
48
 
        anchors.centerIn: parent
49
 
        wrapMode: Text.WordWrap
50
 
        width: parent.width - 20
51
 
        font.family: "Ubuntu"
52
 
        font.pixelSize: 20
53
 
        font.letterSpacing: 1.5
54
 
        color: defaultColor
55
 
        font.weight: Font.Light
56
 
        textFormat: Text.RichText
57
 
        text: ""
58
 
    }
59
 
 
60
 
    MouseArea {
61
 
        anchors.fill: parent
62
 
        hoverEnabled: true
63
 
 
64
 
        onEntered: {
65
 
            background.opacity = 1;
66
 
        }
67
 
        onExited: {
68
 
            background.opacity = 0;
69
 
        }
70
 
 
71
 
        onClicked: {
72
 
            if (link !== undefined) Qt.openUrlExternally(link);
73
 
 
74
 
            linkRoot.clicked()
75
 
        }
76
 
        onPressed: {
77
 
            linkTitle.color = Qt.lighter(defaultColor);
78
 
        }
79
 
        onReleased: {
80
 
            linkTitle.color = defaultColor;
81
 
        }
82
 
    }
83
 
 
84
 
}