mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-23 22:58:15 +00:00
feat(Form/CheckBoxText): use style file
This commit is contained in:
parent
bcf304f1b4
commit
6fa3026ca5
5 changed files with 61 additions and 25 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -1,35 +1,54 @@
|
|||
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
|
||||
|
||||
Rectangle {
|
||||
color: checkBox.down ? '#FE5E00' : '#8E8E8E'
|
||||
height: 10
|
||||
radius: 2
|
||||
visible: checkBox.checked
|
||||
width: 10
|
||||
x: 4
|
||||
y: 4
|
||||
}
|
||||
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
|
||||
? 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.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
15
tests/ui/modules/Linphone/Styles/Form/CheckBoxTextStyle.qml
Normal file
15
tests/ui/modules/Linphone/Styles/Form/CheckBoxTextStyle.qml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
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'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue