Commit fb80d554 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen Committed by GitHub

Merge pull request #70 from neochapay/wallpapper_setup

[Home] set wallpaper is configurable
parents 4622bc51 848ca3ef
......@@ -22,6 +22,8 @@ Requires: libqofono-qt5-declarative
Requires: nemo-theme-glacier
Requires: google-opensans-fonts
Requires: mpris-qt5-qml-plugin
Requires: glacier-settings
Requires: glacier-gallery-qmlplugin
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Quick)
......@@ -63,6 +65,7 @@ ln -s ../lipstick.service %{buildroot}%{_libdir}/systemd/user/user-session.targe
%{_libdir}/systemd/user/user-session.target.wants/lipstick.service
%{_datadir}/lipstick-glacier-home-qt5/nemovars.conf
%{_datadir}/lipstick-glacier-home-qt5/qml
%{_datadir}/glacier-settings/
%post
systemctl-user --no-block restart lipstick.service
......@@ -30,7 +30,6 @@
#include "glacierwindowmodel.h"
#include <QScreen>
int main(int argc, char **argv)
{
HomeApplication app(argc, argv, QString());
......
......@@ -5,7 +5,6 @@ import org.nemomobile.devicelock 1.0
import org.nemomobile.configuration 1.0
import "notifications"
Image {
id: lockScreen
source: lockScreenWallpaper.value
......@@ -13,11 +12,18 @@ Image {
property bool displayOn
ConfigurationValue {
id: differentWallpaper
key: "/home/glacier/differentWallpaper"
defaultValue: true
}
ConfigurationValue{
id: lockScreenWallpaper
key: "/home/glacier/lockScreen/wallpaperImage"
key: (differentWallpaper.value == true) ? "/home/glacier/lockScreen/wallpaperImage" : "/home/glacier/homeScreen/wallpaperImage"
defaultValue: "/usr/share/lipstick-glacier-home-qt5/qml/images/graphics-wallpaper-home.jpg"
}
LockscreenClock {
id: clock
anchors {
......
......@@ -60,8 +60,8 @@ Page {
// This is used in the lock screen
ConfigurationValue {
id: wallpaperSource
key: desktop.isPortrait ? "/desktop/meego/background/portrait/picture_filename" : "/desktop/meego/background/landscape/picture_filename"
defaultValue: "/usr/share/lipstick-glacier-home-qt5/qml/images/graphics-wallpaper-home.jpg"
key: "/home/glacier/homeScreen/wallpaperImage"
defaultValue: "/usr/share/lipstick-glacier-home-qt5/qml/images/wallpaper-portrait-bubbles.png"
}
id: desktop
property alias lockscreen: lockScreen
......@@ -157,7 +157,7 @@ Page {
}
Image {
id:wallpaper
source: "/usr/share/lipstick-glacier-home-qt5/qml/images/wallpaper-portrait-bubbles.png"
source: wallpaperSource.value
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
z: -100
......
/*
* Copyright (C) 2018 Chupligin Sergey <neochapay@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
import QtQuick 2.6
import QtQuick.Controls 1.0
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
import org.nemomobile.configuration 1.0
import org.nemomobile.gallery 1.0
import "../../components"
Page {
id: wallpaperSelectPage
headerTools: HeaderToolsLayout { showBackButton: true; title: qsTr("Select wallpaper")}
property string valueKey: ""
ConfigurationValue {
id: wallpaper
key: wallpaperSelectPage.valueKey
}
GalleryView {
anchors{
fill: parent
topMargin: Theme.itemSpacingLarge
}
baseThumbnailSize: (parent.height>parent.width) ? parent.width/4 : parent.height/4
model: GalleryModel {
id: gallery
}
delegate: GalleryDelegate {
MouseArea {
anchors.fill: parent
onPressAndHold: {
wallpaper.value = url
pageStack.pop();
}
}
}
}
Component.onCompleted: {
gallery.createFilter(gallery, "imagesfilter", "GalleryStartsWithFilter", "mimeType", "image/")
}
}
{
"path": "wallpaper",
"category": "Personalization",
"title": "Wallpaper"
}
/*
* Copyright (C) 2018 Chupligin Sergey <neochapay@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
import QtQuick 2.6
import QtQuick.Controls 1.0
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
import org.nemomobile.configuration 1.0
import "../../components"
Page {
id: wallpaperSettingsPage
headerTools: HeaderToolsLayout { showBackButton: true; title: qsTr("Wallpapers")}
ConfigurationValue {
id: differentWallpaper
key: "/home/glacier/differentWallpaper"
defaultValue: true
}
ConfigurationValue {
id: homeWallpaperImage
key: "/home/glacier/homeScreen/wallpaperImage"
defaultValue: "/usr/share/lipstick-glacier-home-qt5/qml/images/wallpaper-portrait-bubbles.png"
}
ConfigurationValue{
id: lockScreenWallpaperImage
key: "/home/glacier/lockScreen/wallpaperImage"
defaultValue: "/usr/share/lipstick-glacier-home-qt5/qml/images/graphics-wallpaper-home.jpg"
}
SettingsColumn{
id: differentImagesSettings
Rectangle{
id: differentImages
width: parent.width
height: childrenRect.height
color: "transparent"
Label{
id: differentImagesLabel
text: qsTr("Use different images for lockscreen and home screen");
anchors{
left: parent.left
top: parent.top
}
width: parent.width-differentImagesCheck.width
wrapMode: Text.WordWrap
}
CheckBox{
id: differentImagesCheck
checked: differentWallpaper.value
anchors{
right: parent.right
verticalCenter: differentImagesLabel.verticalCenter
}
onClicked: differentWallpaper.value = checked
}
}
Rectangle{
id: homeWallpaper
width: parent.width
height: width/4
color: "transparent"
Image{
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
source: homeWallpaperImage.value
Text{
text: (differentWallpaper.value == true) ? qsTr("Homescreen wallpaper") : qsTr("Wallpaper")
color: Theme.textColor
styleColor: Theme.backgroundColor
style: Text.Outline;
anchors.centerIn: parent
font.pixelSize: Theme.fontSizeLarge
}
MouseArea{
anchors.fill: parent
onClicked: pageStack.push("/usr/share/glacier-settings/qml/plugins/wallpaper/selectImage.qml",{valueKey: "/home/glacier/homeScreen/wallpaperImage"})
}
}
}
Rectangle{
id: lockScreenWallpaper
width: parent.width
height: width/4
color: "transparent"
visible: differentWallpaper.value == true
Image{
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
source: lockScreenWallpaperImage.value
Text{
text: qsTr("Lockscreen wallpaper")
color: Theme.textColor
styleColor: Theme.backgroundColor
style: Text.Outline;
anchors.centerIn: parent
font.pixelSize: Theme.fontSizeLarge
}
}
MouseArea{
anchors.fill: parent
onClicked: pageStack.push("/usr/share/glacier-settings/qml/plugins/wallpaper/selectImage.qml",{valueKey: "/home/glacier/lockScreen/wallpaperImage"})
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<svg width="2048" height="1792" viewBox="0 0 2048 1792" xmlns="http://www.w3.org/2000/svg"><path d="M704 576q0 80-56 136t-136 56-136-56-56-136 56-136 136-56 136 56 56 136zm1024 384v448h-1408v-192l320-320 160 160 512-512zm96-704h-1600q-13 0-22.5 9.5t-9.5 22.5v1216q0 13 9.5 22.5t22.5 9.5h1600q13 0 22.5-9.5t9.5-22.5v-1216q0-13-9.5-22.5t-22.5-9.5zm160 32v1216q0 66-47 113t-113 47h-1600q-66 0-113-47t-47-113v-1216q0-66 47-113t113-47h1600q66 0 113 47t47 113z" fill="#fff"/></svg>
\ No newline at end of file
......@@ -83,6 +83,15 @@ statusbar.files = qml/statusbar/BatteryPanel.qml\
qml/statusbar/NumButton.qml \
qml/statusbar/MediaController.qml
settingsplugin.files = settings-plugins/wallpaper/wallpaper.qml \
settings-plugins/wallpaper/selectImage.qml \
settings-plugins/wallpaper/wallpaper.svg
settingsplugin.path = /usr/share/glacier-settings/qml/plugins/wallpaper
settingspluginconfig.files = settings-plugins/wallpaper/wallpaper.json
settingspluginconfig.path = /usr/share/glacier-settings/plugins
INSTALLS += styles \
images \
theme \
......@@ -93,7 +102,9 @@ INSTALLS += styles \
volumecontrol\
connectivity\
notifications\
statusbar
statusbar\
settingsplugin\
settingspluginconfig
CONFIG += qt link_pkgconfig
QT += quick compositor
......@@ -146,4 +157,5 @@ TRANSLATIONS += i18n/glacer-home.ts
DISTFILES += \
i18n/glacer-home.ts \
qml/connectivity/ConnectionSelector.qml \
qml/statusbar/BatteryIndicator.qml
qml/statusbar/BatteryIndicator.qml \
settings-plugins/wallpaper/selectImage.qml
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment