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

feat(Form/CheckBoxText): use style file

parent bcf304f1
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
<file>ui/modules/Linphone/Styles/ForceScrollBarStyle.qml</file> <file>ui/modules/Linphone/Styles/ForceScrollBarStyle.qml</file>
<file>ui/modules/Linphone/Styles/Form/AbstractTextButtonStyle.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/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/ExclusiveButtonsStyle.qml</file>
<file>ui/modules/Linphone/Styles/Form/SmallButtonStyle.qml</file> <file>ui/modules/Linphone/Styles/Form/SmallButtonStyle.qml</file>
<file>ui/modules/Linphone/Styles/Form/TextButtonAStyle.qml</file> <file>ui/modules/Linphone/Styles/Form/TextButtonAStyle.qml</file>
......
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import Linphone.Styles 1.0
// =================================================================== // ===================================================================
// Checkbox with clickable text. // Checkbox with clickable text.
// =================================================================== // ===================================================================
CheckBox { CheckBox {
contentItem: Text { id: checkBox
color: checkBox.down ? '#FE5E00' : '#8E8E8E'
font: checkBox.font contentItem: Text {
leftPadding: checkBox.indicator.width + checkBox.spacing color: checkBox.down
text: checkBox.text ? CheckBoxTextStyle.color.pressed
verticalAlignment: Text.AlignVCenter : (checkBox.hovered
} ? CheckBoxTextStyle.color.hovered
id: checkBox : CheckBoxTextStyle.color.normal
indicator: Rectangle { )
border.color: checkBox.down ? '#FE5E00' : '#8E8E8E' font: checkBox.font
implicitHeight: 18 leftPadding: checkBox.indicator.width + checkBox.spacing
implicitWidth: 18 text: checkBox.text
radius: 3 verticalAlignment: Text.AlignVCenter
x: checkBox.leftPadding }
y: parent.height / 2 - height / 2 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 { Rectangle {
color: checkBox.down ? '#FE5E00' : '#8E8E8E' color: checkBox.down
height: 10 ? CheckBoxTextStyle.color.pressed
radius: 2 : (checkBox.hovered
visible: checkBox.checked ? CheckBoxTextStyle.color.hovered
width: 10 : CheckBoxTextStyle.color.normal
x: 4 )
y: 4 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 ...@@ -13,6 +13,7 @@ singleton TimelineStyle 1.0 TimelineStyle.qml
singleton AbstractTextButtonStyle 1.0 Form/AbstractTextButtonStyle.qml singleton AbstractTextButtonStyle 1.0 Form/AbstractTextButtonStyle.qml
singleton ActionBarStyle 1.0 Form/ActionBarStyle.qml singleton ActionBarStyle 1.0 Form/ActionBarStyle.qml
singleton CheckBoxTextStyle 1.0 Form/CheckBoxTextStyle.qml
singleton ExclusiveButtonsStyle 1.0 Form/ExclusiveButtonsStyle.qml singleton ExclusiveButtonsStyle 1.0 Form/ExclusiveButtonsStyle.qml
singleton SmallButtonStyle 1.0 Form/SmallButtonStyle.qml singleton SmallButtonStyle 1.0 Form/SmallButtonStyle.qml
singleton TextButtonAStyle 1.0 Form/TextButtonAStyle.qml singleton TextButtonAStyle 1.0 Form/TextButtonAStyle.qml
......
...@@ -275,7 +275,7 @@ ApplicationWindow { ...@@ -275,7 +275,7 @@ ApplicationWindow {
Loader { Loader {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: 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