Commit 6fa3026c authored by Ronan Abhamon's avatar Ronan Abhamon

feat(Form/CheckBoxText): use style file

parent bcf304f1
......@@ -63,6 +63,7 @@
<file>ui/modules/Linphone/Styles/ForceScrollBarStyle.qml</file>
<file>ui/modules/Linphone/Styles/Form/AbstractTextButtonStyle.qml</file>
<file>ui/modules/Linphone/Styles/Form/ActionBarStyle.qml</file>
<file>ui/modules/Linphone/Styles/Form/CheckBoxTextStyle.qml</file>
<file>ui/modules/Linphone/Styles/Form/ExclusiveButtonsStyle.qml</file>
<file>ui/modules/Linphone/Styles/Form/SmallButtonStyle.qml</file>
<file>ui/modules/Linphone/Styles/Form/TextButtonAStyle.qml</file>
......
import QtQuick 2.7
import QtQuick.Controls 2.0
import Linphone.Styles 1.0
// ===================================================================
// Checkbox with clickable text.
// ===================================================================
CheckBox {
contentItem: Text {
color: checkBox.down ? '#FE5E00' : '#8E8E8E'
font: checkBox.font
leftPadding: checkBox.indicator.width + checkBox.spacing
text: checkBox.text
verticalAlignment: Text.AlignVCenter
}
id: checkBox
indicator: Rectangle {
border.color: checkBox.down ? '#FE5E00' : '#8E8E8E'
implicitHeight: 18
implicitWidth: 18
radius: 3
x: checkBox.leftPadding
y: parent.height / 2 - height / 2
id: checkBox
contentItem: Text {
color: checkBox.down
? CheckBoxTextStyle.color.pressed
: (checkBox.hovered
? CheckBoxTextStyle.color.hovered
: CheckBoxTextStyle.color.normal
)
font: checkBox.font
leftPadding: checkBox.indicator.width + checkBox.spacing
text: checkBox.text
verticalAlignment: Text.AlignVCenter
}
hoverEnabled: true
indicator: Rectangle {
border.color: checkBox.down
? CheckBoxTextStyle.color.pressed
: (checkBox.hovered
? CheckBoxTextStyle.color.hovered
: CheckBoxTextStyle.color.normal
)
implicitHeight: CheckBoxTextStyle.size
implicitWidth: CheckBoxTextStyle.size
radius: CheckBoxTextStyle.radius
x: checkBox.leftPadding
y: parent.height / 2 - height / 2
Rectangle {
color: checkBox.down ? '#FE5E00' : '#8E8E8E'
height: 10
radius: 2
visible: checkBox.checked
width: 10
x: 4
y: 4
}
Rectangle {
color: checkBox.down
? CheckBoxTextStyle.color.pressed
: (checkBox.hovered
? CheckBoxTextStyle.color.hovered
: CheckBoxTextStyle.color.normal
)
height: parent.height - y * 2
radius: CheckBoxTextStyle.radius
visible: checkBox.checked
width: parent.width - x * 2
x: 4 // Fixed, no style.
y: 4 // Fixed, no style.
}
}
}
pragma Singleton
import QtQuick 2.7
import Linphone 1.0
QtObject {
property int radius: 3
property int size: 18
property QtObject color: QtObject {
property color pressed: '#FE5E00'
property color hovered: '#6E6E6E'
property color normal: '#8E8E8E'
}
}
......@@ -13,6 +13,7 @@ singleton TimelineStyle 1.0 TimelineStyle.qml
singleton AbstractTextButtonStyle 1.0 Form/AbstractTextButtonStyle.qml
singleton ActionBarStyle 1.0 Form/ActionBarStyle.qml
singleton CheckBoxTextStyle 1.0 Form/CheckBoxTextStyle.qml
singleton ExclusiveButtonsStyle 1.0 Form/ExclusiveButtonsStyle.qml
singleton SmallButtonStyle 1.0 Form/SmallButtonStyle.qml
singleton TextButtonAStyle 1.0 Form/TextButtonAStyle.qml
......
......@@ -275,7 +275,7 @@ ApplicationWindow {
Loader {
Layout.fillHeight: true
Layout.fillWidth: true
source: 'qrc:/ui/views/MainWindow/Contacts.qml'
source: 'qrc:/ui/views/MainWindow/Home.qml'
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment