Remove obsolete QML components

This commit is contained in:
Carl Schwan
2020-11-27 14:34:49 +01:00
parent 244adf3467
commit da9f08eae4
6 changed files with 0 additions and 341 deletions

View File

@@ -1,16 +0,0 @@
/**
* SPDX-FileCopyrightText: 2018-2019 Black Hat <bhat@encom.eu.org>
*
* SPDX-License-Identifier: GPL-3.0-only
*/
import QtQuick 2.12
ListView {
pixelAligned: true
ScrollHelper {
anchors.fill: parent
flickable: parent
}
}

View File

@@ -1,156 +0,0 @@
/**
* SPDX-FileCopyrightText: 2019 Black Hat <bhat@encom.eu.org>
*
* SPDX-License-Identifier: GPL-3.0-only
*/
import QtQuick 2.12
Rectangle {
property alias topLeftRadius: topLeftRect.radius
property alias topRightRadius: topRightRect.radius
property alias bottomLeftRadius: bottomLeftRect.radius
property alias bottomRightRadius: bottomRightRect.radius
property alias topLeftVisible: topLeftRect.visible
property alias topRightVisible: topRightRect.visible
property alias bottomLeftVisible: bottomLeftRect.visible
property alias bottomRightVisible: bottomRightRect.visible
antialiasing: true
Rectangle {
anchors.top: parent.top
anchors.left: parent.left
width: parent.width / 2
height: parent.height / 2
id: topLeftRect
antialiasing: true
color: parent.color
Rectangle {
anchors.bottom: parent.bottom
anchors.left: parent.left
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
Rectangle {
anchors.top: parent.top
anchors.right: parent.right
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
}
Rectangle {
anchors.top: parent.top
anchors.right: parent.right
width: parent.width / 2
height: parent.height / 2
id: topRightRect
antialiasing: true
color: parent.color
Rectangle {
anchors.bottom: parent.bottom
anchors.right: parent.right
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
Rectangle {
anchors.top: parent.top
anchors.left: parent.left
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
}
Rectangle {
anchors.bottom: parent.bottom
anchors.left: parent.left
width: parent.width / 2
height: parent.height / 2
id: bottomLeftRect
antialiasing: true
color: parent.color
Rectangle {
anchors.bottom: parent.bottom
anchors.right: parent.right
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
Rectangle {
anchors.top: parent.top
anchors.left: parent.left
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
}
Rectangle {
anchors.bottom: parent.bottom
anchors.right: parent.right
width: parent.width / 2
height: parent.height / 2
id: bottomRightRect
antialiasing: true
color: parent.color
Rectangle {
anchors.bottom: parent.bottom
anchors.left: parent.left
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
Rectangle {
anchors.top: parent.top
anchors.right: parent.right
width: parent.width / 2
height: parent.height / 2
color: parent.color
}
}
}

View File

@@ -1,67 +0,0 @@
/**
* SPDX-FileCopyrightText: 2018-2020 Black Hat <bhat@encom.eu.org>
*
* SPDX-License-Identifier: GPL-3.0-only
*/
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.3
TextField {
id: textField
selectByMouse: true
topPadding: 8
bottomPadding: 8
background: Item {
Label {
id: floatingPlaceholder
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: textField.topPadding
anchors.leftMargin: textField.leftPadding
transformOrigin: Item.TopLeft
visible: false
color: Material.accent
states: [
State {
name: "shown"
when: textField.text.length != 0 || textField.activeFocus
PropertyChanges { target: floatingPlaceholder; scale: 0.8 }
PropertyChanges { target: floatingPlaceholder; anchors.topMargin: -floatingPlaceholder.height * 0.4 }
}
]
transitions: [
Transition {
to: "shown"
SequentialAnimation {
PropertyAction { target: floatingPlaceholder; property: "text"; value: textField.placeholderText }
PropertyAction { target: floatingPlaceholder; property: "visible"; value: true }
PropertyAction { target: textField; property: "placeholderTextColor"; value: "transparent" }
ParallelAnimation {
NumberAnimation { target: floatingPlaceholder; property: "scale"; duration: 250; easing.type: Easing.InOutQuad }
NumberAnimation { target: floatingPlaceholder; property: "anchors.topMargin"; duration: 250; easing.type: Easing.InOutQuad }
}
}
},
Transition {
from: "shown"
SequentialAnimation {
ParallelAnimation {
NumberAnimation { target: floatingPlaceholder; property: "scale"; duration: 250; easing.type: Easing.InOutQuad }
NumberAnimation { target: floatingPlaceholder; property: "anchors.topMargin"; duration: 250; easing.type: Easing.InOutQuad }
}
PropertyAction { target: textField; property: "placeholderTextColor"; value: "grey" }
PropertyAction { target: floatingPlaceholder; property: "visible"; value: false }
}
}
]
}
}
}

View File

@@ -1,93 +0,0 @@
/**
* SPDX-FileCopyrightText: 2016 Michael Bohlender <michael.bohlender@kdemail.net>
* SPDX-FileCopyrightText: 2017 Christian Mollekopf <mollekopf@kolabsystems.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick 2.12
import QtQuick.Controls 2.12
/*
* The MouseArea + interactive: false + maximumFlickVelocity are required
* to fix scrolling for desktop systems where we don't want flicking behaviour.
*
* See also:
* ScrollView.qml in qtquickcontrols
* qquickwheelarea.cpp in qtquickcontrols
*/
MouseArea {
id: root
propagateComposedEvents: true
property Flickable flickable
property alias enabled: root.enabled
//Place the mouse area under the flickable
z: -1
onFlickableChanged: {
if (enabled) {
flickable.interactive = false
flickable.maximumFlickVelocity = 100000
flickable.boundsBehavior = Flickable.StopAtBounds
root.parent = flickable
}
}
function calculateNewPosition(flickableItem, wheel) {
//Nothing to scroll
if (flickableItem.contentHeight < flickableItem.height) {
return flickableItem.contentY;
}
//Ignore 0 events (happens at least with Christians trackpad)
if (wheel.pixelDelta.y == 0 && wheel.angleDelta.y == 0) {
return flickableItem.contentY;
}
//pixelDelta seems to be the same as angleDelta/8
var pixelDelta = 0
//The pixelDelta is a smaller number if both are provided, so pixelDelta can be 0 while angleDelta is still something. So we check the angleDelta
if (wheel.angleDelta.y) {
var wheelScrollLines = 3 //Default value of QApplication wheelScrollLines property
var pixelPerLine = 20 //Default value in Qt, originally comes from QTextEdit
var ticks = (wheel.angleDelta.y / 8) / 15.0 //Divide by 8 gives us pixels typically come in 15pixel steps.
pixelDelta = ticks * pixelPerLine * wheelScrollLines
} else {
pixelDelta = wheel.pixelDelta.y
}
if (!pixelDelta) {
return flickableItem.contentY;
}
var minYExtent = flickableItem.originY + flickableItem.topMargin;
var maxYExtent = (flickableItem.contentHeight + flickableItem.bottomMargin + flickableItem.originY) - flickableItem.height;
if (typeof(flickableItem.headerItem) !== "undefined" && flickableItem.headerItem) {
minYExtent += flickableItem.headerItem.height
}
//Avoid overscrolling
return Math.max(minYExtent, Math.min(maxYExtent, flickableItem.contentY - pixelDelta));
}
onWheel: {
var newPos = calculateNewPosition(flickable, wheel);
// console.warn("Delta: ", wheel.pixelDelta.y);
// console.warn("Old position: ", flickable.contentY);
// console.warn("New position: ", newPos);
// Show the scrollbars
flickable.flick(0, 0);
flickable.contentY = newPos;
cancelFlickStateTimer.start()
}
Timer {
id: cancelFlickStateTimer
//How long the scrollbar will remain visible
interval: 500
// Hide the scrollbars
onTriggered: flickable.cancelFlick();
}
}

View File

@@ -1,10 +1,5 @@
module NeoChat.Component
AutoMouseArea 1.0 AutoMouseArea.qml
MaterialIcon 1.0 MaterialIcon.qml
SideNavButton 1.0 SideNavButton.qml
ScrollHelper 1.0 ScrollHelper.qml
AutoListView 1.0 AutoListView.qml
AutoTextField 1.0 AutoTextField.qml
FullScreenImage 1.0 FullScreenImage.qml
AutoRectangle 1.0 AutoRectangle.qml
ChatTextInput 1.0 ChatTextInput.qml

View File

@@ -16,10 +16,6 @@
<file>imports/NeoChat/Component/qmldir</file>
<file>imports/NeoChat/Component/ChatTextInput.qml</file>
<file>imports/NeoChat/Component/AutoMouseArea.qml</file>
<file>imports/NeoChat/Component/ScrollHelper.qml</file>
<file>imports/NeoChat/Component/AutoListView.qml</file>
<file>imports/NeoChat/Component/AutoTextField.qml</file>
<file>imports/NeoChat/Component/AutoRectangle.qml</file>
<file>imports/NeoChat/Component/FullScreenImage.qml</file>
<file>imports/NeoChat/Component/Emoji/EmojiPicker.qml</file>
<file>imports/NeoChat/Component/Emoji/qmldir</file>