Commit 1774beff authored by Robert Maerkisch's avatar Robert Maerkisch

WIP: Change background (ui only)

parent a56ffc3a
kaidan-im @ 7db1e670
Subproject commit 7db1e67031310396c20220830b0545e1032b2570
<RCC>
<<<<<<< Updated upstream
<qresource prefix="/">
<file alias="qml/main.qml">src/qml/main.qml</file>
<file alias="qml/RosterPage.qml">src/qml/RosterPage.qml</file>
......@@ -28,6 +29,7 @@
<file alias="qml/settings/SettingsItem.qml">src/qml/settings/SettingsItem.qml</file>
<file alias="qml/settings/SettingsPage.qml">src/qml/settings/SettingsPage.qml</file>
<file alias="qml/settings/SettingsSheet.qml">src/qml/settings/SettingsSheet.qml</file>
<file alias="qml/settings/ChangeBackground.qml">src/qml/settings/ChangeBackground.qml</file>
<file alias="qml/settings/ChangePassword.qml">src/qml/settings/ChangePassword.qml</file>
<file alias="qtquickcontrols2.conf">misc/qtquickcontrols2.conf</file>
</qresource>
......
/*
* Kaidan - A user-friendly XMPP client for every device!
*
* Copyright (C) 2016-2019 Kaidan developers and contributors
* (see the LICENSE file for a full list of copyright authors)
*
* Kaidan is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition, as a special exception, the author of Kaidan gives
* permission to link the code of its release with the OpenSSL
* project's "OpenSSL" library (or with modified versions of it that
* use the same license as the "OpenSSL" library), and distribute the
* linked executables. You must obey the GNU General Public License in
* all respects for all of the code used other than "OpenSSL". If you
* modify this file, you may extend this exception to your version of
* the file, but you are not obligated to do so. If you do not wish to
* do so, delete this exception statement from your version.
*
* Kaidan 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Kaidan. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
import QtQuick.Controls 2.3 as Controls
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.4 as Kirigami
import im.kaidan.kaidan 1.0
Kirigami.Page {
title: qsTr("Change background")
property url imageUrl: kaidan.utils.getResourcePath("images/chat.png")
property url selectedBackground
ColumnLayout {
anchors.fill: parent
Kirigami.Heading {
Layout.alignment: Qt.AlignTop
level: 2
text: qsTr("Change background")
}
ListModel {
id: myModel
ListElement {
image: "file:///usr/local/share/kaidan/images/chat.png"
pattern: true
}
ListElement {
image: "file:///usr/local/share/kaidan/images/chat.png"
pattern: true
}
ListElement {
image: "file:///usr/local/share/kaidan/images/chat.png"
pattern: true
}
}
Image {
Layout.fillHeight: true
Layout.fillWidth: true
source: selectedBackground
}
ListView {
id: backgrounds
Layout.fillWidth: true
Layout.preferredHeight: 40
layoutDirection: Qt.LeftToRight
orientation: Qt.Horizontal
flickableDirection: Flickable.HorizontalFlick
Controls.ScrollBar.horizontal: Controls.ScrollBar {
active: true
}
contentWidth: 120
contentHeight: parent.height
spacing: 5
model: myModel
delegate: Image {
width: 40
height: 40
source: model.image
fillMode: model.pattern ? Image.Tile : Image.PreserveAspectCrop
MouseArea {
anchors.fill: parent
onClicked: {
selectedBackground = model.image
}
}
}
}
RowLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom
Controls.Button {
text: qsTr("Cancel")
onClicked: stack.pop()
Layout.fillWidth: true
}
Controls.Button {
text: qsTr("Apply")
Layout.fillWidth: true
}
}
}
}
......@@ -55,17 +55,25 @@ Kirigami.Page {
Component {
id: settingsContent
ColumnLayout {
spacing: 0
Column {
SettingsItem {
Layout.alignment: Qt.AlignTop
name: qsTr("Change password")
description: qsTr("Changes your account's password. You will need to re-enter it on your other devices.")
description: qsTr("Changes your account's password.\nYou will need to re-enter it on your other devices.")
onClicked: stack.push(changePassword)
icon: "lock"
reserveSpaceForIcon: true
}
SettingsItem {
Layout.alignment: Qt.AlignTop
name: qsTr("Change Background")
description: qsTr("Changes your background in all chats on this device.")
onClicked: stack.push(changeBackground)
icon: "games-config-background"
reserveSpaceForIcon: true
}
}
}
Component {id: changePassword; ChangePassword {}}
Component {id: changeBackground; ChangeBackground {}}
}
import QtQuick 2.0
Item {
}
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