mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-29 01:39:19 +00:00
SearchFields : Add an option to display a mandatory star on fields.
Reduce text size if icon is visible.
This commit is contained in:
parent
c82b2b8a36
commit
97d8bbd03f
4 changed files with 36 additions and 6 deletions
|
|
@ -15,6 +15,7 @@ Controls.TextField {
|
|||
|
||||
property alias icon: icon.icon
|
||||
property alias iconSize: icon.iconSize
|
||||
property bool isMandatory: false
|
||||
property alias overwriteColor: icon.overwriteColor
|
||||
property string error: ''
|
||||
property var tools
|
||||
|
|
@ -72,7 +73,7 @@ Controls.TextField {
|
|||
|
||||
color: textField.readOnly ? textFieldStyle.text.readOnly : textFieldStyle.text.normal
|
||||
font.pointSize: textFieldStyle.text.pointSize
|
||||
rightPadding: textFieldStyle.text.rightPadding + toolsContainer.width
|
||||
rightPadding: textFieldStyle.text.rightPadding + toolsContainer.width + (icon.visible ? icon.iconSize + 10: 0)
|
||||
selectByMouse: true
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -82,12 +83,23 @@ Controls.TextField {
|
|||
|
||||
anchors {
|
||||
right: parent.right
|
||||
rightMargin: parent.rightPadding
|
||||
rightMargin: 10
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
iconSize: parent.contentHeight
|
||||
visible: showWhenEmpty && !parent.text || !showWhenEmpty && parent.text
|
||||
|
||||
Text{
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 5
|
||||
textFormat: Text.RichText
|
||||
text : '<span style="color:red">*</span>'
|
||||
color: textFieldStyle.background.mandatory.color
|
||||
font.pointSize: textFieldStyle.background.mandatory.pointSize
|
||||
visible: textField.isMandatory
|
||||
}
|
||||
MouseArea{
|
||||
anchors.fill: parent
|
||||
onClicked: textField.iconClicked()
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ Item {
|
|||
property alias placeholderText: searchField.placeholderText
|
||||
property alias tooltipText : tooltip.text
|
||||
property alias text : searchField.text
|
||||
property alias isMandatory: searchField.isMandatory
|
||||
|
||||
default property alias _content: menu._content
|
||||
|
||||
|
|
|
|||
|
|
@ -28,13 +28,17 @@ QtObject {
|
|||
property color normal: ColorsList.add(sectionName+'_n_bg_n', 'q').color
|
||||
property color readOnly: ColorsList.add(sectionName+'_n_bg_readonly', 'e').color
|
||||
}
|
||||
property QtObject mandatory: QtObject{
|
||||
property color color: ColorsList.add(sectionName+'_required_text', 'g').color
|
||||
property real pointSize: Units.dp * 10
|
||||
}
|
||||
}
|
||||
|
||||
property QtObject text: QtObject {
|
||||
property color normal: ColorsList.add(sectionName+'_n_text', 'd').color
|
||||
property color readOnly: ColorsList.add(sectionName+'_n_text_readonly', 'd').color
|
||||
property int pointSize: Units.dp * 10
|
||||
property int rightPadding: 10
|
||||
property int rightPadding: 5
|
||||
}
|
||||
}
|
||||
property QtObject unbordered : QtObject {
|
||||
|
|
@ -58,13 +62,17 @@ QtObject {
|
|||
property color normal: ColorsList.add(sectionName+'_unbordered_bg_n', 'q').color
|
||||
property color readOnly: ColorsList.add(sectionName+'_unbordered_bg_readonly', 'e').color
|
||||
}
|
||||
property QtObject mandatory: QtObject{
|
||||
property color color: ColorsList.add(sectionName+'_unbordered_required_text', 'g').color
|
||||
property real pointSize: Units.dp * 10
|
||||
}
|
||||
}
|
||||
|
||||
property QtObject text: QtObject {
|
||||
property color normal: ColorsList.add(sectionName+'_unbordered_text', 'd').color
|
||||
property color readOnly: ColorsList.add(sectionName+'_unbordered_text_readonly', 'd').color
|
||||
property int pointSize: Units.dp * 10
|
||||
property int rightPadding: 10
|
||||
property int rightPadding: 5
|
||||
}
|
||||
}
|
||||
property QtObject flat : QtObject {
|
||||
|
|
@ -88,13 +96,17 @@ QtObject {
|
|||
property color normal: ColorsList.add(sectionName+'_flat_bg_n', 'q').color
|
||||
property color readOnly: ColorsList.add(sectionName+'_flat_bg_readonly', 'e').color
|
||||
}
|
||||
property QtObject mandatory: QtObject{
|
||||
property color color: ColorsList.add(sectionName+'_flat_required_text', 'g').color
|
||||
property real pointSize: Units.dp * 10
|
||||
}
|
||||
}
|
||||
|
||||
property QtObject text: QtObject {
|
||||
property color normal: ColorsList.add(sectionName+'_flat_text', 'd').color
|
||||
property color readonly: ColorsList.add(sectionName+'_flat_text_readonly', 'd').color
|
||||
property int pointSize: Units.dp * 10
|
||||
property int rightPadding: 10
|
||||
property int rightPadding: 5
|
||||
}
|
||||
}
|
||||
property QtObject flatInverse : QtObject {
|
||||
|
|
@ -118,13 +130,17 @@ QtObject {
|
|||
property color normal: ColorsList.add(sectionName+'_flat_inv_bg_n', 'q').color
|
||||
property color readOnly: ColorsList.add(sectionName+'_flat_inv_bg_readonly', 'q').color
|
||||
}
|
||||
property QtObject mandatory: QtObject{
|
||||
property color color: ColorsList.add(sectionName+'_flat_inv_required_text', 'g').color
|
||||
property real pointSize: Units.dp * 10
|
||||
}
|
||||
}
|
||||
|
||||
property QtObject text: QtObject {
|
||||
property color color: ColorsList.add(sectionName+'_flat_inv_text', 'd').color
|
||||
property color readOnly: ColorsList.add(sectionName+'_flat_inv_readonly', 'readonly_fg').color
|
||||
property int pointSize: Units.dp * 10
|
||||
property int rightPadding: 10
|
||||
property int rightPadding: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -451,6 +451,7 @@ DialogPlus {
|
|||
Layout.topMargin: ConferenceManagerStyle.columns.selector.spacing
|
||||
|
||||
showHeader:false
|
||||
isMandatory: true
|
||||
|
||||
maxMenuHeight: MainWindowStyle.searchBox.maxHeight
|
||||
//: 'Select participants' : Placeholder for a search on participant to add them in selection.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue