Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions ViewSolutions/ViewSolutions/Extendable.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
//#
//# Copyright (C) 2025-2025 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Control {

id: root

property alias extendableWidget: extendetArea.contentItem
property alias mainWidget: mainButton.contentItem
// see GridLayout
property alias layoutDirection: columnLayout.layoutDirection
property alias flow: columnLayout.flow

property alias extended: extendetArea.visible
property int animationDuration: 600

contentItem: GridLayout {
id: columnLayout
columnSpacing: 0
rowSpacing: 0

Control {
Layout.alignment: Qt.AlignCenter
Layout.maximumWidth: root.implicitWidth - root.rightPadding - root.leftPadding
padding: 0
id: mainButton


Behavior on implicitHeight {
enabled: root.flow !== GridLayout.LeftToRight

NumberAnimation {
easing.type: Easing.OutExpo
duration: root.animationDuration
}
}

Behavior on implicitWidth {
enabled: root.flow === GridLayout.LeftToRight
NumberAnimation {
easing.type: Easing.OutExpo
duration: root.animationDuration
}
}
}


Control {
id: extendetArea
clip: true
visible: false
padding: 0
Layout.alignment: Qt.AlignCenter
Layout.maximumWidth: root.implicitWidth - root.rightPadding - root.leftPadding

Behavior on implicitHeight {
enabled: root.flow !== GridLayout.LeftToRight

NumberAnimation {
easing.type: Easing.OutExpo
duration: root.animationDuration
}
}

Behavior on implicitWidth {
enabled: root.flow === GridLayout.LeftToRight
NumberAnimation {
easing.type: Easing.OutExpo
duration: root.animationDuration
}
}

}
}
}
2 changes: 2 additions & 0 deletions ViewSolutions/ViewSolutions/ImageView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ AbstractButton {
id: root
property string source: ""
property alias imagesource: sourceImg
property alias imagEffect: imgEffect
property int radius: 16

property real power: 1.0
Expand Down Expand Up @@ -121,6 +122,7 @@ AbstractButton {
source: Image {
id: sourceImg
source: root.source
mipmap: true

clip: true
fillMode: Image.PreserveAspectCrop
Expand Down
32 changes: 0 additions & 32 deletions ViewSolutions/ViewSolutions/Metrix.qml

This file was deleted.

32 changes: 14 additions & 18 deletions ViewSolutions/ViewSolutions/NotificationServiceView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,41 @@ Item {

readonly property var history: model.history

Metrix {
id: metrix
}

NotificationForm {
id: notyfyView
titleText : msg.title();
text: (msg)? msg.text(): "";
img: (msg && msg.img().length)? msg.img(): getDefaultImage((msg)? msg.type(): 0);
type: (msg)? msg.type(): 0;
titleText : root.msg.title();
text: (root.msg)? root.msg.text(): "";
img: (root.msg && root.msg.img().length)? root.msg.img(): getDefaultImage((root.msg)? root.msg.type(): 0);
type: (root.msg)? root.msg.type(): 0;

x: parent.width - width - margin;
y: margin;

width: Math.min(6 * metrix.pt, root.width);
width: Math.min(440, root.width);

}

YesNoQuestion {
id: questionMsgBox
titleText : qst.title();
text: (qst)? qst.text(): "";
img: (qst && qst.img().length)? qst.img(): defImg;
titleText : root.qst.title();
text: (root.qst)? root.qst.text(): "";
img: (root.qst && root.qst.img().length)? root.qst.img(): defImg;
type: 0;

x: parent.width / 2 - width / 2;
y: parent.height / 2 - height / 2;

width: Math.min(6 * metrix.pt, root.width);
width: Math.min(440, root.width);

onAccepted: {
if (model) {
model.questionComplete(true, qst.type())
if (root.model) {
root.model.questionComplete(true, root.qst.type())
}
}

onRejected: {
if (model) {
model.questionComplete(false, qst.type())
if (root.model) {
root.model.questionComplete(false, root.qst.type())
}
}
}
Expand All @@ -83,7 +79,7 @@ Item {
}

Connections {
target: model
target: root.model
function onSigShowHistory() {
history.open()
}
Expand Down
88 changes: 88 additions & 0 deletions ViewSolutions/ViewSolutions/StackText.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
//#
//# Copyright (C) 2025-2025 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#

pragma ComponentBehavior: Bound

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import ViewSolutions
import QtQuick.Effects

Control {
id: root
padding: 24

required property var guiTokens
property alias text: model.fullText;
property alias delimiter: model.delimiter
property alias delegate: contentList.delegate
readonly property bool isFinished: contentList.currentIndex >= contentList.count - 1

function next() {
if (nextButton.visible) {
nextButton.click()
}
}

contentItem: ColumnLayout {
ListView {
id: contentList
currentIndex: 0
interactive: false
// snapMode: ListView.SnapOneItem
boundsBehavior:Flickable.StopAtBounds
Layout.fillWidth: true
Layout.fillHeight: true

model: StackTextModel {
id: model;

onFullTextChanged: {
contentList.currentIndex = 0;
}
}
}

ToolButton {
Layout.alignment: Qt.AlignHCenter


id: nextButton
text: qsTr("Next")
visible: contentList.count > 1 && contentList.currentIndex < contentList.count - 1
opacity: visible

Behavior on opacity {
NumberAnimation {
easing.type: Easing.InOutQuad
duration: 300
}
}

font: root.font

onClicked: {
if (contentList.currentIndex + 1 >= contentList.count) {
contentList.currentIndex = 0;
return;
}
contentList.currentIndex = contentList.currentIndex + 1;
}

layer.enabled: true
layer.effect: MultiEffect {
shadowBlur: 1.0
shadowEnabled: true
shadowColor: root.guiTokens.color_accent_primary
shadowScale: 1.0
}

}
}

}
7 changes: 6 additions & 1 deletion ViewSolutions/src/basehashmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ class BaseHashModel: public QAbstractListModel
{

public:

BaseHashModel(QObject* parent = nullptr): QAbstractListModel(parent) {

}

int rowCount(const QModelIndex &parent) const override {
int rowCount(const QModelIndex &) const override {
return m_data.size();
}

Expand Down Expand Up @@ -114,6 +115,10 @@ class BaseHashModel: public QAbstractListModel
return {};
}

DATA get(const KEY& key) {
return m_data.value(key);
}

const QHash<KEY, DATA>& dateList() const {
return m_data;
}
Expand Down
5 changes: 4 additions & 1 deletion ViewSolutions/src/notificationdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ class VIEWSOLUTION_EXPORT NotificationData
*/
enum Type {
/// This is message for general notification.
Normal,
Normal = 0,
/// This is warning notification.
Warning = 1,
/// This is critical error notifications.
Error = 2,

/// This is user defined type of message.
Custom = 3,
};

explicit NotificationData(const QString& title = "",
Expand Down
31 changes: 29 additions & 2 deletions ViewSolutions/src/notificationservice.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 QuasarApp.
* Copyright (C) 2018-2025 QuasarApp.
* Distributed under the GPLv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
Expand Down Expand Up @@ -117,14 +117,41 @@ void NotificationService::showHistory() {
emit sigShowHistory();
}

void NotificationService::notificationHiden() {
setUiIsDisplay(false);
}

int NotificationService::notificationsCount() const {
return _history->rowCount({});
}


QString ViewSolutions::NotificationService::modelId() const {
return "NotificationService";
}

bool NotificationService::uiIsDisplay() const {
return _uiIsDisplay && time(0) - _lastDisplayTime < _uiTimeOut;
}

void NotificationService::setUiIsDisplay(bool newUiIsDisplay) {
if (_uiIsDisplay == newUiIsDisplay)
return;

if (_uiIsDisplay) {
_lastDisplayTime = time(0);
}

_uiIsDisplay = newUiIsDisplay;
emit uiIsDisplayChanged();
}

int NotificationService::uiTimeOut() const {
return _uiTimeOut;
}

void NotificationService::setUiTimeOut(int newUiTimeOut) {
_uiTimeOut = newUiTimeOut;
}

}

Loading