qskinny/examples/buttons/buttons.qml

148 lines
2.7 KiB
QML
Raw Normal View History

2017-07-21 18:21:34 +02:00
import Skinny 1.0 as Qsk
import QtQuick 2.5
import "qrc:/qml"
Qsk.Window
{
id: window
visible: true
width: 600
height: 600
color: "Beige"
2022-04-06 08:41:32 +02:00
Component.onCompleted:
{
// very much standard: we should find a better way
var hint = sizeConstraint();
setMinimumWidth( hint.width )
setMinimumHeight( hint.height )
}
Qsk.Shortcut
2019-04-17 16:30:08 +02:00
{
sequence : "Ctrl+X"
onActivated: console.log( "Ctrl+X" )
}
2017-07-21 18:21:34 +02:00
Qsk.LinearBox
{
orientation: Qt.Horizontal
dimension: 3
2021-11-19 14:05:27 +01:00
//margins: 10 // only possible with Qt <= 6.1
margins { left: 10; top: 10; right: 10; bottom: 10 }
2017-07-21 18:21:34 +02:00
spacing: 10
TestButton
{
text: "Push Me"
focus: true
}
TestButton
{
text: "Disabled"
enabled: false
}
TestButton
{
text: "The quick brown fox jumps over the lazy dog !"
clip: true
textOptions
{
elideMode: Qt.ElideNone
wrapMode: Qsk.TextOptions.WordWrap
}
}
TestButton
{
text: "The <b><font color='red'>quick</font></b> brown fox jumps over the lazy dog !"
textOptions
{
format: Qsk.TextOptions.AutoText
elideMode: Qt.ElideRight
}
onClicked:
{
textOptions.format = textOptions.format === Qsk.TextOptions.AutoText
? Qsk.TextOptions.PlainText : Qsk.TextOptions.AutoText
}
}
TestButton
{
text: "Autorepeater"
autoRepeat: true
autoRepeatDelay: 500
autoRepeatInterval: 200
}
TestButton
{
text: "Check Me"
graphicSource: "image://shapes/Ring/Khaki"
checkable: true
}
TestButton
{
text: "Check Me"
flat: true
checkable: true
}
TestButton
{
text: "Push Me"
flat: true
}
TestButton
{
text: "Disabled"
flat: true
enabled: false
}
2017-07-21 18:21:34 +02:00
TestButton
{
graphicSource: "image://shapes/Diamond/SandyBrown"
shape
2017-07-21 18:21:34 +02:00
{
sizeMode: Qt.RelativeSize
aspectRatioMode: Qt.IgnoreAspectRatio
2017-07-21 18:21:34 +02:00
radius: 100
}
}
TestButton
{
text: "Push Me"
shape
2017-07-21 18:21:34 +02:00
{
sizeMode: Qt.AbsoluteSize
2017-07-21 18:21:34 +02:00
radius: 0.0
}
}
}
Qsk.FocusIndicator
{
}
}