From 137ea552bdf98b09e33483e3987903d309b19b7c Mon Sep 17 00:00:00 2001 From: xiphon Date: Sat, 8 Dec 2018 21:26:33 +0000 Subject: [PATCH 01/12] standard-button: fix layout monero-gui/#1791 --- components/StandardButton.qml | 82 +++++++++++++++-------------------- 1 file changed, 35 insertions(+), 47 deletions(-) diff --git a/components/StandardButton.qml b/components/StandardButton.qml index 8f552ac796..88076894c6 100644 --- a/components/StandardButton.qml +++ b/components/StandardButton.qml @@ -46,22 +46,9 @@ Item { } signal clicked() - // Dynamic height/width - Layout.minimumWidth: { - var _padding = 22; - if(button.rightIcon !== ""){ - _padding += 60; - } - - var _width = label.contentWidth + _padding; - if(_width <= 50) { - return 60; - } - - return _width; - } - height: small ? 30 * scaleRatio : 36 * scaleRatio + width: buttonLayout.width + 22 * scaleRatio + Component.onCompleted: width = width function doClick() { // Android workaround @@ -70,9 +57,7 @@ Item { } Rectangle { - anchors.left: parent.left - anchors.right: parent.right - height: parent.height - 1 + anchors.fill: parent radius: 3 color: parent.enabled ? MoneroComponents.Style.buttonBackgroundColor : MoneroComponents.Style.buttonBackgroundColorDisabled border.width: parent.focus ? 1 : 0 @@ -96,38 +81,41 @@ Item { } } - Text { - id: label - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.right: parent.right - horizontalAlignment: textAlign === "center" ? Text.AlignHCenter : Text.AlignLeft - anchors.leftMargin: textAlign === "center" ? 0 : 11 - font.family: MoneroComponents.Style.fontBold.name - font.bold: true - font.pixelSize: buttonArea.pressed ? button.fontSize - 1 : button.fontSize - color: parent.textColor - visible: parent.icon === "" - } - - Image { + RowLayout { + id: buttonLayout + height: button.height + spacing: 11 * scaleRatio anchors.centerIn: parent - visible: parent.icon !== "" - source: parent.icon - } - Image { - visible: parent.rightIcon !== "" - anchors.right: parent.right - anchors.rightMargin: 11 * scaleRatio - anchors.verticalCenter: parent.verticalCenter - width: parent.small ? 16 * scaleRatio : 20 * scaleRatio - height: parent.small ? 16 * scaleRatio : 20 * scaleRatio - source: { - if(parent.rightIconInactive !== "" && !parent.enabled){ - return parent.rightIconInactive; + Text { + id: label + Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter + horizontalAlignment: textAlign === "center" ? Text.AlignHCenter : Text.AlignLeft + font.family: MoneroComponents.Style.fontBold.name + font.bold: true + font.pixelSize: buttonArea.pressed ? button.fontSize - 1 : button.fontSize + color: button.textColor + visible: button.icon === "" + } + + Image { + Layout.alignment: Qt.AlignVCenter | Qt.AlignRight + visible: button.icon !== "" + source: button.icon + } + + + Image { + visible: button.rightIcon !== "" + Layout.alignment: Qt.AlignVCenter | Qt.AlignRight + width: button.small ? 16 * scaleRatio : 20 * scaleRatio + height: button.small ? 16 * scaleRatio : 20 * scaleRatio + source: { + if(button.rightIconInactive !== "" && !button.enabled) { + return button.rightIconInactive; + } + return button.rightIcon; } - return parent.rightIcon; } } From 635c8c27829a04dfcbf3c12d63893fc3ea755918 Mon Sep 17 00:00:00 2001 From: xiphon Date: Sat, 8 Dec 2018 21:33:04 +0000 Subject: [PATCH 02/12] standard-button: add hover color animation monero-gui/#1791 --- components/StandardButton.qml | 47 +++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/components/StandardButton.qml b/components/StandardButton.qml index 88076894c6..bfb9071604 100644 --- a/components/StandardButton.qml +++ b/components/StandardButton.qml @@ -57,27 +57,41 @@ Item { } Rectangle { + id: buttonRect anchors.fill: parent radius: 3 - color: parent.enabled ? MoneroComponents.Style.buttonBackgroundColor : MoneroComponents.Style.buttonBackgroundColorDisabled border.width: parent.focus ? 1 : 0 - MouseArea { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - hoverEnabled: true - - propagateComposedEvents: true - - // possibly do some hover effects here - onEntered: { -// if(button.enabled) parent.color = Style.buttonBackgroundColorHover; -// else parent.color = Style.buttonBackgroundColorDisabledHover; - } - onExited: { -// if(button.enabled) parent.color = Style.buttonBackgroundColor; -// else parent.color = Style.buttonBackgroundColorDisabled; + state: button.enabled ? "active" : "disabled" + Component.onCompleted: state = state + states: [ + State { + name: "hover" + when: buttonArea.containsMouse || button.focus + PropertyChanges { + target: buttonRect + color: MoneroComponents.Style.buttonBackgroundColorHover + } + }, + State { + name: "active" + when: button.enabled + PropertyChanges { + target: buttonRect + color: MoneroComponents.Style.buttonBackgroundColor + } + }, + State { + name: "disabled" + when: !button.enabled + PropertyChanges { + target: buttonRect + color: MoneroComponents.Style.buttonBackgroundColorDisabled + } } + ] + transitions: Transition { + ColorAnimation { duration: 100 } } } @@ -122,6 +136,7 @@ Item { MouseArea { id: buttonArea anchors.fill: parent + hoverEnabled: true onClicked: doClick() cursorShape: Qt.PointingHandCursor } From d233dfb31c073b27ffad17b3a9c042505c695c64 Mon Sep 17 00:00:00 2001 From: xiphon Date: Sat, 8 Dec 2018 21:34:53 +0000 Subject: [PATCH 03/12] standard-button: remove redundant 'icon' property monero-gui/#1791 --- components/StandardButton.qml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/components/StandardButton.qml b/components/StandardButton.qml index bfb9071604..37c4c6a368 100644 --- a/components/StandardButton.qml +++ b/components/StandardButton.qml @@ -35,7 +35,6 @@ Item { id: button property string rightIcon: "" property string rightIconInactive: "" - property string icon: "" property string textColor: button.enabled? MoneroComponents.Style.buttonTextColor: MoneroComponents.Style.buttonTextColorDisabled property string textAlign: rightIcon !== "" ? "left" : "center" property bool small: false @@ -109,15 +108,8 @@ Item { font.bold: true font.pixelSize: buttonArea.pressed ? button.fontSize - 1 : button.fontSize color: button.textColor - visible: button.icon === "" + visible: text !== "" } - - Image { - Layout.alignment: Qt.AlignVCenter | Qt.AlignRight - visible: button.icon !== "" - source: button.icon - } - Image { visible: button.rightIcon !== "" From b630f5c861fa1985d56aac3e049b33eb23e894b4 Mon Sep 17 00:00:00 2001 From: xiphon Date: Thu, 13 Dec 2018 08:43:38 +0000 Subject: [PATCH 04/12] standard-button: handle changing text/icon at runtime monero-gui/#1809 --- components/StandardButton.qml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/components/StandardButton.qml b/components/StandardButton.qml index 37c4c6a368..ebd410360a 100644 --- a/components/StandardButton.qml +++ b/components/StandardButton.qml @@ -47,7 +47,8 @@ Item { height: small ? 30 * scaleRatio : 36 * scaleRatio width: buttonLayout.width + 22 * scaleRatio - Component.onCompleted: width = width + implicitHeight: height + implicitWidth: width function doClick() { // Android workaround @@ -106,9 +107,21 @@ Item { horizontalAlignment: textAlign === "center" ? Text.AlignHCenter : Text.AlignLeft font.family: MoneroComponents.Style.fontBold.name font.bold: true - font.pixelSize: buttonArea.pressed ? button.fontSize - 1 : button.fontSize - color: button.textColor + font.pixelSize: button.fontSize + color: !buttonArea.pressed ? button.textColor : "transparent" visible: text !== "" + + Text { + anchors.fill: parent + color: button.textColor + font.bold: label.font.bold + font.family: label.font.family + font.pixelSize: label.font.pixelSize - 1 + horizontalAlignment: label.horizontalAlignment + Layout.alignment: label.Layout.alignment + text: label.text + visible: buttonArea.pressed + } } Image { From dbd60b84a6e4241d6c511667afdb9310d26f7999 Mon Sep 17 00:00:00 2001 From: stoffu Date: Thu, 24 Feb 2022 15:08:44 +0900 Subject: [PATCH 05/12] build: clear before building CLI --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38d31360cd..a780eb20dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,7 @@ jobs: working-directory: build - name: build CLI run: | + rm -rf build/ USE_SINGLE_BUILDDIR=1 make release-static -j3 cp build/release/bin/* ../build/release/bin/ working-directory: monero @@ -78,6 +79,7 @@ jobs: working-directory: build - name: build CLI run: | + rm -rf build/ USE_SINGLE_BUILDDIR=1 make release-static -j3 cp build/release/bin/* ../build/release/bin/ working-directory: monero @@ -125,6 +127,7 @@ jobs: working-directory: build - name: build CLI run: | + rm -rf build/ USE_SINGLE_BUILDDIR=1 make release-static-win64 -j2 cp build/release/bin/* ../build/release/bin/ working-directory: monero From 0be3b425b7b633b1f4f3bda0b6fbdbaef013bffa Mon Sep 17 00:00:00 2001 From: stoffu Date: Thu, 24 Feb 2022 10:32:21 +0900 Subject: [PATCH 06/12] build-macos: use Qt 5.14.2 via aqtinstall instead of Qt 5.15.2 from Homebrew --- .github/workflows/build.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a780eb20dc..f04ec439f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,13 +13,19 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: install dependencies - run: HOMEBREW_NO_AUTO_UPDATE=1 brew install boost openssl zmq libpgm miniupnpc ldns expat libunwind-headers protobuf qt5 - - name: force link qt5 - run: brew link qt5 --force + run: HOMEBREW_NO_AUTO_UPDATE=1 brew install boost openssl zmq libpgm miniupnpc ldns expat libunwind-headers protobuf + - name: install qt + uses: jurplel/install-qt-action@v2 + with: + version: '5.14.2' + - name: add qt to path + run: echo "$Qt5_Dir/bin" >> $GITHUB_PATH + - name: check qt version + run: qmake --version - name: fetch zmq.hpp run: brew tap osrf/simulation && brew install cppzmq - name: build - run: export PATH=$PATH:/usr/local/opt/qt/bin && ./build.sh + run: ./build.sh - name: test qml run: build/release/bin/aeon-wallet-gui.app/Contents/MacOS/aeon-wallet-gui --test-qml - name: deploy From fc768260b09017e34a22518c101527e7d4e34524 Mon Sep 17 00:00:00 2001 From: stoffu Date: Thu, 24 Feb 2022 10:37:31 +0900 Subject: [PATCH 07/12] build-windows: use Qt 5.14.2 via aqtinstall instead of Qt 5.15.2 from pacman --- .github/workflows/build.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f04ec439f2..40d61afb15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -121,7 +121,18 @@ jobs: - uses: eine/setup-msys2@v2 with: update: true - install: mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-protobuf-c git mingw-w64-x86_64-qt5 mingw-w64-x86_64-hidapi zip curl + install: mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-protobuf-c git mingw-w64-x86_64-hidapi zip curl mingw-w64-x86_64-libtiff mingw-w64-x86_64-libpng mingw-w64-x86_64-pcre mingw-w64-x86_64-pcre2 mingw-w64-x86_64-libmng mingw-w64-x86_64-lcms2 mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-libiconv mingw-w64-x86_64-harfbuzz mingw-w64-x86_64-graphite2 mingw-w64-x86_64-glib2 mingw-w64-x86_64-freetype mingw-w64-x86_64-double-conversion mingw-w64-x86_64-md4c + - name: install qt + uses: jurplel/install-qt-action@v2 + with: + version: '5.14.2' + arch: 'win64_mingw73' + - name: copy qt to /usr/local # because $GITHUB_PATH doesn't seem to work on msys somehow + run: | + mkdir -p /usr/local + cp -rf $Qt5_Dir/* /usr/local + - name: check qt version + run: qmake --version - name: build run: | sed -i 's/CONFIG\ +=\ qtquickcompiler//' aeon-wallet-gui.pro From 951ab5479111528834fae67dfb193392b4e6ed30 Mon Sep 17 00:00:00 2001 From: stoffu Date: Thu, 24 Feb 2022 10:40:12 +0900 Subject: [PATCH 08/12] build-ubuntu: use Qt 5.14.2 via aqtinstall instead of Qt 5.15.2 from apt --- .github/workflows/build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40d61afb15..6e3d634957 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -74,8 +74,14 @@ jobs: run: sudo apt update - name: install aeon dependencies run: sudo apt -y install build-essential cmake libboost-all-dev miniupnpc libunbound-dev graphviz doxygen libunwind8-dev pkg-config libssl-dev libzmq3-dev libsodium-dev libnorm-dev libpgm-dev - - name: install aeon gui dependencies - run: sudo apt -y install qtbase5-dev qt5-default qtdeclarative5-dev qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-dialogs qml-module-qtquick-xmllistmodel qml-module-qt-labs-settings qml-module-qt-labs-folderlistmodel qttools5-dev-tools qml-module-qtquick-templates2 libqt5svg5-dev xvfb + - name: install qt + uses: jurplel/install-qt-action@v2 + with: + version: '5.14.2' + - name: add qt to path + run: echo "$Qt5_Dir/bin" >> $GITHUB_PATH + - name: qt check version + run: qmake --version - name: build run: ./build.sh - name: test qml From 7dea8149f0bb1e18d74bb827d95ff0ba641127c1 Mon Sep 17 00:00:00 2001 From: stoffu Date: Thu, 24 Feb 2022 11:16:01 +0900 Subject: [PATCH 09/12] build-ubuntu: use linuxdeployqt for AppImage deployment --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e3d634957..0d5e100421 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,7 @@ jobs: build-ubuntu: - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v1 @@ -74,6 +74,8 @@ jobs: run: sudo apt update - name: install aeon dependencies run: sudo apt -y install build-essential cmake libboost-all-dev miniupnpc libunbound-dev graphviz doxygen libunwind8-dev pkg-config libssl-dev libzmq3-dev libsodium-dev libnorm-dev libpgm-dev + - name: install dependencies for deployment + run: sudo apt -y install libgstreamer-plugins-base1.0-dev icnsutils - name: install qt uses: jurplel/install-qt-action@v2 with: @@ -86,15 +88,39 @@ jobs: run: ./build.sh - name: test qml run: xvfb-run -a build/release/bin/aeon-wallet-gui --test-qml - - name: deploy - run: make deploy - working-directory: build - name: build CLI run: | rm -rf build/ USE_SINGLE_BUILDDIR=1 make release-static -j3 cp build/release/bin/* ../build/release/bin/ working-directory: monero + - name: deploy - create directory structure, copy files + run: | + mkdir -p AppDir/usr/{bin,lib,share} + mkdir -p AppDir/usr/share/{applications,icons} + mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps + mv bin/aeon-wallet-gui AppDir/usr/bin + cp bin/aeond AppDir/usr/bin + icns2png -x ../../images/appicon.icns + mv appicon_256x256x32.png AppDir/usr/share/icons/hicolor/256x256/apps/aeon-wallet-gui.png + working-directory: build/release + - name: deploy - create desktop file + run: | + echo "[Desktop Entry]" >> aeon-wallet-gui.desktop + echo "Type=Application" >> aeon-wallet-gui.desktop + echo "Name=aeon-wallet-gui" >> aeon-wallet-gui.desktop + echo "Comment=GUI wallet for AEON cryptocurrency" >> aeon-wallet-gui.desktop + echo "Exec=aeon-wallet-gui" >> aeon-wallet-gui.desktop + echo "Icon=aeon-wallet-gui" >> aeon-wallet-gui.desktop + echo "Categories=Finance;" >> aeon-wallet-gui.desktop + working-directory: build/release/AppDir/usr/share/applications + - name: deploy - run linuxdeployqt + run: | + wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/8/linuxdeployqt-continuous-x86_64.AppImage" + chmod a+x linuxdeployqt-continuous-x86_64.AppImage + ./linuxdeployqt-continuous-x86_64.AppImage AppDir/usr/share/applications/aeon-wallet-gui.desktop -appimage -qmldir=../.. + mv aeon-wallet-gui-*.AppImage bin/aeon-wallet-gui.AppImage + working-directory: build/release - name: archive run: | export ARTIFACT_NAME="aeon-gui-linux-x64-$(git describe --tags)" From b3e79ab93d0e715a32855b0293ec1ecf757c19e6 Mon Sep 17 00:00:00 2001 From: stoffu Date: Fri, 25 Feb 2022 09:49:46 +0900 Subject: [PATCH 10/12] build-ubuntu: link zmq statically --- .github/workflows/build.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d5e100421..dae026dfd9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,7 +73,18 @@ jobs: - name: update apt run: sudo apt update - name: install aeon dependencies - run: sudo apt -y install build-essential cmake libboost-all-dev miniupnpc libunbound-dev graphviz doxygen libunwind8-dev pkg-config libssl-dev libzmq3-dev libsodium-dev libnorm-dev libpgm-dev + run: sudo apt -y install build-essential cmake libboost-all-dev miniupnpc libunbound-dev graphviz doxygen libunwind8-dev pkg-config libssl-dev libsodium-dev + - name: build & install static zmq + run: | + git clone https://github.com/zeromq/libzmq + cd libzmq + git checkout v4.3.2 + mkdir build && cd build + cmake -D WITH_PERF_TOOL=OFF -D ZMQ_BUILD_TESTS=OFF -D ENABLE_CPACK=OFF -D CMAKE_BUILD_TYPE=Release .. + make -j3 + sudo make install + sudo curl -L https://raw.githubusercontent.com/zeromq/cppzmq/master/zmq.hpp --output /usr/local/include/zmq.hpp + working-directory: .. - name: install dependencies for deployment run: sudo apt -y install libgstreamer-plugins-base1.0-dev icnsutils - name: install qt From 8f725503fe01f4a687a13685dc2abe468d2b5c6d Mon Sep 17 00:00:00 2001 From: stoffu Date: Fri, 25 Feb 2022 12:02:21 +0900 Subject: [PATCH 11/12] build-macos: copy statically built aeond into aeon-wallet-gui.app --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dae026dfd9..d1b4018dc1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,6 +36,7 @@ jobs: rm -rf build/ USE_SINGLE_BUILDDIR=1 make release-static -j3 cp build/release/bin/* ../build/release/bin/ + cp build/release/bin/aeond ../build/release/bin/aeon-wallet-gui.app/Contents/MacOS/aeond working-directory: monero - name: archive run: | From f322f125b86ef9f92d9545b8e962a6c24453d01c Mon Sep 17 00:00:00 2001 From: stoffu Date: Tue, 1 Mar 2022 20:47:01 +0900 Subject: [PATCH 12/12] build-ubuntu: report size of aeon-wallet-gui --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1b4018dc1..f289a73702 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -98,6 +98,8 @@ jobs: run: qmake --version - name: build run: ./build.sh + - name: check size of aeon-wallet-gui + run: ls -l build/release/bin/aeon-wallet-gui - name: test qml run: xvfb-run -a build/release/bin/aeon-wallet-gui --test-qml - name: build CLI