Commit 2aacde42 authored by André Hoarau's avatar André Hoarau 🍆
Browse files

code cleaning

parent dc90717a
......@@ -36,7 +36,7 @@ ComboBox {
property bool persistentPrefix: false
property bool persistentSuffix: false
property bool showAddItem: false
property alias showAddItem: addItemRectangle.visible
property string addItemText: qsTr("Add Item")
property bool floatingLabel: false
......@@ -74,17 +74,17 @@ ComboBox {
Math.max(contentItem.implicitHeight,
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
// implicitWidth: Math.max(background ? background.implicitWidth : 0,
// leftPadding + rightPadding)
// || contentWidth + leftPadding + rightPadding
// implicitHeight: Math.max(contentHeight + topPadding + bottomPadding,
// background ? background.implicitHeight : 0,
// topPadding + bottomPadding)
// implicitWidth: Math.max(background ? background.implicitWidth : 0,
// leftPadding + rightPadding)
// || contentWidth + leftPadding + rightPadding
// implicitHeight: Math.max(contentHeight + topPadding + bottomPadding,
// background ? background.implicitHeight : 0,
// topPadding + bottomPadding)
onRowIdChanged: setRowId(rowId)
Material.elevation: 0
// width: parent.width
// width: parent.width
padding: 0
editable: true
......@@ -156,7 +156,7 @@ ComboBox {
}
onOpened: {
listView.positionViewAtBeginning();
listView.positionViewAtBeginning();
}
contentItem: Column {
......@@ -186,41 +186,40 @@ ComboBox {
font.family: "Robo Regular"
width: parent.width
}
}
}
Rectangle {
id: addItemRectangle
visible: showAddItem
implicitHeight: visible ? addItemDelegate.implicitHeight : 0
width: parent.width
color: "white"
z: 5
focus: true
// anchors.bottom: parent.bottom
ItemDelegate {
id: addItemDelegate
text: control.addItemText
width: parent.width
leftPadding: addItemIcon.width + Units.smallSpacing
z: 3
Rectangle {
id: addItemRectangle
// implicitHeight: visible ? addItemDelegate.implicitHeight : 0
// width: parent.width
// color: "white"
z: 5
focus: true
Material.background: "white"
background.opacity: 1
Label {
id: addItemIcon
leftPadding: Units.smallSpacing
anchors.verticalCenter: parent.verticalCenter
text: "\ue147"
font.family: "Material Icons"
font.pixelSize: Units.fontSizeHeadline
Material.foreground: Material.accent
// anchors.bottom: parent.bottom
ItemDelegate {
id: addItemDelegate
text: control.addItemText
width: parent.width
leftPadding: addItemIcon.width + Units.smallSpacing
z: 3
focus: true
Material.background: "white"
background.opacity: 1
Label {
id: addItemIcon
leftPadding: Units.smallSpacing
anchors.verticalCenter: parent.verticalCenter
text: "\ue147"
font.family: "Material Icons"
font.pixelSize: Units.fontSizeHeadline
Material.foreground: Material.accent
}
onClicked: addItemClicked()
}
onClicked: addItemClicked()
}
}
}
}
Label {
......@@ -233,7 +232,7 @@ ComboBox {
verticalAlignment: control.contentItem.verticalAlignment
elide: Text.ElideRight
renderType: control.contentItem.renderType
// visible: !control.contentItem.length
// visible: !control.contentItem.length
leftPadding: 10
visible: false
}
......
......@@ -241,8 +241,8 @@ ApplicationWindow {
x: parent.width
margins: 0
MenuItem { text: qsTr("Export"); onClicked: saveMainDatabaseDialog.open(); }
MenuItem { text: qsTr("Replace"); onClicked: replaceMainDatabaseDialog.open(); }
MenuItem { text: qsTr("Export"); onTriggered: saveMainDatabaseDialog.open(); }
MenuItem { text: qsTr("Replace"); onTriggered: replaceMainDatabaseDialog.open(); }
}
}
......
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