|
@ -24,13 +24,15 @@ import QtQuick 2.0 |
|
|
import QtQuick.Controls 1.0 |
|
|
import QtQuick.Controls 1.0 |
|
|
import QtQuick.Layouts 1.1 |
|
|
import QtQuick.Layouts 1.1 |
|
|
import QtGraphicalEffects 1.0 |
|
|
import QtGraphicalEffects 1.0 |
|
|
|
|
|
import org.ethereum.qml.InverseMouseArea 1.0 |
|
|
|
|
|
|
|
|
Rectangle { |
|
|
Rectangle { |
|
|
id: statesComboBox |
|
|
id: statesComboBox |
|
|
|
|
|
|
|
|
width: 200 |
|
|
width: 200 |
|
|
height: 23 |
|
|
height: 23 |
|
|
|
|
|
border.width: 2 |
|
|
|
|
|
border.color: "red" |
|
|
Component.onCompleted: { |
|
|
Component.onCompleted: { |
|
|
var top = dropDownList |
|
|
var top = dropDownList |
|
|
while (top.parent) { |
|
|
while (top.parent) { |
|
@ -62,6 +64,12 @@ Rectangle { |
|
|
chosenItemText.text = statesComboBox.items.get(index).title |
|
|
chosenItemText.text = statesComboBox.items.get(index).title |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function hideDropDown() |
|
|
|
|
|
{ |
|
|
|
|
|
if (statesComboBox.state === "dropDown") |
|
|
|
|
|
statesComboBox.state = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
signal comboClicked |
|
|
signal comboClicked |
|
|
|
|
|
|
|
|
property variant colorItem |
|
|
property variant colorItem |
|
@ -76,14 +84,13 @@ Rectangle { |
|
|
{ |
|
|
{ |
|
|
id: boldFont |
|
|
id: boldFont |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
smooth: true |
|
|
smooth: true |
|
|
|
|
|
|
|
|
Rectangle { |
|
|
Rectangle { |
|
|
id: chosenItem |
|
|
id: chosenItem |
|
|
width: parent.width |
|
|
width: parent.width |
|
|
height: statesComboBox.height |
|
|
height: statesComboBox.height |
|
|
color: statesComboBox.color |
|
|
color: statesComboBox.color |
|
|
|
|
|
|
|
|
Text { |
|
|
Text { |
|
|
id: chosenItemText |
|
|
id: chosenItemText |
|
|
anchors.left: parent.left |
|
|
anchors.left: parent.left |
|
@ -97,7 +104,13 @@ Rectangle { |
|
|
MouseArea { |
|
|
MouseArea { |
|
|
anchors.fill: parent |
|
|
anchors.fill: parent |
|
|
onClicked: { |
|
|
onClicked: { |
|
|
statesComboBox.state = statesComboBox.state === "dropDown" ? "" : "dropDown" |
|
|
if (outsideClick.trigerred) |
|
|
|
|
|
{ |
|
|
|
|
|
outsideClick.trigerred = false; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if (statesCombo.state === "") |
|
|
|
|
|
statesCombo.state = "dropDown"; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -124,8 +137,21 @@ Rectangle { |
|
|
anchors.topMargin: 23 |
|
|
anchors.topMargin: 23 |
|
|
color: statesComboBox.color |
|
|
color: statesComboBox.color |
|
|
|
|
|
|
|
|
|
|
|
InverseMouseArea |
|
|
|
|
|
{ |
|
|
|
|
|
property bool trigerred: false |
|
|
|
|
|
id: outsideClick |
|
|
|
|
|
anchors.fill: parent |
|
|
|
|
|
active: false |
|
|
|
|
|
onClickedOutside: { |
|
|
|
|
|
trigerred = true; |
|
|
|
|
|
statesCombo.hideDropDown() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
ColumnLayout { |
|
|
ColumnLayout { |
|
|
spacing: 2 |
|
|
spacing: 2 |
|
|
|
|
|
|
|
|
TableView { |
|
|
TableView { |
|
|
id: listView |
|
|
id: listView |
|
|
height: 20 |
|
|
height: 20 |
|
@ -256,5 +282,9 @@ Rectangle { |
|
|
height: 20 |
|
|
height: 20 |
|
|
implicitHeight: (statesComboBox.rowHeight * (statesComboBox.items.count)) |
|
|
implicitHeight: (statesComboBox.rowHeight * (statesComboBox.items.count)) |
|
|
} |
|
|
} |
|
|
|
|
|
PropertyChanges { |
|
|
|
|
|
target: outsideClick |
|
|
|
|
|
active: true |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|