~ubuntu-branches/ubuntu/quantal/kde-runtime/quantal

« back to all changes in this revision

Viewing changes to plasma/declarativeimports/plasmacomponents/qml/Button.qml

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-06-03 21:50:00 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20120603215000-vn7oarsq0ynrydj5
Tags: upstream-4.8.80
Import upstream version 4.8.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
*/
21
21
 
22
22
 
23
 
/**Documentanted API
 
23
/**Documented API
24
24
Inherits:
25
25
        Item
26
26
 
32
32
        A simple button, with optional label and icon which uses the plasma theme.
33
33
        This button component can also be used as a checkable button by using the checkable
34
34
        and checked properties for that.
35
 
        Plasma theme is the theme which changes via the systemsetting-workspace  appearence
 
35
        Plasma theme is the theme which changes via the systemsetting-workspace appearence
36
36
        -desktop theme.
37
37
 
38
38
Properties:
57
57
 
58
58
      * url iconSource:
59
59
        This property holds the source url for the Button's icon.
60
 
        The default value is an empty url, which displays no icon.
 
60
    The default value is an empty url, which displays no icon.
 
61
    It can be any image from any protocol supported by the Image element, or a freedesktop-compatible icon name
61
62
 
62
63
      * font font:
63
64
        This property holds the font used by the button label.
64
65
        See also Qt documentation for font type.
65
66
 
66
67
Signals:
67
 
      * onClicked:
 
68
      * clicked():
68
69
        This handler is called when there is a click.
69
70
**/
70
71
 
71
72
import QtQuick 1.1
72
73
 
73
74
import org.kde.plasma.core 0.1 as PlasmaCore
 
75
import "private" as Private
74
76
 
75
77
Item {
76
78
    id: button
121
123
                button.checked = !button.checked
122
124
            }
123
125
 
 
126
            button.forceActiveFocus()
124
127
            button.clicked()
125
 
            button.forceActiveFocus()
126
128
        }
127
129
    }
128
130
 
135
137
            internal.clickButton();
136
138
    }
137
139
 
138
 
    ButtonShadow {
 
140
    Private.ButtonShadow {
139
141
        id: shadow
140
142
        anchors.fill: parent
141
143
        state: {
209
211
            bottomMargin: surfaceNormal.margins.bottom
210
212
        }
211
213
 
212
 
        IconLoader {
 
214
        Private.IconLoader {
213
215
            id: icon
214
216
 
215
217
            anchors {
217
219
                left: label.paintedWidth > 0 ? parent.left : undefined
218
220
                horizontalCenter: label.paintedWidth > 0 ? undefined : parent.horizontalCenter
219
221
            }
 
222
            height: roundToStandardSize(parent.height)
 
223
            width: height
220
224
        }
221
225
 
222
226
        Text {