Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Mar 25, 2024
1 parent 01ea468 commit d52b60e
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 47 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $ make
> [SingleApplication](src/thirdparty/SingleApplication/README.md) Keep only one instance of your application active at a time
#### QML components
#### QML component library

> TODO
Expand Down
4 changes: 2 additions & 2 deletions qml/ScreenAbout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ Loader {

Column {
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: 2
anchors.verticalCenterOffset: -2

Text {
text: "QmlAppTemplate"
color: Theme.colorText
font.pixelSize: 28
font.pixelSize: Theme.fontSizeTitle
}
Text {
color: Theme.colorSubText
Expand Down
98 changes: 67 additions & 31 deletions qml/ScreenDesktopComponents.qml
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ Loader {
Text {
anchors.verticalCenter: parent.verticalCenter

text: "OS theme"
text: "OS theme is"
font.pixelSize: Theme.fontSizeContent
font.bold: true
color: Theme.colorText
Expand All @@ -336,12 +336,9 @@ Loader {

////

Rectangle { // separator
height: 2
color: Theme.colorSeparator
anchors.left: parent.left
ListSeparator {
height: Theme.componentBorderWidth
anchors.leftMargin: -24
anchors.right: parent.right
anchors.rightMargin: -24
}

Expand Down Expand Up @@ -586,6 +583,60 @@ Loader {
}

////
/*
Row {
anchors.left: parent.left
anchors.right: parent.right
spacing: Theme.componentMargin
Rectangle { // new effect
id: rectangle1
width: 64
height: 64
color: "red"
layer.enabled: true
layer.effect: MultiEffect {
autoPaddingEnabled: false
maskEnabled: true
maskInverted: false
maskThresholdMin: 0.5
maskSpreadAtMin: 1.0
maskSpreadAtMax: 0.0
maskSource: ShaderEffectSource {
sourceItem: Rectangle {
height: rectangle1.height
width: rectangle1.width
radius: 64
}
}
blurEnabled: false
blur: 0.5
}
}
Rectangle { // old effect
id: rectangle2
width: 64
height: 64
color: "red"
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle {
height: rectangle2.height
width: rectangle2.width
radius: 64
}
}
}
}
*/
////

Row {
anchors.left: parent.left
Expand Down Expand Up @@ -627,12 +678,9 @@ Loader {

////////////////////////

Rectangle { // separator
height: 2
color: Theme.colorSeparator
anchors.left: parent.left
ListSeparator {
height: Theme.componentBorderWidth
anchors.leftMargin: -24
anchors.right: parent.right
anchors.rightMargin: -24
}

Expand Down Expand Up @@ -682,12 +730,9 @@ Loader {

////////////////////////

Rectangle { // separator
height: 2
color: Theme.colorSeparator
anchors.left: parent.left
ListSeparator {
height: Theme.componentBorderWidth
anchors.leftMargin: -24
anchors.right: parent.right
anchors.rightMargin: -24
}

Expand Down Expand Up @@ -743,12 +788,9 @@ Loader {

////////////////////////

Rectangle { // separator
height: 2
color: Theme.colorSeparator
anchors.left: parent.left
ListSeparator {
height: Theme.componentBorderWidth
anchors.leftMargin: -24
anchors.right: parent.right
anchors.rightMargin: -24
}

Expand Down Expand Up @@ -778,12 +820,9 @@ Loader {

////////////////////////

Rectangle { // separator
height: 2
color: Theme.colorSeparator
anchors.left: parent.left
ListSeparator {
height: Theme.componentBorderWidth
anchors.leftMargin: -24
anchors.right: parent.right
anchors.rightMargin: -24
}

Expand Down Expand Up @@ -894,12 +933,9 @@ Loader {

////////////////////////

Rectangle { // separator
height: 2
color: Theme.colorSeparator
anchors.left: parent.left
ListSeparator {
height: Theme.componentBorderWidth
anchors.leftMargin: -24
anchors.right: parent.right
anchors.rightMargin: -24
}

Expand Down
15 changes: 13 additions & 2 deletions qml/popups/PopupChoice.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import QtQuick
import QtQuick.Effects
import QtQuick.Controls

import ThemeEngine
Expand All @@ -10,9 +11,10 @@ Popup {
y: singleColumn ? (appWindow.height - height)
: ((appWindow.height / 2) - (height / 2))

width: singleColumn ? appWindow.width : 640
width: singleColumn ? appWindow.width : 720
height: columnContent.height + padding*2 + screenPaddingNavbar + screenPaddingBottom
padding: Theme.componentMarginXL
margins: 0

dim: true
modal: true
Expand All @@ -24,6 +26,8 @@ Popup {

////////////////////////////////////////////////////////////////////////////

//enter: Transition { NumberAnimation { property: "opacity"; from: 0.333; to: 1.0; duration: 233; } }

background: Rectangle {
color: Theme.colorBackground
border.color: Theme.colorSeparator
Expand All @@ -36,6 +40,13 @@ Popup {
visible: singleColumn
color: Theme.colorSeparator
}

layer.enabled: !singleColumn
layer.effect: MultiEffect {
autoPaddingEnabled: true
shadowEnabled: true
shadowColor: ThemeEngine.isLight ? "#aa000000" : "#aaffffff"
}
}

////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -76,7 +87,7 @@ Popup {
width: parent.width
spacing: Theme.componentMargin

property var btnSize: singleColumn ? width : ((width-spacing*2) / 3)
property int btnSize: singleColumn ? width : ((width-spacing*2) / 3)

ButtonWireframe {
width: parent.btnSize
Expand Down
12 changes: 11 additions & 1 deletion qml/popups/PopupMessage.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import QtQuick
import QtQuick.Effects
import QtQuick.Controls

import ThemeEngine
Expand All @@ -10,7 +11,7 @@ Popup {
y: singleColumn ? (appWindow.height - height)
: ((appWindow.height / 2) - (height / 2))

width: singleColumn ? appWindow.width : 640
width: singleColumn ? appWindow.width : 720
height: columnContent.height + padding*2 + screenPaddingNavbar + screenPaddingBottom
padding: Theme.componentMarginXL
margins: 0
Expand All @@ -25,6 +26,8 @@ Popup {

////////////////////////////////////////////////////////////////////////////

//enter: Transition { NumberAnimation { property: "opacity"; from: 0.333; to: 1.0; duration: 233; } }

background: Rectangle {
color: Theme.colorBackground
border.color: Theme.colorSeparator
Expand All @@ -37,6 +40,13 @@ Popup {
visible: singleColumn
color: Theme.colorSeparator
}

layer.enabled: !singleColumn
layer.effect: MultiEffect {
autoPaddingEnabled: true
shadowEnabled: true
shadowColor: ThemeEngine.isLight ? "#aa000000" : "#aaffffff"
}
}

////////////////////////////////////////////////////////////////////////////
Expand Down
26 changes: 18 additions & 8 deletions src/thirdparty/AppUtils/AppUtils.pri
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

# Optional stuff (for iOS)
#CONFIG += UTILS_NOTIFICATIONS_ENABLED
#CONFIG += UTILS_WIFI_ENABLED

# Generic utils
SOURCES += $${PWD}/utils_app.cpp \
$${PWD}/utils_bits.cpp \
Expand Down Expand Up @@ -55,6 +59,8 @@ win32 {

# Android OS utils
android {
DEFINES += UTILS_NOTIFICATIONS_ENABLED UTILS_WIFI_ENABLED

versionAtLeast(QT_VERSION, 6.0) {
QT += core-private

Expand All @@ -70,19 +76,23 @@ android {

# iOS utils
ios {
QT += quick

LIBS += -framework UIKit
SOURCES += $${PWD}/utils_os_ios.mm
HEADERS += $${PWD}/utils_os_ios.h

# iOS notifications (optional)
#LIBS += -framework UserNotifications
#SOURCES += $${PWD}/utils_os_ios_notif.mm
#HEADERS += $${PWD}/utils_os_ios_notif.h
UTILS_NOTIFICATIONS_ENABLED {
DEFINES += UTILS_NOTIFICATIONS_ENABLED
LIBS += -framework UserNotifications
SOURCES += $${PWD}/utils_os_ios_notif.mm
HEADERS += $${PWD}/utils_os_ios_notif.h
}

# iOS WiFi SSID (optional)
#LIBS += -framework SystemConfiguration
#SOURCES += $${PWD}/utils_os_ios_wifi.mm
#HEADERS += $${PWD}/utils_os_ios_wifi.h
UTILS_WIFI_ENABLED {
DEFINES += UTILS_WIFI_ENABLED
LIBS += -framework SystemConfiguration
SOURCES += $${PWD}/utils_os_ios_wifi.mm
HEADERS += $${PWD}/utils_os_ios_wifi.h
}
}
4 changes: 2 additions & 2 deletions src/thirdparty/AppUtils/utils_wifi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#if defined(Q_OS_ANDROID)
#include "utils_os_android.h"
#elif defined(Q_OS_IOS)
#elif defined(Q_OS_IOS) && defined(UTILS_WIFI_ENABLED)
#include "utils_os_ios_wifi.h"
#endif

Expand Down Expand Up @@ -114,7 +114,7 @@ void UtilsWiFi::refreshWiFi_internal()
#if defined(Q_OS_ANDROID)
m_currentSSID = UtilsAndroid::getWifiSSID();
Q_EMIT wifiChanged();
#elif defined(Q_OS_IOS)
#elif defined(Q_OS_IOS) && defined(UTILS_WIFI_ENABLED)
m_currentSSID = UtilsIOS::getWifiSSID();
Q_EMIT wifiChanged();
#else
Expand Down

0 comments on commit d52b60e

Please sign in to comment.