From f4190616582cc03a2379e74aec6d7d265c7e0930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dr=2E=20J=C3=B6rg=20Wurzer?= Date: Sun, 2 Jun 2024 17:46:03 +0200 Subject: [PATCH 1/2] Cusom presets and fixes --- AppGrid.qml | 5 +- AppGroup.qml | 4 +- Checkbox.qml | 3 +- Collections.qml | 33 ++++---- Conversation.qml | 3 +- Details.qml | 2 +- Settings.qml | 58 ++++++++------ Springboard.qml | 8 +- android/AndroidManifest.xml | 2 +- .../volla/launcher/worker/MessageWorker.java | 3 +- fileio.cpp | 32 ++++++-- fileio.h | 1 + main.qml | 78 ++++++++++++++----- qtquickcontrols2.conf | 3 - 14 files changed, 160 insertions(+), 75 deletions(-) diff --git a/AppGrid.qml b/AppGrid.qml index 9361e597..05bc5453 100644 --- a/AppGrid.qml +++ b/AppGrid.qml @@ -245,6 +245,7 @@ LauncherPage { "headerPointSize": mainView.mediumFontSize, "innerSpacing": mainView.innerSpacing, "backgroundOpacity": mainView.backgroundOpacity, + "accentColor": mainView.accentColor, "desaturation": settings.useColoredIcons ? 0.0 : 1.0, "pinnedShortcuts": index === 0 ? appLauncher.pinnedShortcuts : new Array, "apps": appGroupInfos["apps"]} @@ -369,7 +370,7 @@ LauncherPage { background: Rectangle { id: menuBackground implicitWidth: contextMenu.menuWidth - color: Universal.accent + color: mainView.accentColor radius: mainView.innerSpacing } @@ -512,6 +513,8 @@ LauncherPage { var groupedApps = appLauncher.getGroupedApps(appsArray) appLauncher.appGroups = new Array appLauncher.createAppGroups(groupedApps) + // Workaround, if users didn't update the os version + if (!appsString.contains("org.fossify.gallery")) mainView.galleryApp = "com.simplemobiletools.gallery.pro" } else { console.log("AppLauncher | Need to retrieve apps from system") mainView.updateSpinner(true) diff --git a/AppGroup.qml b/AppGroup.qml index d8e87134..bec04077 100644 --- a/AppGroup.qml +++ b/AppGroup.qml @@ -21,6 +21,8 @@ Item { property double headerPointSize property double backgroundOpacity property double desaturation: 1.0 + property var accentColor + property int groupIndex: 0 property int selectedGroupIndex: 1 @@ -268,7 +270,7 @@ Item { width: parent.width * 0.15 height: parent.width * 0.15 radius: height * 0.5 - color: Universal.accent + color: accentColor } } diff --git a/Checkbox.qml b/Checkbox.qml index c68411f8..5650d653 100644 --- a/Checkbox.qml +++ b/Checkbox.qml @@ -14,6 +14,7 @@ CheckBox { property bool hasDescriptionButton: false property bool isToggle: false property int startX: 0 + property var accentColor width: parent.width text: qsTr("Chip") @@ -68,7 +69,7 @@ CheckBox { x: settingsCheckbox.leftPadding y: settingsCheckbox.height / 2 - circleSize / 2 radius: width / 2 - color: settingsCheckbox.checked ? Universal.accent : Universal.foreground + color: settingsCheckbox.checked ? accentColor : Universal.foreground opacity: settingsCheckbox.checked ? 1.0 : 0.3 } diff --git a/Collections.qml b/Collections.qml index 85745809..aa02ef8f 100644 --- a/Collections.qml +++ b/Collections.qml @@ -143,6 +143,7 @@ LauncherPage { id: listView anchors.fill: parent headerPositioning: mainView.backgroundOpacity === 1.0 ? ListView.PullBackHeader : ListView.InlineHeader + clip: true header: Column { id: header @@ -348,7 +349,7 @@ LauncherPage { } GradientStop { position: 1.0 - color: backgroundItem.isMenuStatus ? Universal.accent : contactColumn.gradientColer + color: backgroundItem.isMenuStatus ? mainView.accemtColor : contactColumn.gradientColer } } visible: mainView.backgroundOpacity === 1.0 @@ -359,12 +360,21 @@ LauncherPage { width: contactColumn.columnWidth text: model.c_TEXT !== undefined ? model.c_TEXT : "" font.pointSize: mainView.largeFontSize - color: backgroundItem.isMenuStatus ? "white" : mainView.fontColor + //renderType: Text.NativeRendering + verticalAlignment: Text.AlignVCenter lineHeight: 1.1 opacity: 0.9 + color: backgroundItem.isMenuStatus ? "white" : mainView.fontColor wrapMode: Text.WordWrap elide: Text.ElideRight visible: model.c_TEXT !== undefined + + // Workaround +// onLineLaidOut: { +// console.log("Collection | LINE " + line.x + ", " + line.y) +// line.x = 110 +// line.y = line.y * 1.5 +// } } Row { id: statusRow @@ -376,7 +386,7 @@ LauncherPage { height: mainView.smallFontSize * 0.6 y: mainView.smallFontSize * 0.3 radius: height * 0.5 - color: backgroundItem.isMenuStatus ? "transparent" : Universal.accent + color: backgroundItem.isMenuStatus ? "transparent" : mainView.accentColor } Label { id: statusLabel @@ -405,7 +415,7 @@ LauncherPage { } GradientStop { position: 1.0 - color: backgroundItem.isMenuStatus ? Universal.accent : contactColumn.gradientColer + color: backgroundItem.isMenuStatus ? mainView.accentColor : contactColumn.gradientColer } } visible: mainView.backgroundOpacity === 1.0 @@ -451,7 +461,7 @@ LauncherPage { width: collectionPage.iconSize * 0.25 height: collectionPage.iconSize * 0.25 radius: height * 0.5 - color: Universal.accent + color: mainView.accentColor } Column { id: contactMenu @@ -533,7 +543,7 @@ LauncherPage { onPressAndHold: { if (currentCollectionMode === mainView.collectionMode.People) { contactMenu.visible = true - contactBox.color = Universal.accent + contactBox.color = mainView.accentColor preventStealing = true isMenuStatus = true } @@ -625,9 +635,9 @@ LauncherPage { var now = new Date() collectionPage.threads.forEach(function (thread, index) { - console.log("Collections | Thread: " + thread["address"]) - if ((!thread["read"] || now.getTime() - thread["date"] < collectionPage.messageAge) && thread["address"] !== undefined) { - console.log("Collections | Thread matched: " + thread["address"]) + console.log("Collections | Thread: " + thread["address"] + ", " + thread["person"]) + if ((!thread["read"] || now.getTime() - thread["date"] < collectionPage.messageAge) + && (thread["address"].length > 0 || thread["person"] !== undefined)) { if (thread["isSignal"]) contactThreads[thread["person"]] = thread else contactThreads[thread["address"]] = thread } @@ -750,7 +760,6 @@ LauncherPage { for (var i = 0; i < modelArr.length; i++) { var aContact = modelArr[i] if (aContact.c_ID === contactId) { - console.log("Collections | Contact in list model matched") aContact.c_ICON = contactImage modelArr[i] = aContact break @@ -759,7 +768,6 @@ LauncherPage { for (i = 0; i < count; i++) { var elem = get(i) if (elem.c_ID === contactId) { - console.log("Collections | Contact in list view matched") elem.c_ICON = "data:image/png;base64," + contactImage set(i, elem) break @@ -768,7 +776,6 @@ LauncherPage { for (i = 0; i < mainView.getContacts().length; i++) { aContact = mainView.getContacts()[i] if (aContact["id"] === contactId) { - console.log("Collections | Contact in contacts matched") aContact["icon"] = contactImage mainView.getContacts()[i] = aContact break @@ -1382,7 +1389,7 @@ LauncherPage { icon.source: Qt.resolvedUrl("icons/notes@4x.png") onPressed: { - backgroundRec.color = Universal.accent + backgroundRec.color = mainView.accentColor opacity: 1.0 } diff --git a/Conversation.qml b/Conversation.qml index 65b6a9df..b1fed585 100644 --- a/Conversation.qml +++ b/Conversation.qml @@ -185,6 +185,7 @@ LauncherPage { ListView { id: listView + clip: true anchors.top: parent.top width: parent.width height: parent.height @@ -603,7 +604,7 @@ LauncherPage { width: messageBox.width * widthFactor text: model.m_ERROR !== undefined ? model.m_ERROR : "" font.pointSize: mainView.smallFontSize - color: Universal.accent + color: mainView.accentColor clip: true opacity: 0.5 horizontalAlignment: Text.AlignLeft diff --git a/Details.qml b/Details.qml index c50d24b8..9d224b14 100644 --- a/Details.qml +++ b/Details.qml @@ -40,7 +40,7 @@ LauncherPage { height: mainView.smallFontSize * 0.6 y: (pinButton.height - pinBadge.height) * 0.5 radius: height * 0.5 - color: Universal.accent + color: mainView.accentColor onVisibleChanged: { dateLabel.leftPadding = pinBadge.visible ? 0.8 : 0.0 } diff --git a/Settings.qml b/Settings.qml index e7fca605..f89737bd 100644 --- a/Settings.qml +++ b/Settings.qml @@ -88,7 +88,7 @@ LauncherPage { color: themeSettingsItem.menuState ? "white" : Universal.foreground background: Rectangle { anchors.fill: parent - color: themeSettingsItem.menuState === true ? Universal.accent : "transparent" + color: themeSettingsItem.menuState === true ? mainView.accentColor : "transparent" } Component.onCompleted: { @@ -122,7 +122,7 @@ LauncherPage { boldText: themeSettingsItem.selectedMenuItem === darkModeOption textColor: "white" textOpacity: themeSettingsItem.labelOpacity - backgroundColor: themeSettingsItem.menuState ? Universal.accent : "transparent" + backgroundColor: themeSettingsItem.menuState ? mainView.accentColor : "transparent" fontPointSize: mainView.mediumFontSize } HighlightButton { @@ -139,7 +139,7 @@ LauncherPage { boldText: themeSettingsItem.selectedMenuItem === lightModeOption textColor: "white" textOpacity: themeSettingsItem.labelOpacity - backgroundColor: themeSettingsItem.menuState ? Universal.accent : "transparent" + backgroundColor: themeSettingsItem.menuState ? mainView.accentColor : "transparent" fontPointSize: mainView.mediumFontSize } HighlightButton { @@ -156,7 +156,7 @@ LauncherPage { boldText: themeSettingsItem.selectedMenuItem === translucentModeOption textColor: "white" textOpacity: themeSettingsItem.labelOpacity - backgroundColor: themeSettingsItem.menuState ? Universal.accent : "transparent" + backgroundColor: themeSettingsItem.menuState ? mainView.accentColor : "transparent" fontPointSize: mainView.mediumFontSize } } @@ -306,7 +306,7 @@ LauncherPage { } background: Rectangle { anchors.fill: parent - color: securitySettingsItem.menuState === true ? Universal.accent : "transparent" + color: securitySettingsItem.menuState === true ? mainView.accentColor : "transparent" } onTextChanged: { @@ -333,7 +333,7 @@ LauncherPage { } background: Rectangle { anchors.fill: parent - color: securitySettingsItem.menuState ? Universal.accent : "transparent" + color: securitySettingsItem.menuState ? mainView.accentColor : "transparent" } } Button { @@ -363,7 +363,7 @@ LauncherPage { } background: Rectangle { anchors.fill: parent - color: securitySettingsItem.menuState ? Universal.accent : "transparent" + color: securitySettingsItem.menuState ? mainView.accentColor : "transparent" } } } @@ -606,6 +606,9 @@ LauncherPage { if (passwordDialog.definePasswordMode && !keepPasswordCheckBox.checked && passwordField.text !== confirmationField.text) { mainView.showToast(qsTr("Wrong password confirmation")) + } else if (passwordDialog.definePasswordMode && !keepPasswordCheckBox.checked + && passwordField.text.length < 5) { + mainView.showToast(qsTr("Password needs at least four characters or numbers")) } else { AN.SystemDispatcher.dispatch( "volla.launcher.securityModeAction", @@ -692,7 +695,7 @@ LauncherPage { "labelFontSize": mainView.mediumFontSize, "circleSize": mainView.largeFontSize, "leftPadding": mainView.innerSpacing, "rightPadding": mainView.innerSpacing, "bottomPadding": mainView.innerSpacing / 2, "topPadding": mainView.innerSpacing / 2, - "hasRemoveButton": true} + "hasRemoveButton": true, "accentColor": mainView.accentColor } var object = component.createObject(newsSettingsItemColumn, properties) object.activeCheckbox = true newsSettingsItemColumn.newsCheckboxes.push(object) @@ -774,7 +777,8 @@ LauncherPage { "labelFontSize": mainView.mediumFontSize, "circleSize": mainView.largeFontSize, "leftPadding": mainView.innerSpacing, "rightPadding": mainView.innerSpacing, "bottomPadding": mainView.innerSpacing / 2, "topPadding": mainView.innerSpacing / 2, - "hasRemoveButton": getFilteredShortcuts(mainView.defaultActions, "id", shortcuts[i]["id"]).length === 0 } + "hasRemoveButton": getFilteredShortcuts(mainView.defaultActions, "id", shortcuts[i]["id"]).length === 0, + "accentColor": mainView.accentColor } var object = component.createObject(shortcutSettingsItemColumn, properties) object.activeCheckbox = true shortcutSettingsItemColumn.checkboxes.push(object) @@ -789,7 +793,7 @@ LauncherPage { "labelFontSize": mainView.mediumFontSize, "circleSize": mainView.largeFontSize, "leftPadding": mainView.innerSpacing, "rightPadding": mainView.innerSpacing, "bottomPadding": mainView.innerSpacing / 2, "topPadding": mainView.innerSpacing / 2, - "hasRemoveButton": true } + "hasRemoveButton": true, "accentColor": mainView.accentColor } var object = component.createObject(shortcutSettingsItemColumn, properties) object.activeCheckbox = true shortcutSettingsItemColumn.checkboxes.push(object) @@ -858,7 +862,7 @@ LauncherPage { background: Rectangle { implicitHeight: contentItem.height implicitWidth: 200 - color: Universal.accent + color: mainView.accentColor radius: mainView.innerSpacing } @@ -895,7 +899,7 @@ LauncherPage { "labelFontSize": mainView.mediumFontSize, "circleSize": mainView.largeFontSize, "leftPadding": mainView.innerSpacing, "rightPadding": mainView.innerSpacing, "bottomPadding": mainView.innerSpacing / 2, "topPadding": mainView.innerSpacing / 2, - "hasRemoveButton": true } + "hasRemoveButton": true, "accentColor": mainView.accentColor } var object = component.createObject(shortcutSettingsItemColumn, properties) shortcutSettingsItemColumn.checkboxes.push(object) appMenu.close() @@ -955,7 +959,8 @@ LauncherPage { "text": qsTr("Signal"), "checked": sourceSettings.signalIsActivated, "labelFontSize": mainView.mediumFontSize, "circleSize": mainView.largeFontSize, "leftPadding": mainView.innerSpacing, "rightPadding": mainView.innerSpacing, - "bottomPadding": mainView.innerSpacing / 2, "topPadding": mainView.innerSpacing / 2 } + "bottomPadding": mainView.innerSpacing / 2, "topPadding": mainView.innerSpacing / 2, + "accentColor": mainView.accentColor} var object = component.createObject(sourceSettingsItemColumn, properties) object.activeCheckbox = true sourceSettingsItemColumn.checkboxes.push(object) @@ -1045,7 +1050,8 @@ LauncherPage { "text": qsTr("DuckDuckGo"), "checked": mainView.getSearchMode() === mainView.searchMode.Duck, "labelFontSize": mainView.mediumFontSize, "circleSize": mainView.largeFontSize, "leftPadding": mainView.innerSpacing, "rightPadding": mainView.innerSpacing, - "bottomPadding": mainView.innerSpacing / 2, "topPadding": mainView.innerSpacing / 2, "isToggle": true } + "bottomPadding": mainView.innerSpacing / 2, "topPadding": mainView.innerSpacing / 2, "isToggle": true, + "accentColor": mainView.accentColor } var object = component.createObject(searchSettingsItemColumn, properties) object.activeCheckbox = true searchSettingsItemColumn.checkboxes.push(object) @@ -1054,6 +1060,7 @@ LauncherPage { properties["actionId"] = "startpage" properties["text"] = qsTr("Startpage") properties["checked"] = mainView.getSearchMode() === mainView.searchMode.StartPage + properties["accentColor"] = mainView.accentColor object = component.createObject(searchSettingsItemColumn, properties) object.activeCheckbox = true searchSettingsItemColumn.checkboxes.push(object) @@ -1062,6 +1069,7 @@ LauncherPage { properties["actionId"] = "metager" properties["text"] = qsTr("MetaGer") properties["checked"] = mainView.getSearchMode() === mainView.searchMode.MetaGer + properties["accentColor"] = mainView.accentColor object = component.createObject(searchSettingsItemColumn, properties) object.activeCheckbox = true searchSettingsItemColumn.checkboxes.push(object) @@ -1140,7 +1148,8 @@ LauncherPage { "text": qsTr("Fullscreen"), "checked": designSettings.fullscreen, "labelFontSize": mainView.mediumFontSize, "circleSize": mainView.largeFontSize, "leftPadding": mainView.innerSpacing, "rightPadding": mainView.innerSpacing, - "bottomPadding": mainView.innerSpacing / 2, "topPadding": mainView.innerSpacing / 2 } + "bottomPadding": mainView.innerSpacing / 2, "topPadding": mainView.innerSpacing / 2, + "accentColor": mainView.accentColor } var object = component.createObject(designSettingsItemColumn, properties) object.activeCheckbox = true designSettingsItemColumn.checkboxes.push(object) @@ -1149,6 +1158,7 @@ LauncherPage { properties["actionId"] = "coloredIcons" properties["text"] = qsTr("Use colored app icons") properties["checked"] = designSettings.useColoredIcons + properties["accentColor"] = mainView.accentColor object = component.createObject(designSettingsItemColumn, properties) object.activeCheckbox = true designSettingsItemColumn.checkboxes.push(object) @@ -1157,6 +1167,7 @@ LauncherPage { properties["actionId"] = "startupIndex" properties["text"] = qsTr("Show apps at startup") properties["checked"] = designSettings.showAppsAtStartup + properties["accentColor"] = mainView.accentColor object = component.createObject(designSettingsItemColumn, properties) object.activeCheckbox = true designSettingsItemColumn.checkboxes.push(object) @@ -1165,6 +1176,7 @@ LauncherPage { properties["actionId"] = "hapticMenus" properties["text"] = qsTr("Use haptic menus") properties["checked"] = designSettings.useHapticMenus + properties["accentColor"] = mainView.accentColor object = component.createObject(designSettingsItemColumn, properties) object.activeCheckbox = true designSettingsItemColumn.checkboxes.push(object) @@ -1173,6 +1185,7 @@ LauncherPage { properties["actionId"] = "useGroupedApps" properties["text"] = qsTr("Show grouped apps") properties["checked"] = designSettings.useGroupedApps + properties["accentColor"] = mainView.accentColor object = component.createObject(designSettingsItemColumn, properties) object.activeCheckbox = true designSettingsItemColumn.checkboxes.push(object) @@ -1181,6 +1194,7 @@ LauncherPage { properties["actionId"] = "useCategories" properties["text"] = qsTr("Use app categories") properties["checked"] = designSettings.useCategories + properties["accentColor"] = mainView.accentColor object = component.createObject(designSettingsItemColumn, properties) object.activeCheckbox = true designSettingsItemColumn.checkboxes.push(object) @@ -1280,8 +1294,8 @@ LauncherPage { implicitWidth: mainView.largeFontSize implicitHeight: mainView.largeFontSize radius: mainView.largeFontSize / 2 - color: Universal.accent - border.color: Universal.accent + color: mainView.accentColor + border.color: mainView.accentColor } onValueChanged: { @@ -1384,7 +1398,7 @@ LauncherPage { "labelFontSize": mainView.mediumFontSize, "circleSize": mainView.largeFontSize, "leftPadding": mainView.innerSpacing, "rightPadding": mainView.innerSpacing, "bottomPadding": mainView.innerSpacing / 2, "topPadding": mainView.innerSpacing / 2, - "hasDescriptionButton": true } + "hasDescriptionButton": true, "accentColor": mainView.accentColor } var object = component.createObject(pluginSettingsItemColumn, properties) object.activeCheckbox = true pluginSettingsItemColumn.checkboxes.push(object) @@ -1583,7 +1597,7 @@ LauncherPage { border.width: 1 } onPressed: { - resetNewsButtonBackground.color = Universal.accent + resetNewsButtonBackground.color = mainView.accentColor } onClicked: { resetNewsButtonBackground.color = "transparent" @@ -1617,7 +1631,7 @@ LauncherPage { border.width: 1 } onPressed: { - reseetShortcutsButtonBackground.color = Universal.accent + reseetShortcutsButtonBackground.color = mainView.accentColor } onClicked: { reseetShortcutsButtonBackground.color = "transparent" @@ -1651,7 +1665,7 @@ LauncherPage { border.width: 1 } onPressed: { - resetContactsButtonBackground.color = Universal.accent + resetContactsButtonBackground.color = mainView.accentColor } onClicked: { resetContactsButtonBackground.color = "transparent" @@ -1685,7 +1699,7 @@ LauncherPage { border.width: 1 } onPressed: { - reseetLauncherButtonBackground.color = Universal.accent + reseetLauncherButtonBackground.color = mainView.accentColor } onClicked: { reseetLauncherButtonBackground.color = "transparent" diff --git a/Springboard.qml b/Springboard.qml index 5d633ad9..c39fce61 100644 --- a/Springboard.qml +++ b/Springboard.qml @@ -666,7 +666,7 @@ LauncherPage { height: button.height width: parent.width - color: model.action < 20000 ? "transparent" : Universal.accent + color: model.action < 20000 ? "transparent" : mainView.accentColor Button { id: button width: parent.width - mainView.innerSpacing @@ -891,7 +891,7 @@ LauncherPage { mainView.updateCollectionPage(mainView.collectionMode.News) break case mainView.actionType.ShowGallery: - console.log("Springboard | Show gallery") + console.log("Springboard | Show gallery " + mainView.galleryApp) AN.SystemDispatcher.dispatch("volla.launcher.runAppAction", {"appId": mainView.galleryApp}) break case mainView.actionType.ShowCalendar: @@ -935,7 +935,7 @@ LauncherPage { anchors.rightMargin: roundedShortcutMenu ? mainView.innerSpacing * 2 : 0 height: dotShortcut ? mainView.innerSpacing * 2 : mainView.innerSpacing width: dotShortcut ? mainView.innerSpacing * 2 : parent.width - color: Universal.accent + color: mainView.accentColor visible: true radius: roundedShortcutMenu ? rootMenuButton.width / 2 : 0 @@ -979,7 +979,7 @@ LauncherPage { visible: true height: dotShortcut ? mainView.innerSpacing * 2 : mainView.innerSpacing width: dotShortcut ? mainView.innerSpacing * 2 : parent.width - color: Universal.accent + color: mainView.accentColor radius: dotShortcut ? width * 0.5 : 0.0 anchors.right: parent.right anchors.rightMargin: dotShortcut ? mainView.innerSpacing * 2 : 0 diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index c23b98d1..2274ab1c 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,5 +1,5 @@ - +