/usr/lib/x86_64-linux-gnu/qt5/qml/Ubuntu/Components/1.1/Button.qml is in qml-module-ubuntu-components 1.3.1918+16.04.20160404-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | /*
* Copyright 2015 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.4
import Ubuntu.Components 1.1
/*!
\qmltype Button
\inqmlmodule Ubuntu.Components 1.1
\ingroup ubuntu
\brief Standard Ubuntu button.
\l {http://design.ubuntu.com/apps/building-blocks/buttons}{See also the Design Guidelines on Buttons}.
Examples:
\qml
Column {
Button {
text: "Send"
onClicked: print("clicked text-only Button")
}
Button {
iconName: "compose"
gradient: UbuntuColors.greyGradient
onClicked: print("clicked icon-only Button")
}
Button {
iconName: "compose"
text: "Icon on left"
iconPosition: "left"
onClicked: print("clicked text and icon Button")
}
}
\endqml
An \l Action can be used to specify \b clicked, iconSource and text. Example:
\qml
Item {
Action {
id: action1
text: "Click me"
onTriggered: print("action!")
iconName: "compose"
}
Button {
anchors.centerIn: parent
action: action1
color: UbuntuColors.warmGrey
}
}
\endqml*/
AbstractButton {
id: button
/*!
\since Ubuntu.Components 1.1
If set to a color, the button has a stroke border instead of a filled shape.
*/
property color strokeColor: Qt.rgba(0.0, 0.0, 0.0, 0.0)
/*!
\qmlproperty url Button::iconSource
The source URL of the icon to display inside the button.
Leave this value blank for a text-only button.
If \l action is set, the default iconSource is that of the action.
*/
/*!
The text to display in the button. If an icon was defined,
the text will be shown next to the icon, otherwise it will
be centered. Leave blank for an icon-only button.
If \l action is set, the default text is that of the action.
\qmlproperty string Button::text
*/
/*!
The background color of the button.
\sa gradient
*/
property color color: __styleInstance.defaultColor
/*!
The gradient used to fill the background of the button.
Standard Ubuntu gradients are defined in \l UbuntuColors.
If both a gradient and a color are specified, the gradient will be used.
\sa color
*/
property Gradient gradient: __styleInstance.defaultGradient
/*!
The font used for the button's text.
*/
property font font: __styleInstance ? __styleInstance.defaultFont : Qt.font({family: "Ubuntu", pixelSize: FontUtils.sizeToPixels("medium")})
/*!
The position of the icon relative to the text. Options
are "left" and "right". The default value is "left".
If only text or only an icon is defined, this
property is ignored and the text or icon is
centered horizontally and vertically in the button.
Currently this is a string value. We are waiting for
support for enums:
https://bugreports.qt-project.org/browse/QTBUG-14861
*/
property string iconPosition: "left"
style: Theme.createStyleComponent("ButtonStyle.qml", button)
}
|