~feng-kylin/youker-assistant/youker-assistant

« back to all changes in this revision

Viewing changes to qml/func/others/ToolsDelegate.qml

  • Committer: kobe
  • Date: 2015-02-13 07:37:10 UTC
  • Revision ID: xiangli@ubuntukylin.com-20150213073710-0jyp02ilyi5njj10
Qt Version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2013 ~ 2014 National University of Defense Technology(NUDT) & Kylin Ltd.
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or modify
5
 
 * it under the terms of the GNU General Public License as published by
6
 
 * the Free Software Foundation; version 3.
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 General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 */
16
 
 
17
 
import QtQuick 1.1
18
 
import "../common" as Common
19
 
 
20
 
Rectangle {
21
 
    id: scaleMe
22
 
//    scale: 0.0
23
 
    scale: 1
24
 
    Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} }
25
 
    width: 78
26
 
    height: 82
27
 
    SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
28
 
    color: "transparent"
29
 
 
30
 
    Column {
31
 
        anchors.fill: parent
32
 
        anchors.topMargin: 15
33
 
        spacing: 10
34
 
        Image {
35
 
            id: seticon
36
 
            source: icon
37
 
            anchors.horizontalCenter: parent.horizontalCenter
38
 
        }
39
 
        Text {
40
 
            id: btnText
41
 
            anchors.horizontalCenter: parent.horizontalCenter
42
 
            font.pixelSize: 12
43
 
            color: "#383838"
44
 
            text: name
45
 
        }
46
 
    }
47
 
 
48
 
    Image {
49
 
        id: btnImg
50
 
        anchors.fill: parent
51
 
        source: ""
52
 
    }
53
 
 
54
 
    MouseArea {
55
 
        id: signaltest
56
 
        hoverEnabled: true
57
 
        anchors.fill: parent
58
 
        onEntered: btnImg.source = "../../img/toolWidget/box-hover.png"//btnImg.source = "../../img/toolWidget/menu_hover.png"
59
 
        onPressed: btnImg.source = "../../img/toolWidget/menu_press.png"
60
 
        //要判断松开是鼠标位置
61
 
        onReleased: btnImg.source = "../../img/toolWidget/box-hover.png"//btnImg.source = "../../img/toolWidget/menu_hover.png"
62
 
        onExited: btnImg.source = ""
63
 
        onClicked: {
64
 
            //屏幕坏点检测
65
 
            if (flag == "CheckScreen") {
66
 
                sessiondispatcher.showCheckscreenDialog();
67
 
            }
68
 
            else if (flag == "Desktopicon") {
69
 
                pageStack.push(Qt.resolvedUrl("../settings/DesktopIcon.qml"));
70
 
            }
71
 
            else if (flag == "BootAnimation") {
72
 
                pageStack.push(Qt.resolvedUrl("../settings/BootAnimation.qml"));
73
 
            }
74
 
            else if (flag == "CameraCapture") {
75
 
                if (sessiondispatcher.judge_camera_qt()) {
76
 
                    pageStack.push(Qt.resolvedUrl("../settings/CameraCapture.qml"));
77
 
                }
78
 
                else {
79
 
                    toolkits.alertMSG(qsTr("No found camera!"));
80
 
                }
81
 
            }
82
 
            else if (flag == "MousePointer") {
83
 
                pageStack.push(Qt.resolvedUrl("../settings/MousePointer.qml"));
84
 
            }
85
 
            else if (flag == "TouchpadSet") {
86
 
                pageStack.push(Qt.resolvedUrl("../settings/TouchpadSet.qml"));
87
 
            }
88
 
            //kobe:选中项深色块移动
89
 
//            scaleMe.GridView.view.currentIndex = index;
90
 
        }
91
 
    }
92
 
}