From e729a54f67713ed2a0409013025352b7ba2bd91a Mon Sep 17 00:00:00 2001 From: arkpar Date: Sun, 26 Apr 2015 22:20:29 +0200 Subject: [PATCH] fixed debugger values width and made them selectable --- mix/qml/QBoolTypeView.qml | 1 + mix/qml/QHashTypeView.qml | 1 + mix/qml/QIntTypeView.qml | 11 +++-------- mix/qml/QStringTypeView.qml | 10 +++------- mix/qml/StructView.qml | 13 ++++++++++--- mix/qml/VariablesView.qml | 18 +++++++++--------- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/mix/qml/QBoolTypeView.qml b/mix/qml/QBoolTypeView.qml index 9911d4549..c68b4e133 100644 --- a/mix/qml/QBoolTypeView.qml +++ b/mix/qml/QBoolTypeView.qml @@ -6,6 +6,7 @@ Item id: editRoot property string value property string defaultValue + property alias readOnly: !boolCombo.enabled height: 20 width: 150 diff --git a/mix/qml/QHashTypeView.qml b/mix/qml/QHashTypeView.qml index a097c22dd..ee5848b3a 100644 --- a/mix/qml/QHashTypeView.qml +++ b/mix/qml/QHashTypeView.qml @@ -3,6 +3,7 @@ import QtQuick 2.0 Item { property alias value: textinput.text + property alias readOnly: textinput.readOnly id: editRoot height: 20 width: 150 diff --git a/mix/qml/QIntTypeView.qml b/mix/qml/QIntTypeView.qml index 8adb46846..eacef74e8 100644 --- a/mix/qml/QIntTypeView.qml +++ b/mix/qml/QIntTypeView.qml @@ -1,12 +1,12 @@ import QtQuick 2.0 -import QtQuick.Layouts 1.1 Item { property alias value: textinput.text + property alias readOnly: textinput.readOnly id: editRoot height: 20 - width: 150 + width: readOnly ? textinput.implicitWidth : 150 SourceSansProBold { @@ -22,12 +22,7 @@ Item anchors.fill: parent font.family: boldFont.name clip: true - MouseArea { - id: mouseArea - anchors.fill: parent - hoverEnabled: true - onClicked: textinput.forceActiveFocus() - } + selectByMouse: true } } } diff --git a/mix/qml/QStringTypeView.qml b/mix/qml/QStringTypeView.qml index ffbde734c..080c49282 100644 --- a/mix/qml/QStringTypeView.qml +++ b/mix/qml/QStringTypeView.qml @@ -3,9 +3,10 @@ import QtQuick 2.0 Item { property alias value: textinput.text + property alias readOnly: textinput.readOnly id: editRoot height: 20 - width: 150 + width: readOnly ? textinput.implicitWidth : 150 SourceSansProBold { @@ -22,12 +23,7 @@ Item anchors.fill: parent wrapMode: Text.WrapAnywhere font.family: boldFont.name - MouseArea { - id: mouseArea - anchors.fill: parent - hoverEnabled: true - onClicked: textinput.forceActiveFocus() - } + selectByMouse: true } } } diff --git a/mix/qml/StructView.qml b/mix/qml/StructView.qml index 798a634fa..4df9ace67 100644 --- a/mix/qml/StructView.qml +++ b/mix/qml/StructView.qml @@ -12,7 +12,7 @@ Column property int transactionIndex property string context Layout.fillWidth: true - spacing: 10 + spacing: 0 Repeater { id: repeater @@ -22,7 +22,7 @@ Column RowLayout { id: row - height: 30 + (members[index].type.category === QSolidityType.Struct ? (20 * members[index].type.members.length) : 0) + height: 20 + (members[index].type.category === QSolidityType.Struct ? (20 * members[index].type.members.length) : 0) Layout.fillWidth: true DefaultLabel { height: 20 @@ -32,12 +32,14 @@ Column } DefaultLabel { + height: 20 id: nameLabel text: modelData.name anchors.verticalCenter: parent.verticalCenter } DefaultLabel { + height: 20 id: equalLabel text: "=" anchors.verticalCenter: parent.verticalCenter @@ -45,6 +47,7 @@ Column Loader { id: typeLoader + height: 20 anchors.verticalCenter: parent.verticalCenter sourceComponent: { @@ -69,10 +72,10 @@ Column var ptype = members[index].type; var pname = members[index].name; var vals = value; + item.readOnly = context === "variable"; if (ptype.category === QSolidityType.Address) { item.value = getValue(); - item.readOnly = context === "variable"; if (context === "parameter") { var dec = modelData.type.name.split(" "); @@ -119,6 +122,10 @@ Column vals[pname] = item.value; valueChanged(); }); + + var newWidth = nameLabel.width + typeLabel.width + item.width + 108; + if (root.width < newWidth) + root.width = newWidth; } function getValue() diff --git a/mix/qml/VariablesView.qml b/mix/qml/VariablesView.qml index b04739274..6603bd24e 100644 --- a/mix/qml/VariablesView.qml +++ b/mix/qml/VariablesView.qml @@ -18,15 +18,15 @@ DebugInfoList property alias members: typeLoader.members; property alias value: typeLoader.value; anchors.fill: parent - StructView - { - id: typeLoader - members: [] - value: {} - Layout.preferredWidth: parent.width - context: "variable" - width: parent.width - } + anchors.rightMargin: 8 + StructView + { + id: typeLoader + members: [] + value: {} + context: "variable" + width:parent.width + } } }