plasma-framework/declarativeimports/test/gallery/CheckableButtons.qml

130 lines
3.3 KiB
QML
Raw Normal View History

/*
* Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* 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 General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
2012-02-05 02:02:55 +01:00
import QtQuick 1.1
import org.kde.plasma.components 0.1 as PlasmaComponents
2011-11-09 21:32:45 +01:00
PlasmaComponents.Page {
height: childrenRect.height
property int implicitHeight: childrenRect.height
PlasmaComponents.ToolBarLayout {
id: toolbarlayout
2011-11-09 21:32:45 +01:00
spacing: 5
PlasmaComponents.ToolButton {
text: "ToolButton"
}
2011-11-09 21:32:45 +01:00
PlasmaComponents.CheckBox {
text: "Checkbox in the toolbar"
}
PlasmaComponents.TextField {
text: "hello"
}
Component.onCompleted: {
app.tools = toolbarlayout
}
}
2011-11-09 21:32:45 +01:00
Column {
spacing: 20
2011-11-09 21:32:45 +01:00
Text {
font.pixelSize: 20
text: "Check Box"
}
2011-11-09 21:32:45 +01:00
PlasmaComponents.CheckBox {
width: 140
height: 30
text: "Check Box 1"
onCheckedChanged: {
if (checked)
console.log("CheckBox checked");
else
console.log("CheckBox unchecked");
}
onClicked: {
console.log("CheckBox clicked");
}
}
2011-11-09 21:32:45 +01:00
PlasmaComponents.CheckBox {
height: 30
text: "Disabled"
enabled: false
}
2011-11-09 21:32:45 +01:00
PlasmaComponents.CheckBox {
height: 30
text: ""
}
2011-11-09 21:32:45 +01:00
PlasmaComponents.CheckBox {
height: 30
text: "A loooooooooooooong text"
}
2011-11-09 21:32:45 +01:00
Text {
font.pixelSize: 20
text: "Radio Button"
}
2011-11-09 21:32:45 +01:00
PlasmaComponents.RadioButton {
width: 140
height: 30
text: "RadioButton"
onCheckedChanged: {
if (checked)
console.log("RadioButton Checked");
else
console.log("RadioButton Unchecked");
}
}
2011-11-09 21:32:45 +01:00
PlasmaComponents.Switch { }
2011-11-09 21:32:45 +01:00
Text {
font.pixelSize: 20
text: "Button Row"
}
2011-11-09 21:32:45 +01:00
PlasmaComponents.ButtonRow {
spacing: 20
PlasmaComponents.RadioButton { text: "A" }
PlasmaComponents.RadioButton { text: "B" }
PlasmaComponents.RadioButton { text: "C" }
}
2011-11-09 21:32:45 +01:00
Text {
font.pixelSize: 20
text: "Button Column"
}
2011-11-09 21:32:45 +01:00
PlasmaComponents.ButtonColumn {
spacing: 20
PlasmaComponents.RadioButton { text: "Alice" }
PlasmaComponents.RadioButton { text: "Bob" }
PlasmaComponents.RadioButton { text: "Charles" }
}
}
}