diff --git a/src/contactview/qml/commonactions.qml b/src/contactview/qml/commonactions.qml index cea7db55..1c3e0b07 100644 --- a/src/contactview/qml/commonactions.qml +++ b/src/contactview/qml/commonactions.qml @@ -1,60 +1,59 @@ /*************************************************************************** * Copyright (C) 2019 by Bluesystems * * Author : Emmanuel Lepage Vallee * * * * This program 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. * * * * This program 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 this program. If not, see . * **************************************************************************/ import QtQuick 2.9 import org.kde.ringkde.genericutils 1.0 as GenericUtils import QtQuick.Layouts 1.2 as Layouts Layouts.ColumnLayout { property QtObject individual: null Layouts.Layout.topMargin: 0 - Layouts.Layout.bottomMargin: 0 Layouts.Layout.leftMargin: 0 Layouts.Layout.rightMargin: 0 GenericUtils.ActionSwitch { icon: "mail-message" text: "Write email" checkable: false } GenericUtils.ActionSwitch { icon: "delete" text: "Delete contact" checkable: false } GenericUtils.ActionSwitch { icon: "edit-clear-history" text: "Clear history" checkable: false } GenericUtils.ActionSwitch { icon: "favorite" text: "Bookmark" checkable: true } GenericUtils.ActionSwitch { icon: "im-kick-user" text: "Block" checkable: true } } diff --git a/src/jamiaudioplayer/qml/audioplayer.qml b/src/jamiaudioplayer/qml/audioplayer.qml index 16f3c9c8..faa584e4 100644 --- a/src/jamiaudioplayer/qml/audioplayer.qml +++ b/src/jamiaudioplayer/qml/audioplayer.qml @@ -1,145 +1,145 @@ /*************************************************************************** * Copyright (C) 2017 by Bluesystems * * Author : Emmanuel Lepage Vallee * * * * This program 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. * * * * This program 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 this program. If not, see . * **************************************************************************/ import QtQuick 2.7 import QtQuick.Controls 2.0 as Controls2 import QtQuick.Layouts 1.0 import org.kde.kirigami 2.2 as Kirigami import net.lvindustries.ringqtquick 1.0 as RingQtQuick Item { property QtObject recording: audioRecording id: audioPlayer height: content.implicitHeight RowLayout { id: content width: parent.width state: "disabled" Controls2.Button { id: reset text: "⏮" // "⏸" ⏹ ⏮ ⏭ Layout.fillHeight: true Layout.preferredWidth: 30 Layout.maximumWidth: 30 enabled: false } Controls2.Button { id: playPause text: "▶" Layout.fillHeight: true Layout.preferredWidth: 30 Layout.maximumWidth: 30 enabled: false onClicked: { if (!audioRecording.isCurrent) return if (stateGroup.state == "enabled") audioRecording.play() else if(stateGroup.state == "playing") audioRecording.pause() } } Controls2.Slider { id: progress from: 0 value: audioRecording.position to: audioRecording.duration Layout.fillWidth: true Layout.fillHeight: true enabled: false } Controls2.Button { id: end text: "⏭" Layout.preferredWidth: 30 Layout.maximumWidth: 30 Layout.fillHeight: true enabled: false } } Rectangle { id: selectOverlay - color: inactivePalette.base + color: Kirigami.Theme.disabledTextColor opacity: 0.5 anchors.fill: parent Text { anchors.centerIn: parent text: i18n("Click to play") color: Kirigami.Theme.textColor } MouseArea { anchors.fill: parent onClicked: { RingSession.recordingModel.currentRecording = recording } } } StateGroup { id: stateGroup states: [ // Hide all buttons State { name: "disabled" when: !recording == RingSession.recordingModel.currentRecording }, State { name: "enabled" when: recording == RingSession.recordingModel.currentRecording PropertyChanges { target: reset enabled: true } PropertyChanges { target: selectOverlay visible: false } PropertyChanges { target: playPause enabled: true } PropertyChanges { target: progress enabled: true value: RingSession.recordingModel.currentRecording.position } PropertyChanges { target: end enabled: true } }, State { name: "playing" extend: "enabled" when: recording.isPlaying PropertyChanges { target: playPause text: "⏸" } } ] } } diff --git a/src/jaminotification/qml/individualsettings.qml b/src/jaminotification/qml/individualsettings.qml index 13e4829a..6f242a32 100644 --- a/src/jaminotification/qml/individualsettings.qml +++ b/src/jaminotification/qml/individualsettings.qml @@ -1,48 +1,47 @@ /*************************************************************************** * Copyright (C) 2019 by Bluesystems * * Author : Emmanuel Lepage Vallee * * * * This program 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. * * * * This program 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 this program. If not, see . * **************************************************************************/ import QtQuick 2.9 import org.kde.ringkde.genericutils 1.0 as GenericUtils import QtQuick.Layouts 1.2 as Layouts Layouts.ColumnLayout { property QtObject individual: null Layouts.Layout.topMargin: 0 - Layouts.Layout.bottomMargin: 0 Layouts.Layout.leftMargin: 0 Layouts.Layout.rightMargin: 0 GenericUtils.ActionSwitch { Layouts.Layout.fillWidth: true icon: "preferences-desktop-notification" text: "On new messages" } GenericUtils.ActionSwitch { Layouts.Layout.fillWidth: true icon: "preferences-desktop-notification" text: "On presence changes" } GenericUtils.ActionSwitch { Layouts.Layout.fillWidth: true icon: "preferences-desktop-notification" text: "Ignore incoming calls" } } diff --git a/views/basic/qml/sidebar.qml b/views/basic/qml/sidebar.qml index 4c08cb77..98685b6e 100644 --- a/views/basic/qml/sidebar.qml +++ b/views/basic/qml/sidebar.qml @@ -1,126 +1,188 @@ /*************************************************************************** * Copyright (C) 2019 by Bluesystems * * Author : Emmanuel Lepage Vallee * * * * This program 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. * * * * This program 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 this program. If not, see . * **************************************************************************/ import QtQuick 2.9 import QtQuick.Controls 2.2 as Controls import org.kde.kirigami 2.4 as Kirigami -import QtQuick.Layouts 1.2 as Layouts +import QtQuick.Layouts 1.9 as Layouts import org.kde.ringkde.basicview 1.0 as BasicView import org.kde.ringkde.jamicontactview 1.0 as JamiContactView import org.kde.ringkde.jaminotification 1.0 as JamiNotification +import org.kde.ringkde.jamihistoryview 1.0 as JamiHistoryView import org.kde.ringkde.genericutils 1.0 as GenericUtils Controls.ToolBar { id: sideBar property QtObject individual: mainPage.currentIndividual Layouts.ColumnLayout { anchors.fill: parent spacing: Kirigami.Units.largeSpacing*2 BasicView.DesktopHeader { Layouts.Layout.preferredWidth: parent.width Layouts.Layout.preferredHeight: Kirigami.Units.iconSizes.large*1.5 textColor: "white" photoSize: Kirigami.Units.iconSizes.large*1.5 } Kirigami.Separator { Layouts.Layout.fillWidth: true color: "white" } Controls.TabBar { + id: tabs + property real underlineHeight: 4 Layouts.Layout.fillWidth: true + Layouts.Layout.preferredHeight: implicitHeight + underlineHeight*1.5 + currentIndex: swipeView.currentIndex + + background: Item { + // Force the Material underline style in all theme + Rectangle { + height: tabs.underlineHeight + anchors.bottom: parent.bottom + width: sideBar.width/3 + color: Kirigami.Theme.highlightedTextColor + x: tabs.currentIndex*(sideBar.width/3) + Behavior on x { + NumberAnimation {duration: 200} + } + } + + } Controls.TabButton { - text: "Foo" + width: sideBar.width/3 + background: Kirigami.Icon { + source: "help-about" + height: parent.height - tabs.underlineHeight*1.5 + } } + Controls.TabButton { - text: "Bar" + width: sideBar.width/3 + background: Kirigami.Icon { + source: "shallow-history" + height: parent.height - tabs.underlineHeight*1.5 + } } + Controls.TabButton { - text: "Baz" + width: sideBar.width/3 + background: Kirigami.Icon { + source: "favorite" + height: parent.height - tabs.underlineHeight*1.5 + } } } - Kirigami.Heading { - level: 1 - text: "Actions" - color: "white" - + Controls.SwipeView { + id: swipeView + clip: true + currentIndex: tabs.currentIndex Layouts.Layout.fillWidth: true + Layouts.Layout.fillHeight: true - elide: Text.ElideRight + Item { +// background: Item{} - //show only when at least half of the string has been painted: use - //opacity as using visible it won't correctly recalculate the width - opacity: width > implicitWidth/2 + Layouts.ColumnLayout { + spacing: Kirigami.Units.largeSpacing*2 - } + Kirigami.Heading { + level: 1 + text: "Actions" + color: "white" - JamiContactView.CommonActions { - individual: mainPage.individual - Layouts.Layout.fillWidth: true - } + Layouts.Layout.fillWidth: true - Kirigami.Heading { - level: 1 - text: "Notifications" - color: "white" + elide: Text.ElideRight - Layouts.Layout.fillWidth: true + //show only when at least half of the string has been painted: use + //opacity as using visible it won't correctly recalculate the width + opacity: width > implicitWidth/2 - elide: Text.ElideRight + } - //show only when at least half of the string has been painted: use - //opacity as using visible it won't correctly recalculate the width - opacity: width > implicitWidth/2 + JamiContactView.CommonActions { + individual: mainPage.individual + Layouts.Layout.fillWidth: true + } - } + Kirigami.Heading { + level: 1 + text: "Notifications" + color: "white" - JamiNotification.IndividualSettings { - individual: mainPage.individual - Layouts.Layout.fillWidth: true - } + Layouts.Layout.fillWidth: true - Kirigami.Heading { - level: 1 - text: "Statistics" - color: "white" + elide: Text.ElideRight - Layouts.Layout.fillWidth: true + //show only when at least half of the string has been painted: use + //opacity as using visible it won't correctly recalculate the width + opacity: width > implicitWidth/2 - elide: Text.ElideRight + } - //show only when at least half of the string has been painted: use - //opacity as using visible it won't correctly recalculate the width - opacity: width > implicitWidth/2 + JamiNotification.IndividualSettings { + individual: mainPage.individual + Layouts.Layout.fillWidth: true + } - } + Kirigami.Heading { + level: 1 + text: "Statistics" + color: "white" - JamiContactView.Statistics { - individual: mainPage.individual - Layouts.Layout.fillWidth: true - labelColor: Kirigami.Theme.textColor - } + Layouts.Layout.fillWidth: true - Item { - Layouts.Layout.fillHeight: true + elide: Text.ElideRight + + //show only when at least half of the string has been painted: use + //opacity as using visible it won't correctly recalculate the width + opacity: width > implicitWidth/2 + + } + + JamiContactView.Statistics { + individual: mainPage.individual + Layouts.Layout.fillWidth: true + labelColor: Kirigami.Theme.textColor + } + + Item { + Layouts.Layout.fillHeight: true + } + } + } + + Loader { + width: swipeView.width + height: swipeView.height + active: currentIndex == Controls.SwipeView.index + sourceComponent: JamiHistoryView.RecordingHistory { + anchors.fill: parent + individual: mainPage.currentIndividual + } + } + + Item {} } } }