diff --git a/CMakeLists.txt b/CMakeLists.txt index 592f3be6..4e509d73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,9 +63,23 @@ install( DESTINATION ${APPDATA_DIR} RENAME ${APP_ID}.appdata.xml ) -add_subdirectory(gui) add_subdirectory(backend) -add_subdirectory(cli) +add_subdirectory(gui) +if(ANDROID) + include(android/AddQtAndroidApk.cmake) + add_dependencies(noson-gui NosonAppbackend NosonAppbackend-qmldir) + add_qt_android_apk(noson-apk noson-gui + NAME "noson" + VERSION_CODE 1 + PACKAGE_NAME "io.github.janbar.noson" + PACKAGE_SOURCES ${CMAKE_SOURCE_DIR}/android/package-sources + BUILDTOOLS_REVISION ${QT_ANDROID_SDK_BUILDTOOLS_REVISION} + DEPENDS ssl crypto + PLUGINS ${CMAKE_BINARY_DIR}/backend/qml + ) +else() + add_subdirectory(cli) +endif() add_custom_target( "run" diff --git a/android/AddQtAndroidApk.cmake b/android/AddQtAndroidApk.cmake new file mode 100644 index 00000000..bb4bb9d6 --- /dev/null +++ b/android/AddQtAndroidApk.cmake @@ -0,0 +1,191 @@ +cmake_minimum_required(VERSION 3.0) +cmake_policy(SET CMP0026 OLD) # allow use of the LOCATION target property + +# store the current source directory for future use +set(QT_ANDROID_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}) + +# check the JAVA_HOME environment variable +# (I couldn't find a way to set it from this script, it has to be defined outside) +set(JAVA_HOME $ENV{JAVA_HOME}) +if(NOT JAVA_HOME) + message(FATAL_ERROR "The JAVA_HOME environment variable is not set. Please set it to the root directory of the JDK.") +endif() + +# make sure that the Android toolchain is used +if(NOT ANDROID) + message(FATAL_ERROR "Trying to use the CMake Android package without the Android toolchain. Please use the provided toolchain (toolchain/android.toolchain.cmake)") +endif() + +# find the Qt root directory +if(NOT Qt5Core_DIR) + find_package(Qt5Core REQUIRED) +endif() +get_filename_component(QT_ANDROID_QT_ROOT "${Qt5Core_DIR}/../../.." ABSOLUTE) +message(STATUS "Found Qt for Android: ${QT_ANDROID_QT_ROOT}") + +# find the Android SDK +if(NOT QT_ANDROID_SDK_ROOT) + set(QT_ANDROID_SDK_ROOT $ENV{ANDROID_SDK}) + if(NOT QT_ANDROID_SDK_ROOT) + message(FATAL_ERROR "Could not find the Android SDK. Please set either the ANDROID_SDK environment variable, or the QT_ANDROID_SDK_ROOT CMake variable to the root directory of the Android SDK") + endif() +endif() +string(REPLACE "\\" "/" QT_ANDROID_SDK_ROOT ${QT_ANDROID_SDK_ROOT}) # androiddeployqt doesn't like backslashes in paths +message(STATUS "Found Android SDK: ${QT_ANDROID_SDK_ROOT}") + +# find the Android NDK +if(NOT QT_ANDROID_NDK_ROOT) + set(QT_ANDROID_NDK_ROOT $ENV{ANDROID_NDK}) + if(NOT QT_ANDROID_NDK_ROOT) + set(QT_ANDROID_NDK_ROOT ${ANDROID_NDK}) + if(NOT QT_ANDROID_NDK_ROOT) + message(FATAL_ERROR "Could not find the Android NDK. Please set either the ANDROID_NDK environment or CMake variable, or the QT_ANDROID_NDK_ROOT CMake variable to the root directory of the Android NDK") + endif() + endif() +endif() +string(REPLACE "\\" "/" QT_ANDROID_NDK_ROOT ${QT_ANDROID_NDK_ROOT}) # androiddeployqt doesn't like backslashes in paths +message(STATUS "Found Android NDK: ${QT_ANDROID_NDK_ROOT}") + +include(CMakeParseArguments) + +# define a macro to create an Android APK target +# +# example: +# add_qt_android_apk(my_app_apk my_app +# NAME "My App" +# VERSION_CODE 12 +# PACKAGE_NAME "org.mycompany.myapp" +# PACKAGE_SOURCES ${CMAKE_CURRENT_LIST_DIR}/my-android-sources +# BUILDTOOLS_REVISION "23.0.3" +# KEYSTORE ${CMAKE_CURRENT_LIST_DIR}/mykey.keystore myalias +# KEYSTORE_PASSWORD xxxx +# DEPENDS a_linked_target "path/to/a_linked_library.so" ... +# PLUGINS "path/to/plugin" ... +# INSTALL +#) +# +macro(add_qt_android_apk TARGET SOURCE_TARGET) + + # parse the macro arguments + cmake_parse_arguments(ARG "INSTALL" "NAME;VERSION_CODE;PACKAGE_NAME;PACKAGE_SOURCES;KEYSTORE_PASSWORD;BUILDTOOLS_REVISION" "DEPENDS;PLUGINS;KEYSTORE" ${ARGN}) + + # extract the full path of the source target binary + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + get_property(QT_ANDROID_APP_PATH TARGET ${SOURCE_TARGET} PROPERTY DEBUG_LOCATION) + else() + get_property(QT_ANDROID_APP_PATH TARGET ${SOURCE_TARGET} PROPERTY LOCATION) + endif() + + # define the application name + if(ARG_NAME) + set(QT_ANDROID_APP_NAME ${ARG_NAME}) + else() + set(QT_ANDROID_APP_NAME ${SOURCE_TARGET}) + endif() + + # define the application package name + if(ARG_PACKAGE_NAME) + set(QT_ANDROID_APP_PACKAGE_NAME ${ARG_PACKAGE_NAME}) + else() + set(QT_ANDROID_APP_PACKAGE_NAME org.qtproject.${SOURCE_TARGET}) + endif() + + # set the Android SDK build-tools revision + if(ARG_BUILDTOOLS_REVISION) + set(QT_ANDROID_SDK_BUILDTOOLS_REVISION ${ARG_BUILDTOOLS_REVISION}) + else() + set(QT_ANDROID_SDK_BUILDTOOLS_REVISION "") + endif() + + # define the application source package directory + if(ARG_PACKAGE_SOURCES) + set(QT_ANDROID_APP_PACKAGE_SOURCE_ROOT ${ARG_PACKAGE_SOURCES}) + else() + # get version code from arguments, or generate a fixed one if not provided + set(QT_ANDROID_APP_VERSION_CODE ${ARG_VERSION_CODE}) + if(NOT QT_ANDROID_APP_VERSION_CODE) + set(QT_ANDROID_APP_VERSION_CODE 1) + endif() + + # try to extract the app version from the target properties, or use the version code if not provided + get_property(QT_ANDROID_APP_VERSION TARGET ${SOURCE_TARGET} PROPERTY VERSION) + if(NOT QT_ANDROID_APP_VERSION) + set(QT_ANDROID_APP_VERSION ${QT_ANDROID_APP_VERSION_CODE}) + endif() + + # create a subdirectory for the extra package sources + set(QT_ANDROID_APP_PACKAGE_SOURCE_ROOT "${CMAKE_CURRENT_BINARY_DIR}/package") + + # generate a manifest from the template + configure_file(${QT_ANDROID_SOURCE_DIR}/AndroidManifest.xml.in ${QT_ANDROID_APP_PACKAGE_SOURCE_ROOT}/AndroidManifest.xml @ONLY) + endif() + + # set the list of dependant libraries + if(ARG_DEPENDS) + foreach(LIB ${ARG_DEPENDS}) + if(TARGET ${LIB}) + # item is a CMake target, extract the library path + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + get_property(LIB_PATH TARGET ${LIB} PROPERTY DEBUG_LOCATION) + else() + get_property(LIB_PATH TARGET ${LIB} PROPERTY LOCATION) + endif() + set(LIB ${LIB_PATH}) + endif() + if(EXTRA_LIBS) + set(EXTRA_LIBS "${EXTRA_LIBS},${LIB}") + else() + set(EXTRA_LIBS "${LIB}") + endif() + endforeach() + set(QT_ANDROID_APP_EXTRA_LIBS "\"android-extra-libs\": \"${EXTRA_LIBS}\",") + endif() + + # set the list of dependant plugins + if(ARG_PLUGINS) + foreach(PLUGIN ${ARG_PLUGINS}) + if(EXTRA_PLUGINS) + set(EXTRA_PLUGINS "${EXTRA_PLUGINS},${PLUGIN}") + else() + set(EXTRA_PLUGINS "${PLUGIN}") + endif() + endforeach() + set(QT_ANDROID_APP_EXTRA_PLUGINS "\"android-extra-plugins\": \"${EXTRA_PLUGINS}\",") + endif() + + # make sure that the output directory for the Android package exists + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/libs/${ANDROID_ABI}) + + # create the configuration file that will feed androiddeployqt + configure_file(${QT_ANDROID_SOURCE_DIR}/qtdeploy.json.in ${CMAKE_CURRENT_BINARY_DIR}/qtdeploy.json @ONLY) + + # check if the apk must be signed + if(ARG_KEYSTORE) + set(SIGN_OPTIONS --release --sign ${ARG_KEYSTORE} --tsa http://timestamp.digicert.com) + if(ARG_KEYSTORE_PASSWORD) + set(SIGN_OPTIONS ${SIGN_OPTIONS} --storepass ${ARG_KEYSTORE_PASSWORD}) + endif() + endif() + + # check if the apk must be installed to the device + if(ARG_INSTALL) + set(INSTALL_OPTIONS --reinstall) + endif() + + # specify the Android API level + if(ANDROID_NATIVE_API_LEVEL) + set(TARGET_LEVEL_OPTIONS --android-platform android-${ANDROID_NATIVE_API_LEVEL}) + endif() + + # create a custom command that will run the androiddeployqt utility to prepare the Android package + add_custom_target( + ${TARGET} + ALL + DEPENDS ${SOURCE_TARGET} + COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/libs/${ANDROID_ABI} # it seems that recompiled libraries are not copied if we don't remove them first + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/libs/${ANDROID_ABI} + COMMAND ${CMAKE_COMMAND} -E copy ${QT_ANDROID_APP_PATH} ${CMAKE_CURRENT_BINARY_DIR}/libs/${ANDROID_ABI} + COMMAND ${QT_ANDROID_QT_ROOT}/bin/androiddeployqt --verbose --output ${CMAKE_CURRENT_BINARY_DIR} --input ${CMAKE_CURRENT_BINARY_DIR}/qtdeploy.json --gradle ${TARGET_LEVEL_OPTIONS} ${INSTALL_OPTIONS} ${SIGN_OPTIONS} + ) + +endmacro() diff --git a/android/AndroidManifest.xml.in b/android/AndroidManifest.xml.in new file mode 100644 index 00000000..7f53a40d --- /dev/null +++ b/android/AndroidManifest.xml.in @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/configure-armv7.sh b/android/configure-armv7.sh new file mode 100755 index 00000000..7a2a4858 --- /dev/null +++ b/android/configure-armv7.sh @@ -0,0 +1,34 @@ +rm -rf build/* +mkdir -p build +cd build + +export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/ +export ANDROID_SDK=/Users/Shared/Android/Sdk +export ANDROID_NDK=$ANDROID_SDK/ndk-bundle +export QT_DIR=/Users/Shared/Qt/5.9.6/android_armv7 + +cmake ../.. -DCMAKE_SYSTEM_NAME=Android \ +-DCMAKE_PREFIX_PATH=$QT_DIR \ +-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \ +-DCMAKE_MAKE_PROGRAM=$ANDROID_NDK/prebuilt/darwin-x86_64/bin/make \ +-DCMAKE_BUILD_TYPE=Release \ +-DANDROID_ABI="armeabi-v7a" \ +-DANDROID_TOOLCHAIN_NAME="arm-linux-androideabi-4.9" \ +-DANDROID_TOOLCHAIN_MACHINE_NAME="arm-linux-androideabi" \ +-DANDROID_TOOLCHAIN_TOOL_PREFIX="arm-linux-androideabi" \ +-DANDROID_COMPILER_VERSION="4.9" \ +-DANDROID_NATIVE_API_LEVEL="android-16" \ +-DQT_ANDROID_SDK_ROOT=$ANDROID_SDK \ +-DQT_ANDROID_NDK_ROOT=$ANDROID_NDK \ +-DQT_ANDROID_QT_ROOT=$QT_DIR \ +-DQT_ANDROID_SDK_BUILDTOOLS_REVISION="21.0.0" \ +-DQt5Core_DIR=$QT_DIR/lib/cmake/Qt5Core \ +-DQt5Gui_DIR=$QT_DIR/lib/cmake/Qt5Gui \ +-DQt5Qml_DIR=$QT_DIR/lib/cmake/Qt5Qml \ +-DQt5Network_DIR=$QT_DIR/lib/cmake/Qt5Network \ +-DQt5Quick_DIR=$QT_DIR/lib/cmake/Qt5Quick \ +-DQt5QuickControls2_DIR=$QT_DIR/lib/cmake/Qt5QuickControls2 \ +-DQt5Xml_DIR=$QT_DIR/lib/cmake/Qt5Xml \ +-DQt5Svg_DIR=$QT_DIR/lib/cmake/Qt5Svg \ +-DQt5Widgets_DIR=$QT_DIR/lib/cmake/Qt5Widgets \ + diff --git a/android/configure-x86.sh b/android/configure-x86.sh new file mode 100755 index 00000000..3f62d814 --- /dev/null +++ b/android/configure-x86.sh @@ -0,0 +1,34 @@ +rm -rf build/* +mkdir -p build +cd build + +export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/ +export ANDROID_SDK=/Users/Shared/Android/Sdk +export ANDROID_NDK=$ANDROID_SDK/ndk-bundle +export QT_DIR=/Users/Shared/Qt/5.9.6/android_x86 + +cmake ../.. -DCMAKE_SYSTEM_NAME=Android \ +-DCMAKE_PREFIX_PATH=$QT_DIR \ +-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \ +-DCMAKE_MAKE_PROGRAM=$ANDROID_NDK/prebuilt/darwin-x86_64/bin/make \ +-DCMAKE_BUILD_TYPE=Release \ +-DANDROID_ABI="x86" \ +-DANDROID_TOOLCHAIN_NAME="x86-4.9" \ +-DANDROID_TOOLCHAIN_MACHINE_NAME="x86" \ +-DANDROID_TOOLCHAIN_TOOL_PREFIX="i686-linux-android" \ +-DANDROID_COMPILER_VERSION="4.9" \ +-DANDROID_NATIVE_API_LEVEL="android-16" \ +-DQT_ANDROID_SDK_ROOT=$ANDROID_SDK \ +-DQT_ANDROID_NDK_ROOT=$ANDROID_NDK \ +-DQT_ANDROID_QT_ROOT=$QT_DIR \ +-DQT_ANDROID_SDK_BUILDTOOLS_REVISION="21.0.0" \ +-DQt5Core_DIR=$QT_DIR/lib/cmake/Qt5Core \ +-DQt5Gui_DIR=$QT_DIR/lib/cmake/Qt5Gui \ +-DQt5Qml_DIR=$QT_DIR/lib/cmake/Qt5Qml \ +-DQt5Network_DIR=$QT_DIR/lib/cmake/Qt5Network \ +-DQt5Quick_DIR=$QT_DIR/lib/cmake/Qt5Quick \ +-DQt5QuickControls2_DIR=$QT_DIR/lib/cmake/Qt5QuickControls2 \ +-DQt5Xml_DIR=$QT_DIR/lib/cmake/Qt5Xml \ +-DQt5Svg_DIR=$QT_DIR/lib/cmake/Qt5Svg \ +-DQt5Widgets_DIR=$QT_DIR/lib/cmake/Qt5Widgets \ + diff --git a/android/package-sources/AndroidManifest.xml b/android/package-sources/AndroidManifest.xml new file mode 100644 index 00000000..607176cd --- /dev/null +++ b/android/package-sources/AndroidManifest.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/package-sources/res/mipmap-hdpi/ic_launcher.png b/android/package-sources/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..5d26e807 Binary files /dev/null and b/android/package-sources/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/package-sources/res/mipmap-mdpi/ic_launcher.png b/android/package-sources/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..1e204bb0 Binary files /dev/null and b/android/package-sources/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/package-sources/res/mipmap-xhdpi/ic_launcher.png b/android/package-sources/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..11644a18 Binary files /dev/null and b/android/package-sources/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/package-sources/res/mipmap-xxhdpi/ic_launcher.png b/android/package-sources/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..26052833 Binary files /dev/null and b/android/package-sources/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/package-sources/res/mipmap-xxxhdpi/ic_launcher.png b/android/package-sources/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..831b4355 Binary files /dev/null and b/android/package-sources/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/qtdeploy.json.in b/android/qtdeploy.json.in new file mode 100644 index 00000000..d32fa1a9 --- /dev/null +++ b/android/qtdeploy.json.in @@ -0,0 +1,18 @@ +{ + "description": "This file is to be read by androiddeployqt", + "qt": "@QT_ANDROID_QT_ROOT@", + "sdk": "@QT_ANDROID_SDK_ROOT@", + "ndk": "@QT_ANDROID_NDK_ROOT@", + "sdkBuildToolsRevision": "@QT_ANDROID_SDK_BUILDTOOLS_REVISION@", + "toolchain-prefix": "@ANDROID_TOOLCHAIN_MACHINE_NAME@", + "tool-prefix": "@ANDROID_TOOLCHAIN_TOOL_PREFIX@", + "toolchain-version": "@ANDROID_COMPILER_VERSION@", + "ndk-host": "@ANDROID_NDK_HOST_SYSTEM_NAME@", + "target-architecture": "@ANDROID_ABI@", + "application-binary": "@QT_ANDROID_APP_PATH@", + "android-package": "@QT_ANDROID_APP_PACKAGE_NAME@", + "android-app-name": "@QT_ANDROID_APP_NAME@", + @QT_ANDROID_APP_EXTRA_LIBS@ + @QT_ANDROID_APP_EXTRA_PLUGINS@ + "android-package-source-directory": "@QT_ANDROID_APP_PACKAGE_SOURCE_ROOT@" +} diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt index e2dad08b..a4b2e33d 100644 --- a/backend/CMakeLists.txt +++ b/backend/CMakeLists.txt @@ -21,6 +21,8 @@ include_directories( ${noson_INCLUDE_DIRS} ) +set(QML_IMPORT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/qml) + set( NosonAppbackend_SRCS modules/NosonApp/tools.h @@ -79,13 +81,13 @@ endif() target_link_libraries(NosonAppbackend ${noson_LIBRARIES}) set_target_properties(NosonAppbackend PROPERTIES - LIBRARY_OUTPUT_DIRECTORY NosonApp) + LIBRARY_OUTPUT_DIRECTORY ${QML_IMPORT_DIRECTORY}/NosonApp) target_link_libraries(NosonAppbackend Qt5::Gui Qt5::Qml Qt5::Quick) # Copy qmldir file to build dir for running in QtCreator add_custom_target(NosonAppbackend-qmldir ALL - COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/modules/NosonApp/qmldir ${CMAKE_CURRENT_BINARY_DIR}/NosonApp + COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/modules/NosonApp/qmldir ${QML_IMPORT_DIRECTORY}/NosonApp DEPENDS ${QMLFILES} ) diff --git a/backend/lib/openssl/crypto/CMakeLists.txt b/backend/lib/openssl/crypto/CMakeLists.txt index 73b20a71..0557945b 100644 --- a/backend/lib/openssl/crypto/CMakeLists.txt +++ b/backend/lib/openssl/crypto/CMakeLists.txt @@ -220,7 +220,11 @@ add_submodule ( x509v3 v3_bcons.c v3_bitst.c v3_conf.c v3_extku.c v3_ia5.c v3_li add_submodule ( . EXHEADERS crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h ossl_typ.h ) -add_library( crypto ${LIBSRC} ${OBJECTS_SRC} ) +if( ANDROID ) + add_library( crypto SHARED ${LIBSRC} ${OBJECTS_SRC} ) +else() + add_library( crypto ${LIBSRC} ${OBJECTS_SRC} ) +endif() if( WIN32 AND NOT CYGWIN ) target_link_libraries( crypto ws2_32 crypt32 ) diff --git a/backend/lib/openssl/ssl/CMakeLists.txt b/backend/lib/openssl/ssl/CMakeLists.txt index 7804ec0e..ad3d9a26 100644 --- a/backend/lib/openssl/ssl/CMakeLists.txt +++ b/backend/lib/openssl/ssl/CMakeLists.txt @@ -41,7 +41,11 @@ set ( LIBSRC bio_ssl.c ssl_err.c kssl.c t1_reneg.c tls_srp.c t1_trce.c ssl_utst.c ) -add_library ( ssl ${LIBSRC} ) +if( ANDROID ) + add_library ( ssl SHARED ${LIBSRC} ) +else() + add_library ( ssl ${LIBSRC} ) +endif() target_link_libraries ( ssl crypto ) install( FILES ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h kssl.h srtp.h diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index e0a8551e..843a8edd 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -6,6 +6,9 @@ find_package(Qt5Gui REQUIRED) find_package(Qt5Qml REQUIRED) find_package(Qt5Quick REQUIRED) find_package(Qt5QuickControls2 REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Xml REQUIRED) +find_package(Qt5Svg REQUIRED) file(GLOB QML_JS_FILES *.qml *.js) file(GLOB APP_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.qml *.js *.json) @@ -38,8 +41,14 @@ else() endif() qt5_add_resources(noson-gui-resources noson.qrc) -add_executable(noson-gui ${noson-gui-sources} ${noson-gui-resources} ${extra-sources}) -target_link_libraries(noson-gui Qt5::Gui Qt5::Qml Qt5::Quick Qt5::QuickControls2) + +if(ANDROID) + add_library(noson-gui SHARED ${noson-gui-sources} ${noson-gui-resources} ${extra-sources}) +else() + add_executable(noson-gui ${noson-gui-sources} ${noson-gui-resources} ${extra-sources}) +endif() + +target_link_libraries(noson-gui Qt5::Gui Qt5::Qml Qt5::Quick Qt5::QuickControls2 Qt5::Widgets Qt5::Xml Qt5::Svg) if(MSVC) target_link_libraries (noson-gui ws2_32) diff --git a/gui/components/ClockTumbler.qml b/gui/components/ClockTumbler.qml index 05b77f1a..ec792c3d 100644 --- a/gui/components/ClockTumbler.qml +++ b/gui/components/ClockTumbler.qml @@ -66,7 +66,7 @@ Item { tumb.currentIndex = i < tumb.count ? i : i - tumb.count; } - width: units.gu(3) + width: units.gu(5) height: width opacity: 0.7 } @@ -97,7 +97,7 @@ Item { tumb.currentIndex = i >= 0 ? i : i + tumb.count; } - width: units.gu(3) + width: units.gu(5) height: width opacity: 0.7 } diff --git a/gui/components/Delegates/Card.qml b/gui/components/Delegates/Card.qml index 24373a5d..e2a6ee6b 100644 --- a/gui/components/Delegates/Card.qml +++ b/gui/components/Delegates/Card.qml @@ -135,7 +135,7 @@ Item { bottom: bg.bottom right: bg.right } - height: canPlay ? (card.width * 0.25) : 0 + height: canPlay ? (card.width * 0.40) : 0 width: height enabled: canPlay opacity: 0.3 @@ -152,7 +152,7 @@ Item { bottom: playMouseArea.top right: bg.right } - height: isFavorite ? (card.width * 0.25) : 0 + height: isFavorite ? (card.width * 0.40) : 0 width: height enabled: isFavorite source: "qrc:/images/starred.svg" diff --git a/gui/components/Dialog/DialogAlarm.qml b/gui/components/Dialog/DialogAlarm.qml index 28ddc0ce..cde753a7 100644 --- a/gui/components/Dialog/DialogAlarm.qml +++ b/gui/components/Dialog/DialogAlarm.qml @@ -48,16 +48,17 @@ Item { Item { id: roomLabel - width: units.gu(3) + width: units.gu(5) height: room.height Icon { anchors.centerIn: parent - height: units.gu(3) + height: units.gu(5) width: height color: styleMusic.dialog.labelColor enabled: false source: "qrc:/images/location.svg" opacity: 0.7 + hoverEnabled: false } } @@ -147,16 +148,18 @@ Item { Column { id: c3 + spacing: 0 Item { width: volume.width - height: units.gu(3) + height: units.gu(2) Icon { anchors.centerIn: parent - height: parent.height + height: units.gu(5) width: height source: volume.value === 0 ? "qrc:/images/audio-volume-muted.svg" : "qrc:/images/audio-volume.svg" enabled: false opacity: 0.7 + hoverEnabled: false } } @@ -287,16 +290,17 @@ Item { Item { id: programLabel - width: units.gu(3) + width: units.gu(5) height: program.height Icon { anchors.centerIn: parent - height: units.gu(3) + height: units.gu(5) width: height color: styleMusic.dialog.labelColor enabled: false source: "qrc:/images/bell.svg" opacity: 0.7 + hoverEnabled: false } } diff --git a/gui/components/Dialog/DialogManageQueue.qml b/gui/components/Dialog/DialogManageQueue.qml index 63e3f56c..6bfbb361 100644 --- a/gui/components/Dialog/DialogManageQueue.qml +++ b/gui/components/Dialog/DialogManageQueue.qml @@ -38,7 +38,7 @@ DialogBase { TextField { id: playlistName - font.pointSize: units.fs("x-large") + font.pointSize: units.fs("medium") placeholderText: qsTr("Enter playlist name") inputMethodHints: Qt.ImhNoPredictiveText } @@ -82,5 +82,4 @@ DialogBase { } } - Component.onCompleted: playlistName.forceActiveFocus() } diff --git a/gui/components/Dialog/DialogSongInfo.qml b/gui/components/Dialog/DialogSongInfo.qml index 5c424975..cb81ec36 100644 --- a/gui/components/Dialog/DialogSongInfo.qml +++ b/gui/components/Dialog/DialogSongInfo.qml @@ -83,7 +83,7 @@ Item { anchors.bottom: coverGrid.bottom anchors.right: coverGrid.right anchors.margins: units.gu(1) - height: coverGrid.height * 0.20 + height: coverGrid.height * 0.25 width: height radius: height / 2 color: styleMusic.dialog.backgroundColor @@ -96,11 +96,11 @@ Item { id: playerControlsPlayButton anchors.bottom: coverGrid.bottom anchors.right: coverGrid.right - anchors.rightMargin: units.gu(1) * 1.6 - anchors.bottomMargin: units.gu(1) * 1.7 + anchors.rightMargin: units.gu(1) + anchors.bottomMargin: units.gu(1) visible: songInfo.actionsVisible color: styleMusic.dialog.foregroundColor - height: coverGrid.height * 0.15 + height: coverGrid.height * 0.25 width: height source: "qrc:/images/media-playback-start.svg" onClicked: { diff --git a/gui/components/Icon.qml b/gui/components/Icon.qml index 16fa2afc..2afa6c85 100644 --- a/gui/components/Icon.qml +++ b/gui/components/Icon.qml @@ -9,8 +9,9 @@ MouseArea { property color color: styleMusic.view.foregroundColor property color pressedColor: styleMusic.view.highlightedColor property alias rotationRunning: icon.rotationRunning - height: units.gu(4) - width: row.width + property alias iconSize: icon.height + height: units.gu(5) + width: row.width + units.gu(2) enabled: true visible: true hoverEnabled: enabled && visible @@ -20,10 +21,17 @@ MouseArea { spacing: units.gu(0.5) height: parent.height visible: false + anchors.verticalCenter: parent.verticalCenter + + Item { + height: parent.height + width: units.gu(0.5) + } Image { id: icon - height: parent.height + anchors.verticalCenter: parent.verticalCenter + height: parent.height < units.gu(3) ? parent.height : (parent.height - units.gu(2)) width: area.visible ? height : 0 sourceSize.height: height sourceSize.width: width diff --git a/gui/components/MusicHeader.qml b/gui/components/MusicHeader.qml index bf8471bc..4116afb1 100644 --- a/gui/components/MusicHeader.qml +++ b/gui/components/MusicHeader.qml @@ -58,7 +58,7 @@ Item { bottom: coversImage.bottom right: coversImage.right } - height: isFavorite ? (coversImage.size * 0.25) : 0 + height: isFavorite ? (coversImage.size * 0.40) : 0 width: height enabled: isFavorite source: "qrc:/images/starred.svg" diff --git a/gui/components/MusicPage.qml b/gui/components/MusicPage.qml index 5b42fedc..64d6ea26 100644 --- a/gui/components/MusicPage.qml +++ b/gui/components/MusicPage.qml @@ -102,7 +102,7 @@ Page { } footer: Item { - height: units.gu(6) + height: units.gu(7.25) width: parent.width Rectangle { @@ -116,18 +116,18 @@ Page { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - anchors.topMargin: units.gu(1.5) + anchors.topMargin: units.gu(1) anchors.leftMargin: units.gu(1) anchors.rightMargin: units.gu(1) - height: units.gu(3) + height: units.gu(5) color: "transparent" Row { - spacing: units.gu(3) + spacing: units.gu(1) Icon { source: "qrc:/images/media-playlist.svg" - height: units.gu(3) + height: units.gu(5) label.text: player.queueInfo label.font.pointSize: units.fs("x-small") @@ -144,7 +144,7 @@ Page { Icon { source: "qrc:/images/location.svg" - height: units.gu(3) + height: units.gu(5) label.text: currentZoneTag label.font.pointSize: units.fs("x-small") @@ -155,7 +155,7 @@ Page { id: viewType visible: false source: isListView ? "qrc:/images/view-grid-symbolic.svg" : "qrc:/images/view-list-symbolic.svg" - height: units.gu(3) + height: units.gu(5) onClicked: { isListView = !isListView } @@ -165,7 +165,7 @@ Page { id: find visible: false source: "qrc:/images/find.svg" - height: units.gu(3) + height: units.gu(5) onClicked: searchClicked() } @@ -173,7 +173,7 @@ Page { id: selection visible: false source: "qrc:/images/select.svg" - height: units.gu(3) + height: units.gu(5) onClicked: thisPage.state = "selection" } @@ -181,7 +181,7 @@ Page { id: add visible: false source: "qrc:/images/add.svg" - height: units.gu(3) + height: units.gu(5) label.text: qsTr("Add") label.font.pointSize: units.fs("x-small") onClicked: addClicked() @@ -191,12 +191,13 @@ Page { Item { id: optionsMenu anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter width: units.gu(4) height: parent.height visible: false Icon { - width: units.gu(3) + width: units.gu(5) height: width anchors.centerIn: parent source: "qrc:/images/contextual-menu.svg" @@ -229,20 +230,20 @@ Page { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - anchors.topMargin: units.gu(1.5) + anchors.topMargin: units.gu(1) anchors.leftMargin: units.gu(1) anchors.rightMargin: units.gu(1) - height: units.gu(3) + height: units.gu(5) color: "transparent" Row { - spacing: units.gu(3) + spacing: units.gu(1) Icon { id: closeSelection visible: true source: "qrc:/images/close.svg" - height: units.gu(3) + height: units.gu(5) label.text: qsTr("Close") label.font.pointSize: units.fs("x-small") onClicked: { @@ -255,7 +256,7 @@ Page { id: selectAll visible: true source: "qrc:/images/select.svg" - height: units.gu(3) + height: units.gu(5) label.text: qsTr("All") label.font.pointSize: units.fs("x-small") onClicked: selectAllClicked() @@ -265,7 +266,7 @@ Page { id: selectNone visible: true source: "qrc:/images/select-undefined.svg" - height: units.gu(3) + height: units.gu(5) label.text: qsTr("Clear") label.font.pointSize: units.fs("x-small") onClicked: selectNoneClicked() @@ -275,7 +276,7 @@ Page { id: addToQueue visible: true source: "qrc:/images/add.svg" - height: units.gu(3) + height: units.gu(5) onClicked: addToQueueClicked() } @@ -283,7 +284,7 @@ Page { id: addToPlaylist visible: true source: "qrc:/images/add-to-playlist.svg" - height: units.gu(3) + height: units.gu(5) onClicked: addToPlaylistClicked() } } @@ -293,7 +294,7 @@ Page { anchors.right: parent.right visible: true source: "qrc:/images/delete.svg" - height: units.gu(3) + height: units.gu(5) onClicked: removeSelectedClicked() } } @@ -314,18 +315,18 @@ Page { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - anchors.topMargin: units.gu(1.5) + anchors.topMargin: units.gu(1) anchors.leftMargin: units.gu(1) anchors.rightMargin: units.gu(1) height: units.gu(3) color: "transparent" Row { - spacing: units.gu(3) + spacing: units.gu(1) Icon { source: "qrc:/images/media-playlist.svg" - height: units.gu(3) + height: units.gu(5) label.text: player.queueInfo label.font.pointSize: units.fs("x-small") @@ -341,7 +342,7 @@ Page { id: reload visible: true source: "qrc:/images/reload.svg" - height: units.gu(3) + height: units.gu(5) onClicked: reloadClicked() } @@ -349,7 +350,7 @@ Page { id: groupAll visible: true source: "qrc:/images/select.svg" - height: units.gu(3) + height: units.gu(5) label.text: qsTr("All") label.font.pointSize: units.fs("x-small") onClicked: groupAllZoneClicked() @@ -359,7 +360,7 @@ Page { id: group visible: true source: "qrc:/images/group.svg" - height: units.gu(3) + height: units.gu(5) label.text: qsTr("Done") label.font.pointSize: units.fs("x-small") onClicked: groupZoneClicked() @@ -383,18 +384,18 @@ Page { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - anchors.topMargin: units.gu(1.5) + anchors.topMargin: units.gu(1) anchors.leftMargin: units.gu(1) anchors.rightMargin: units.gu(1) height: units.gu(3) color: "transparent" Row { - spacing: units.gu(3) + spacing: units.gu(1) Icon { source: "qrc:/images/location.svg" - height: units.gu(3) + height: units.gu(5) label.text: currentZoneTag label.font.pointSize: units.fs("x-small") } @@ -403,7 +404,7 @@ Page { id: groupAllRoom visible: true source: "qrc:/images/select-undefined.svg" - height: units.gu(3) + height: units.gu(5) label.text: qsTr("None") label.font.pointSize: units.fs("x-small") onClicked: groupNoneRoomClicked() @@ -413,7 +414,7 @@ Page { id: groupRoom visible: true source: "qrc:/images/group.svg" - height: units.gu(3) + height: units.gu(5) label.text: qsTr("Done") label.font.pointSize: units.fs("x-small") onClicked: groupRoomClicked() diff --git a/gui/components/MusicRow.qml b/gui/components/MusicRow.qml index 5c1c8012..4e2a4a4b 100644 --- a/gui/components/MusicRow.qml +++ b/gui/components/MusicRow.qml @@ -144,8 +144,8 @@ Row { id: action2 visible: false anchors.right: action.left - anchors.rightMargin: units.gu(2) - width: visible ? units.gu(3) : 0 + anchors.rightMargin: units.gu(1) + width: visible ? units.gu(5) : 0 property alias iconSource: icon2.source Rectangle { @@ -168,8 +168,8 @@ Row { id: action visible: false anchors.right: menu.left - anchors.rightMargin: units.gu(2) - width: units.gu(3) + anchors.rightMargin: units.gu(1) + width: units.gu(5) property alias iconSource: icon.source Rectangle { @@ -200,7 +200,7 @@ Row { height: row.height Icon { - width: menu.visible ? units.gu(3) : 0 + width: menu.visible ? units.gu(5) : 0 height: width anchors.centerIn: parent source: "qrc:/images/contextual-menu.svg" diff --git a/gui/components/MusicToolbar.qml b/gui/components/MusicToolbar.qml index 9b24fbe7..f80e4f25 100644 --- a/gui/components/MusicToolbar.qml +++ b/gui/components/MusicToolbar.qml @@ -107,7 +107,7 @@ Item { } visible: player.currentCount > 0 color: styleMusic.playerControls.foregroundColor - height: units.gu(4) + height: units.gu(6) source: player.isPlaying ? "qrc:/images/media-playback-pause.svg" : "qrc:/images/media-playback-start.svg" width: height } @@ -122,7 +122,7 @@ Item { } visible: player.currentCount === 0 color: styleMusic.playerControls.foregroundColor - height: units.gu(4) + height: units.gu(6) source: "qrc:/images/input.svg" width: height } @@ -213,7 +213,7 @@ Item { verticalCenter: parent.verticalCenter } color: styleMusic.playerControls.foregroundColor - height: units.gu(4) + height: units.gu(6) source: player.playbackState === "PLAYING" ? "qrc:/images/media-playback-pause.svg" : "qrc:/images/media-playback-start.svg" objectName: "playShape" width: height diff --git a/gui/components/NowPlayingSidebar.qml b/gui/components/NowPlayingSidebar.qml index 5a18da67..20fda733 100644 --- a/gui/components/NowPlayingSidebar.qml +++ b/gui/components/NowPlayingSidebar.qml @@ -77,7 +77,7 @@ Page { } footer: Item { - height: units.gu(6) + height: units.gu(7.25) width: parent.width Rectangle { @@ -91,21 +91,20 @@ Page { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - anchors.topMargin: units.gu(1.5) anchors.rightMargin: units.gu(1) - height: units.gu(3) + height: parent.height color: "transparent" // Page actions Item { id: optionsMenu anchors.right: parent.right - width: units.gu(4) + width: units.gu(5) height: parent.height visible: true Icon { - width: units.gu(3) + width: units.gu(5) height: width anchors.centerIn: parent source: "qrc:/images/contextual-menu.svg" diff --git a/gui/components/NowPlayingToolbar.qml b/gui/components/NowPlayingToolbar.qml index 927c37ce..da9df600 100644 --- a/gui/components/NowPlayingToolbar.qml +++ b/gui/components/NowPlayingToolbar.qml @@ -66,7 +66,7 @@ Item { id: nowPlayingMuteButton anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter - height: units.gu(4) + height: units.gu(6) width: height source: player.mute ? "qrc:/images/audio-volume-muted.svg" : "qrc:/images/audio-volume.svg" objectName: "muteShape" @@ -133,7 +133,7 @@ Item { id: nightmodeButton anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - height: units.gu(4) + height: units.gu(6) width: height source: player.nightmodeEnabled ? "qrc:/images/nightmode-enabled.svg" : "qrc:/images/nightmode-disabled.svg" objectName: "nightmodeShape" @@ -168,7 +168,7 @@ Item { Icon { id: repeatIcon - height: units.gu(3) + height: units.gu(5) width: height anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter @@ -196,7 +196,7 @@ Item { Icon { id: nowPlayingPreviousIndicator - height: units.gu(3) + height: units.gu(5) width: height anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter @@ -211,13 +211,13 @@ Item { Rectangle { id: nowPlayingPlayButton anchors.centerIn: parent - height: units.gu(6) + height: units.gu(8) width: height color: "transparent" Icon { id: nowPlayingPlayIndicator - height: units.gu(6) + height: units.gu(8) width: height anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter @@ -239,7 +239,7 @@ Item { Icon { id: nowPlayingNextIndicator - height: units.gu(3) + height: units.gu(5) width: height anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter @@ -263,7 +263,7 @@ Item { Icon { id: shuffleIcon - height: units.gu(3) + height: units.gu(5) width: height anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter diff --git a/gui/components/RenderingControlerView.qml b/gui/components/RenderingControlerView.qml index e8b69a88..ce792dde 100644 --- a/gui/components/RenderingControlerView.qml +++ b/gui/components/RenderingControlerView.qml @@ -78,7 +78,7 @@ MusicListView { id: muteButton anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter - height: units.gu(4) + height: units.gu(5) width: height source: model.mute ? "qrc:/images/audio-volume-muted.svg" : "qrc:/images/audio-volume.svg" opacity: model.mute ? 1.0 : 0.6 @@ -137,7 +137,7 @@ MusicListView { anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter source: "qrc:/images/grip.svg" - width: units.gu(3) + width: units.gu(5) height: width opacity: renderingControlList.held ? 1.0 : 0.6 color: renderingControlList.foregroundColor diff --git a/gui/components/Units.qml b/gui/components/Units.qml index a6d01a52..6f5401ee 100644 --- a/gui/components/Units.qml +++ b/gui/components/Units.qml @@ -14,16 +14,29 @@ Item { } function fs(s) { - if (s === "x-small") - return 9.0 * scaleFactor * fontScaleFactor; - if (s === "small") - return 10.0 * scaleFactor * fontScaleFactor; - if (s === "medium") - return 11.0 * scaleFactor * fontScaleFactor; - if (s === "large") - return 13.0 * scaleFactor * fontScaleFactor; - if (s === "x-large") - return 18.0 * scaleFactor * fontScaleFactor; + if (Android) { + if (s === "x-small") + return 12.0 * scaleFactor * fontScaleFactor; + if (s === "small") + return 14.0 * scaleFactor * fontScaleFactor; + if (s === "medium") + return 16.0 * scaleFactor * fontScaleFactor; + if (s === "large") + return 18.0 * scaleFactor * fontScaleFactor; + if (s === "x-large") + return 25.0 * scaleFactor * fontScaleFactor; + } else { + if (s === "x-small") + return 9.0 * scaleFactor * fontScaleFactor; + if (s === "small") + return 10.0 * scaleFactor * fontScaleFactor; + if (s === "medium") + return 11.0 * scaleFactor * fontScaleFactor; + if (s === "large") + return 13.0 * scaleFactor * fontScaleFactor; + if (s === "x-large") + return 18.0 * scaleFactor * fontScaleFactor; + } return 0.0; } diff --git a/gui/components/ViewButton/PlayAllButton.qml b/gui/components/ViewButton/PlayAllButton.qml index eb40bc9b..af9dd599 100644 --- a/gui/components/ViewButton/PlayAllButton.qml +++ b/gui/components/ViewButton/PlayAllButton.qml @@ -20,8 +20,8 @@ import QtQuick.Controls 2.2 import "../" Icon { - height: units.gu(3) - width: units.gu(15) + height: units.gu(5) + width: units.gu(20) source: "qrc:/images/media-playback-start.svg" label { //: this appears in a button with limited space (around 14 characters) diff --git a/gui/components/ViewButton/QueueAllButton.qml b/gui/components/ViewButton/QueueAllButton.qml index 94b6c7b6..c6b9b6b0 100644 --- a/gui/components/ViewButton/QueueAllButton.qml +++ b/gui/components/ViewButton/QueueAllButton.qml @@ -20,8 +20,8 @@ import QtQuick.Controls 2.2 import "../" Icon { - height: units.gu(3) - width: units.gu(15) + height: units.gu(5) + width: units.gu(20) source: "qrc:/images/add.svg" label { //: this appears in a button with limited space (around 14 characters) diff --git a/gui/components/ViewButton/ShuffleButton.qml b/gui/components/ViewButton/ShuffleButton.qml index 0e7d6cd7..69e1a7a4 100644 --- a/gui/components/ViewButton/ShuffleButton.qml +++ b/gui/components/ViewButton/ShuffleButton.qml @@ -20,8 +20,8 @@ import QtQuick.Controls 2.2 import "../" Icon { - height: units.gu(3) - width: units.gu(15) + height: units.gu(5) + width: units.gu(20) source: "qrc:/images/media-playlist-shuffle.svg" label { //: this appears in a button with limited space (around 14 characters) diff --git a/gui/noson.cpp b/gui/noson.cpp index a4918190..59b0b67e 100644 --- a/gui/noson.cpp +++ b/gui/noson.cpp @@ -53,7 +53,11 @@ int main(int argc, char *argv[]) { if (settings.value("style").isNull()) { +#ifdef Q_OS_ANDROID + QQuickStyle::setStyle("Material"); +#else QQuickStyle::setStyle("Universal"); +#endif settings.setValue("style", QQuickStyle::name()); } QQuickStyle::setStyle(settings.value("style").toString()); @@ -64,10 +68,22 @@ int main(int argc, char *argv[]) engine.setNetworkAccessManagerFactory(new DiskCacheFactory(100 * 1000 * 1000)); // bind arguments engine.rootContext()->setContextProperty("ApplicationArguments", app.arguments()); + // bind Android flag +#ifdef Q_OS_ANDROID + engine.rootContext()->setContextProperty("Android", true); +#else + engine.rootContext()->setContextProperty("Android", false); +#endif // select and bind styles available and known to work QStringList availableStyles; for (QString style : QQuickStyle::availableStyles()) { +#ifdef Q_OS_ANDROID + if (style == "Default") + availableStyles.append(style); + else if (style == "Material") + availableStyles.append(style); +#else if (style == "Default") availableStyles.append(style); else if (style == "Fusion") @@ -78,6 +94,7 @@ int main(int argc, char *argv[]) availableStyles.append(style); else if (style == "Universal") availableStyles.append(style); +#endif } engine.rootContext()->setContextProperty("AvailableStyles", availableStyles); @@ -137,11 +154,13 @@ void prepareTranslator(QGuiApplication& app, const QString& translationPath, con void doExit(int code) { +#ifndef Q_OS_ANDROID if (code == 16) { QStringList args = QCoreApplication::arguments(); args.removeFirst(); QProcess::startDetached(QCoreApplication::applicationFilePath(), args); } +#endif QCoreApplication::quit(); } diff --git a/gui/noson.qml b/gui/noson.qml index bc72ab73..a81ab1a1 100644 --- a/gui/noson.qml +++ b/gui/noson.qml @@ -916,7 +916,7 @@ ApplicationWindow { height: width Icon { - width: units.gu(3) + width: units.gu(5) height: width anchors.centerIn: parent source: { @@ -967,7 +967,7 @@ ApplicationWindow { /* Show more info */ Icon { id: iconInfo - width: units.gu(3) + width: units.gu(5) height: width anchors.verticalCenter: parent.Center anchors.right: parent.right @@ -1012,7 +1012,7 @@ ApplicationWindow { height: width Icon { - width: units.gu(3) + width: units.gu(5) height: width anchors.centerIn: parent source: "qrc:/images/home.svg" @@ -1026,7 +1026,7 @@ ApplicationWindow { } Icon { - width: units.gu(3) + width: units.gu(5) height: width anchors.centerIn: parent source: "qrc:/images/contextual-menu.svg" @@ -1190,15 +1190,16 @@ ApplicationWindow { spacing: units.gu(1) RowLayout { - spacing: units.gu(1) + spacing: 0 Icon { - height: units.gu(3) + height: units.gu(5) width: height source: "qrc:/images/font-scalling.svg" - anchors.rightMargin: units.gu(1) + hoverEnabled: false } SpinBox { id: fontScaleBox + enabled: !Android from: 50 value: settings.fontScaleFactor * 100 to: 200 @@ -1234,14 +1235,16 @@ ApplicationWindow { } RowLayout { - spacing: units.gu(1) + spacing: 0 Icon { - height: units.gu(3) + height: units.gu(5) width: height source: "qrc:/images/graphic-scalling.svg" + hoverEnabled: false } SpinBox { id: scaleBox + enabled: !Android from: 50 value: settings.scaleFactor * 100 to: 400 diff --git a/gui/ui/AddToPlaylist.qml b/gui/ui/AddToPlaylist.qml index 74d1e904..56a3235c 100644 --- a/gui/ui/AddToPlaylist.qml +++ b/gui/ui/AddToPlaylist.qml @@ -101,13 +101,13 @@ MusicPage { color: "transparent" Row { - spacing: units.gu(3) + spacing: units.gu(1) Icon { id: selectorFind visible: true source: "qrc:/images/find.svg" - height: units.gu(3) + height: units.gu(5) onClicked: searchClicked() } @@ -115,7 +115,7 @@ MusicPage { id: add visible: true source: "qrc:/images/add.svg" - height: units.gu(3) + height: units.gu(5) label.text: qsTr("Add") label.font.pointSize: units.fs("x-small") onClicked: addClicked() diff --git a/gui/ui/SongsView.qml b/gui/ui/SongsView.qml index 1e64d9b1..3a98cb65 100644 --- a/gui/ui/SongsView.qml +++ b/gui/ui/SongsView.qml @@ -243,19 +243,19 @@ MusicPage { id: blurredHeader isFavorite: songStackPage.isFavorite rightColumn: Column { - spacing: units.gu(2) + spacing: units.gu(1) ShuffleButton { model: songsModel - width: blurredHeader.width > mainView.wideSongView ? units.gu(23.5) : (blurredHeader.width - units.gu(13)) / 2 + width: units.gu(24) } QueueAllButton { containerItem: songStackPage.containerItem - width: blurredHeader.width > mainView.wideSongView ? units.gu(23.5) : (blurredHeader.width - units.gu(13)) / 2 + width: units.gu(24) visible: containerItem ? true : false } PlayAllButton { containerItem: songStackPage.containerItem - width: blurredHeader.width > mainView.wideSongView ? units.gu(23.5) : (blurredHeader.width - units.gu(13)) / 2 + width: units.gu(24) visible: containerItem ? true : false }