Skip to content

Commit

Permalink
Merge pull request #272 from HelloVolla/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
wurzer authored Dec 8, 2024
2 parents a01c22f + 1a2ab76 commit 2083238
Show file tree
Hide file tree
Showing 27 changed files with 1,011 additions and 130 deletions.
47 changes: 47 additions & 0 deletions AppButton.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Universal 2.12
import QtGraphicalEffects 1.12
import AndroidNative 1.0 as AN

Button {
id: appButton

property var app
property string iconSource
property bool hasColoredIcon

flat:true

background: Rectangle {
color: Universal.foreground
opacity: Universal.theme === Universal.Light ? 0.1 : 0.3
radius: width * 0.5
border.color: "transparent"
}

contentItem: Rectangle {
anchors.fill: parent
color: "transparent"

Image {
id: appIcon
anchors.centerIn: parent
source: iconSource
width: appButton.width * 0.65
height: appButton.width * 0.65

ColorOverlay {
anchors.fill: appIcon
source: appIcon
color: Universal.foreground
visible: !hasColoredIcon
}
}
}

onClicked: {
AN.SystemDispatcher.dispatch("volla.launcher.runAppAction", {"appId": app.package})
}
}
19 changes: 11 additions & 8 deletions AppGrid.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import QtQuick 2.12
import QtQuick.Window 2.2
import QtQuick.Controls 2.5
import QtQuick.Controls.Universal 2.12
import QtQuick.XmlListModel 2.12
Expand All @@ -9,7 +10,7 @@ import FileIO 1.0

LauncherPage {
id: appLauncher
anchors.fill: parent
anchors.fill: parent

property string textInput
property real labelPointSize: 16
Expand Down Expand Up @@ -137,7 +138,7 @@ LauncherPage {

property int appCount: 0
property int selectedGroup: 0
property int maxAppCount: 12
property int maxAppCount: mainView.isTablet ? 15 : 12

property double lastAppsCheck: 0.0

Expand Down Expand Up @@ -194,6 +195,7 @@ LauncherPage {
var appGroup = appLauncher.appGroups[i]
allApps = allApps.concat(appGroup.apps)
}
console.debug("AppGrid | Number of apps: " + allApps.length)
return allApps
}

Expand Down Expand Up @@ -248,13 +250,14 @@ LauncherPage {
"groupIndex": index,
"selectedGroupIndex": appLauncher.selectedGroup,
"textInput": appLauncher.textInput,
"iconMap": appLauncher.iconMap,
"iconMap": mainView.iconMap,
"labelMap": appLauncher.labelMap,
"phoneApp": mainView.phoneApp,
"messageApp": mainView.messageApp,
"labelPointSize": appLauncher.labelPointSize,
"headerPointSize": mainView.mediumFontSize,
"innerSpacing": mainView.innerSpacing,
"componentSpacing" : mainView.componentSpacing,
"backgroundOpacity": mainView.backgroundOpacity,
"accentColor": mainView.accentColor,
"desaturation": settings.useColoredIcons ? 0.0 : 1.0,
Expand Down Expand Up @@ -285,7 +288,7 @@ LauncherPage {

Column {
id: appLauncherColumn
width: parent.width
width: parent.width// - 2 * mainView.outerSpacing

Label {
id: headerTitle
Expand All @@ -298,15 +301,16 @@ LauncherPage {

TextField {
id: headerTextField
padding: mainView.innerSpacing
topPadding: mainView.componentSpacing
bottomPadding: mainView.componentSpacing
leftPadding: 0.0
rightPadding: 0.0
x: mainView.innerSpacing
width: parent.width - mainView.innerSpacing * 2
placeholderText: qsTr("Filter apps")
color: mainView.fontColor
placeholderTextColor: "darkgrey"
font.pointSize: mainView.largeFontSize
leftPadding: 0.0
rightPadding: 0.0

background: Rectangle {
color: "transparent"
Expand Down Expand Up @@ -363,7 +367,6 @@ LauncherPage {
contextMenu.dismiss()
}
}

}

Menu {
Expand Down
48 changes: 33 additions & 15 deletions AppGroup.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import QtQuick 2.12
import QtQuick.Window 2.2
import QtQuick.Controls 2.5
import QtQuick.Controls.Universal 2.12
import QtGraphicalEffects 1.12
Expand All @@ -17,25 +18,39 @@ Item {
property string textInput: ""

property double innerSpacing
property double componentSpacing
property double labelPointSize
property double headerPointSize
property double backgroundOpacity
property double desaturation: 1.0
property var accentColor


property int groupIndex: 0
property int selectedGroupIndex: 1
property int columnCount: Screen.desktopAvailableWidth < 363 ? 4 : Screen.desktopAvailableWidth > 800 ? 8 : 5

property bool unreadMessages: false
property bool newCalls: false
property var notificationData:""

property var accentColor
property var notificationData:""
property var iconMap: ({})
property var labelMap: ({})
property var apps: []
property var pinnedShortcuts: []

Component.onCompleted: {
console.debug("AppGroup | Screen width: " + Screen.desktopAvailableWidth)
columnCount = Screen.desktopAvailableWidth < 363 ? 4 : Screen.desktopAvailableWidth > 800 ? 8 : 5
}

onWidthChanged: {
console.log("AppGroup | Width changed to " + width)
if (width > 820) {
columnCount = 8
} else {
columnCount = 5
}
}

onTextInputChanged: {
console.log("AppGroup " + groupIndex + " | onTextInputChanged")
groupModel.update(groupItem.textInput)
Expand Down Expand Up @@ -84,7 +99,7 @@ Item {
id: groupColumn
width: parent.width
topPadding: groupItem.groupIndex === 0 ? 0 : groupItem.groupIndex === 1 && groupItem.selectedGroupIndex === 0 ?
groupItem.innerSpacing / 2 : groupItem.innerSpacing
groupItem.componentSpacing / 2 : groupItem.componentSpacing
Component.onCompleted: {
groupHeader.visible = !groupGrid.visible
groupHeader2.visible = groupGrid.visible && groupItem.groupIndex > 0 && groupItem.groupLabel.toLowerCase() !== "apps"
Expand Down Expand Up @@ -118,7 +133,10 @@ Item {
Label {
id: groupHeader2
anchors.horizontalCenter: parent.horizontalCenter
padding: groupItem.innerSpacing / 2
topPadding: groupItem.componentSpacing / 2
bottomPadding: groupItem.componentSpacing / 2
leftPadding: groupItem.innerSpacing / 2
rightPadding: groupItem.innerSpacing / 2
visible: false // groupGrid.visible && groupItem.groupIndex > 0 && groupItem.groupLabel.toLowerCase() !== "apps"
text: groupHeader.text
color: Universal.foreground
Expand All @@ -134,9 +152,9 @@ Item {
id: groupGrid
width: parent.width
height: contentHeight
topMargin: groupItem.groupIndex > 0 ? groupItem.innerSpacing / 2 : 0
cellHeight: parent.width * 0.32
cellWidth: parent.width * 0.25
topMargin: groupItem.groupIndex > 0 ? groupItem.compnentSpacing / 2 : 0
cellHeight: parent.width / groupItem.columnCount * 1.28
cellWidth: parent.width / groupItem.columnCount
visible: groupItem.groupIndex === groupItem.selectedGroupIndex
interactive: false

Expand All @@ -146,8 +164,8 @@ Item {

delegate: Rectangle {
id: gridCell
width: parent.width * 0.25
height: parent.width * 0.32
width: groupGrid.cellWidth
height: groupGrid.cellHeight
color: "transparent"

property var gradientColor: Universal.background
Expand All @@ -157,8 +175,8 @@ Item {
id: gridCircle
anchors.top: gridButton.top
anchors.horizontalCenter: parent.horizontalCenter
height: parent.width * 0.6
width: parent.width * 0.6
height: parent.width * 0.55
width: parent.width * 0.55
color: Universal.foreground
opacity: Universal.theme === Universal.Light ? 0.1 : 0.2
radius: width * 0.5
Expand All @@ -167,8 +185,7 @@ Item {
Button {
id: gridButton
anchors.top: parent.top
anchors.topMargin: parent.width * 0.08 // Adjustment
anchors.horizontalCenter: parent.horizontalCenter
anchors.centerIn: gridCell
topPadding: groupItem.innerSpacing / 2
width: parent.width
text: model.label
Expand All @@ -183,6 +200,7 @@ Item {
? Qt.resolvedUrl(groupItem.iconMap[model.package]) : "data:image/png;base64," + model.icon
width: gridButton.width * 0.35
height: gridButton.width * 0.35
cache: false

ColorOverlay {
anchors.fill: buttonIcon
Expand Down
101 changes: 101 additions & 0 deletions Clock.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import QtQuick 2.0

Item {
id : clock
width: 160
height: 160
transformOrigin: Item.Top
property int hours
property int minutes
property int seconds
property real shift : 2
property bool night: false
property bool internationalTime: false //Unset for local time

function timeChanged() {
var date = new Date;
hours = internationalTime ? date.getUTCHours() + Math.floor(clock.shift) : date.getHours()
night = ( hours < 7 || hours > 19 )
minutes = internationalTime ? date.getUTCMinutes() + ((clock.shift % 1) * 60) : date.getMinutes()
seconds = date.getUTCSeconds();
}

Timer {
interval: 1000; running: true; repeat: true;
onTriggered: clock.timeChanged()
}

Item {
width: 160
height: 160
anchors.leftMargin: 10
anchors.topMargin: 10
anchors.fill: parent
anchors.right: parent.right

Image { id: background; width: 160; height: 160;
source: mainView.backgroundColor === "white" ? "images/Clock_01_black.png" : "images/Clock_01_white.png"
visible: clock.night == false }

Image { width: 160; height: 160;
source: mainView.backgroundColor === "white" ? "images/Clock_01_black.png" : "images/Clock_01_white.png"
visible: clock.night == true }


Image {
x: 76; y: 10
height: 140
z: 1
source: mainView.backgroundColor === "white" ? "images/01-black_hours.png": "images/01-white_hours.png"
transform: Rotation {
id: hourRotation
origin.x: 4; origin.y: 70;
angle: (clock.hours * 30) + (clock.minutes * 0.5)
Behavior on angle {
SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
}
}
}

Image {
x: 76; y: 9.2
width: 6
height: 140
z: 5
source: mainView.backgroundColor === "white" ? "images/01-black_minutes.png" : "images/01-white_minutes.png"
transform: Rotation {
id: minuteRotation
origin.x: 4; origin.y: 70;
angle: clock.minutes * 6
Behavior on angle {
SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
}
}
}

Image {
x: 77; y: 9.4
width: 6
height: 140
z: 6
source: "images/01-white_seconds.png"
transform: Rotation {
id: secondRotation
origin.x: 2.7; origin.y: 70;
angle: clock.seconds * 6
Behavior on angle {
SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
}
}
}

Image {
x: 70
width: 20
height: 20
z: 10
transformOrigin: Item.Center
anchors.centerIn: background; source: "images/center.png"
}
}
}
Loading

0 comments on commit 2083238

Please sign in to comment.