diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index c12b19a6f..f32eb5b0a 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -172,18 +172,12 @@ void CodeModel::onCompilationComplete(CompilationResult* _newResult) m_compiling = false; bool contractChanged = m_result->contractInterface() != _newResult->contractInterface(); - bool nameChanged = false; - if (m_result->successful()) - nameChanged = !(m_result->sharedContract()->name() == _newResult->sharedContract()->name()); //@todo should manage multiple contracts. - m_result.reset(_newResult); emit compilationComplete(); emit stateChanged(); if (m_result->successful()) { emit codeChanged(); - if (nameChanged) - emit contractNameChanged(_newResult->sharedContract()->name()); if (contractChanged) emit contractInterfaceChanged(); } diff --git a/mix/CodeModel.h b/mix/CodeModel.h index 529d52d1d..5f2add874 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -148,8 +148,6 @@ signals: void contractInterfaceChanged(); /// Emitted on compilation complete. Internal void compilationCompleteInternal(CompilationResult* _newResult); - /// Emitted when the contract name has changed - void contractNameChanged(QString _newName); private slots: void onCompilationComplete(CompilationResult* _newResult); diff --git a/mix/qml/FilesSection.qml b/mix/qml/FilesSection.qml index 541e45244..7c31e2db0 100644 --- a/mix/qml/FilesSection.qml +++ b/mix/qml/FilesSection.qml @@ -20,17 +20,17 @@ ColumnLayout { function hiddenHeightTopLevel() { - return section.state === "hidden" ? Style.documentsList.height : Style.documentsList.height * (model.count + 1); + return section.state === "hidden" ? Style.documentsList.height : Style.documentsList.fileNameHeight * model.count + Style.documentsList.height; } function hiddenHeightRepeater() { - return section.state === "hidden" ? 0 : Style.documentsList.height * wrapperItem.model.count; + return section.state === "hidden" ? 0 : Style.documentsList.fileNameHeight * wrapperItem.model.count; } function hiddenHeightElement() { - return section.state === "hidden" ? 0 : Style.documentsList.height; + return section.state === "hidden" ? 0 : Style.documentsList.fileNameHeight; } function getDocumentIndex(documentId) @@ -48,6 +48,18 @@ ColumnLayout { model.remove(i); } + FontLoader + { + id: sectionTitleFont + source: "qrc:/qml/fonts/SourceSansPro-Bold.ttf" + } + + FontLoader + { + id: fileNameFont + source: "qrc:/qml/fonts/SourceSansPro-Regular.ttf" + } + RowLayout { anchors.top: parent.top @@ -56,12 +68,14 @@ ColumnLayout { height: Style.documentsList.height Image { - source: "qrc:/qml/img/opentriangleindicator.png" + source: "qrc:/qml/img/opentriangleindicator_filesproject.png" width: 15 sourceSize.width: 15 id: imgArrow anchors.right: section.left anchors.rightMargin: 5 + anchors.top: parent.top + anchors.topMargin: 8 } Text @@ -71,13 +85,14 @@ ColumnLayout { anchors.left: parent.left anchors.leftMargin: Style.general.leftMargin color: Style.documentsList.sectionColor - font.bold: true + font.family: sectionTitleFont.name + font.pointSize: Style.documentsList.fontSize states: [ State { name: "hidden" PropertyChanges { target: filesList; visible: false; } PropertyChanges { target: rowCol; Layout.minimumHeight: Style.documentsList.height; Layout.maximumHeight: Style.documentsList.height; height: Style.documentsList.height; } - PropertyChanges { target: imgArrow; source: "qrc:/qml/img/closedtriangleindicator.png" } + PropertyChanges { target: imgArrow; source: "qrc:/qml/img/closedtriangleindicator_filesproject.png" } } ] } @@ -126,6 +141,7 @@ ColumnLayout { visible: !renameMode color: rootItem.isSelected ? Style.documentsList.selectedColor : Style.documentsList.color text: name; + font.family: fileNameFont.name font.pointSize: Style.documentsList.fontSize anchors.verticalCenter: parent.verticalCenter verticalAlignment: Text.AlignVCenter diff --git a/mix/qml/MainContent.qml b/mix/qml/MainContent.qml index bd7c44504..4fa1dfe52 100644 --- a/mix/qml/MainContent.qml +++ b/mix/qml/MainContent.qml @@ -7,6 +7,7 @@ import Qt.labs.settings 1.0 import org.ethereum.qml.QEther 1.0 import "js/QEtherHelper.js" as QEtherHelper import "js/TransactionHelper.js" as TransactionHelper +import "." Rectangle { @@ -121,6 +122,12 @@ Rectangle { } } + Rectangle{ + Layout.fillWidth: true + height: 1 + color: "#8c8c8c" + } + Rectangle { Layout.fillWidth: true Layout.preferredHeight: root.height - headerView.height; @@ -136,9 +143,9 @@ Rectangle { { anchors.fill: parent handleDelegate: Rectangle { - width: 4 - height: 4 - color: "#cccccc" + width: 1 + height: 1 + color: "#8c8c8c" } orientation: Qt.Horizontal @@ -154,9 +161,9 @@ Rectangle { Layout.fillWidth: true SplitView { handleDelegate: Rectangle { - width: 4 - height: 4 - color: "#cccccc" + width: 1 + height: 1 + color: "#8c8c8c" } id: codeWebSplitter anchors.fill: parent diff --git a/mix/qml/ProjectList.qml b/mix/qml/ProjectList.qml index 64fefe5b3..e19326e44 100644 --- a/mix/qml/ProjectList.qml +++ b/mix/qml/ProjectList.qml @@ -12,19 +12,47 @@ Item { anchors.fill: parent id: filesCol spacing: 0 + FontLoader + { + id: srcSansProLight + source: "qrc:/qml/fonts/SourceSansPro-ExtraLight.ttf" + } + Rectangle { color: Style.title.background height: Style.title.height Layout.fillWidth: true + Image { + id: projectIcon + source: "qrc:/qml/img/projecticon.png" + sourceSize.height: 30 + anchors.right: projectTitle.left + anchors.verticalCenter: parent.verticalCenter + anchors.rightMargin: 6 + } + Text { + id: projectTitle color: Style.title.color text: projectModel.projectTitle anchors.verticalCenter: parent.verticalCenter visible: !projectModel.isEmpty; anchors.left: parent.left anchors.leftMargin: Style.general.leftMargin + font.family: srcSansProLight.name + font.pointSize: Style.title.pointSize + } + + Text + { + text: "-" + anchors.right: parent.right + anchors.rightMargin: 15 + font.family: srcSansProLight.name + font.pointSize: Style.title.pointSize + anchors.verticalCenter: parent.verticalCenter } } @@ -70,13 +98,16 @@ Item { Connections { target: codeModel - onContractNameChanged: { + onCompilationComplete: { if (modelData === "Contracts") { var ctr = projectModel.listModel.get(0); - ctr.name = _newName; - projectModel.listModel.set(0, ctr); - sectionModel.set(0, ctr); + if (codeModel.code.contract.name !== ctr.name) + { + ctr.name = codeModel.code.contract.name; + projectModel.listModel.set(0, ctr); + sectionModel.set(0, ctr); + } } } } @@ -107,9 +138,9 @@ Item { onDocumentAdded: { - var newDoc = projectModel.getDocumentIndex(documentId); + var newDoc = projectModel.getDocument(documentId); if (newDoc.groupName === modelData) - ctrModel.append(newDoc); + sectionModel.append(newDoc); } } } diff --git a/mix/qml/Style.qml b/mix/qml/Style.qml index 8fa32c8c7..22ae87a6f 100644 --- a/mix/qml/Style.qml +++ b/mix/qml/Style.qml @@ -6,13 +6,14 @@ import QtQuick 2.0 */ QtObject { property QtObject general: QtObject { - property int leftMargin: 30 + property int leftMargin: 45 } property QtObject title: QtObject { property string color: "#808080" property string background: "#f0f0f0" - property int height: 40 + property int height: 70 + property int pointSize: 15 } property QtObject documentsList: QtObject { @@ -21,7 +22,8 @@ QtObject { property string sectionColor: "#808080" property string selectedColor: "white" property string highlightColor: "#4a90e2" - property int height: 30 - property int fontSize: 12 + property int height: 32 + property int fileNameHeight: 45 + property int fontSize: 15 } } diff --git a/mix/qml/fonts/SourceSansPro-Black.ttf b/mix/qml/fonts/SourceSansPro-Black.ttf new file mode 100644 index 000000000..be1a3108e Binary files /dev/null and b/mix/qml/fonts/SourceSansPro-Black.ttf differ diff --git a/mix/qml/fonts/SourceSansPro-BlackIt.ttf b/mix/qml/fonts/SourceSansPro-BlackIt.ttf new file mode 100644 index 000000000..ac5c4ef7c Binary files /dev/null and b/mix/qml/fonts/SourceSansPro-BlackIt.ttf differ diff --git a/mix/qml/fonts/SourceSansPro-Bold.ttf b/mix/qml/fonts/SourceSansPro-Bold.ttf new file mode 100644 index 000000000..f47161c6b Binary files /dev/null and b/mix/qml/fonts/SourceSansPro-Bold.ttf differ diff --git a/mix/qml/fonts/SourceSansPro-BoldIt.ttf b/mix/qml/fonts/SourceSansPro-BoldIt.ttf new file mode 100644 index 000000000..6b3db698b Binary files /dev/null and b/mix/qml/fonts/SourceSansPro-BoldIt.ttf differ diff --git a/mix/qml/fonts/SourceSansPro-ExtraLight.ttf b/mix/qml/fonts/SourceSansPro-ExtraLight.ttf new file mode 100644 index 000000000..0a3e51fdb Binary files /dev/null and b/mix/qml/fonts/SourceSansPro-ExtraLight.ttf differ diff --git a/mix/qml/fonts/SourceSansPro-ExtraLightIt.ttf b/mix/qml/fonts/SourceSansPro-ExtraLightIt.ttf new file mode 100644 index 000000000..a0eb86aca Binary files /dev/null and b/mix/qml/fonts/SourceSansPro-ExtraLightIt.ttf differ diff --git a/mix/qml/fonts/SourceSansPro-It.ttf b/mix/qml/fonts/SourceSansPro-It.ttf new file mode 100644 index 000000000..fcc95fc7c Binary files /dev/null and b/mix/qml/fonts/SourceSansPro-It.ttf differ diff --git a/mix/qml/fonts/SourceSansPro-Light.ttf b/mix/qml/fonts/SourceSansPro-Light.ttf new file mode 100644 index 000000000..9cae13c97 Binary files /dev/null and b/mix/qml/fonts/SourceSansPro-Light.ttf differ diff --git a/mix/qml/fonts/SourceSansPro-LightIt.ttf b/mix/qml/fonts/SourceSansPro-LightIt.ttf new file mode 100644 index 000000000..2ed784284 Binary files /dev/null and b/mix/qml/fonts/SourceSansPro-LightIt.ttf differ diff --git a/mix/qml/fonts/SourceSansPro-Regular.ttf b/mix/qml/fonts/SourceSansPro-Regular.ttf new file mode 100644 index 000000000..8e8255e17 Binary files /dev/null and b/mix/qml/fonts/SourceSansPro-Regular.ttf differ diff --git a/mix/qml/fonts/SourceSansPro-Semibold.ttf b/mix/qml/fonts/SourceSansPro-Semibold.ttf new file mode 100644 index 000000000..121ee9bbf Binary files /dev/null and b/mix/qml/fonts/SourceSansPro-Semibold.ttf differ diff --git a/mix/qml/fonts/SourceSansPro-SemiboldIt.ttf b/mix/qml/fonts/SourceSansPro-SemiboldIt.ttf new file mode 100644 index 000000000..6ceaa885f Binary files /dev/null and b/mix/qml/fonts/SourceSansPro-SemiboldIt.ttf differ diff --git a/mix/qml/fonts/SourceSerifPro-Bold.ttf b/mix/qml/fonts/SourceSerifPro-Bold.ttf new file mode 100644 index 000000000..ac7837fd9 Binary files /dev/null and b/mix/qml/fonts/SourceSerifPro-Bold.ttf differ diff --git a/mix/qml/fonts/SourceSerifPro-Regular.ttf b/mix/qml/fonts/SourceSerifPro-Regular.ttf new file mode 100644 index 000000000..7201a8890 Binary files /dev/null and b/mix/qml/fonts/SourceSerifPro-Regular.ttf differ diff --git a/mix/qml/fonts/SourceSerifPro-Semibold.ttf b/mix/qml/fonts/SourceSerifPro-Semibold.ttf new file mode 100644 index 000000000..db2fc804b Binary files /dev/null and b/mix/qml/fonts/SourceSerifPro-Semibold.ttf differ diff --git a/mix/qml/img/closedtriangleindicator_filesproject.png b/mix/qml/img/closedtriangleindicator_filesproject.png new file mode 100644 index 000000000..840f500e4 Binary files /dev/null and b/mix/qml/img/closedtriangleindicator_filesproject.png differ diff --git a/mix/qml/img/opentriangleindicator_filesproject.png b/mix/qml/img/opentriangleindicator_filesproject.png new file mode 100644 index 000000000..ee351b05c Binary files /dev/null and b/mix/qml/img/opentriangleindicator_filesproject.png differ diff --git a/mix/qml/img/projecticon.png b/mix/qml/img/projecticon.png new file mode 100644 index 000000000..58b8b6f60 Binary files /dev/null and b/mix/qml/img/projecticon.png differ diff --git a/mix/res.qrc b/mix/res.qrc index cc8225f84..d17c32549 100644 --- a/mix/res.qrc +++ b/mix/res.qrc @@ -66,5 +66,23 @@ qml/Style.qml qml/qmldir qml/FilesSection.qml + qml/fonts/SourceSansPro-Black.ttf + qml/fonts/SourceSansPro-BlackIt.ttf + qml/fonts/SourceSansPro-Bold.ttf + qml/fonts/SourceSansPro-BoldIt.ttf + qml/fonts/SourceSansPro-ExtraLight.ttf + qml/fonts/SourceSansPro-ExtraLightIt.ttf + qml/fonts/SourceSansPro-It.ttf + qml/fonts/SourceSansPro-Light.ttf + qml/fonts/SourceSansPro-LightIt.ttf + qml/fonts/SourceSansPro-Regular.ttf + qml/fonts/SourceSansPro-Semibold.ttf + qml/fonts/SourceSansPro-SemiboldIt.ttf + qml/fonts/SourceSerifPro-Bold.ttf + qml/fonts/SourceSerifPro-Regular.ttf + qml/fonts/SourceSerifPro-Semibold.ttf + qml/img/closedtriangleindicator_filesproject.png + qml/img/opentriangleindicator_filesproject.png + qml/img/projecticon.png