Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New design and logic of notifications #2863

Merged
merged 7 commits into from
Nov 14, 2023
Merged

Conversation

iiLubos
Copy link
Contributor

@iiLubos iiLubos commented Oct 18, 2023

Notification

NotificationModel - class for the logic of showing notification
MMNotificationView - view for a list of notification
MMNotification - notification

Create a notification (showing 10s) - Notification{ nextId(), "Message", 10, NotificationType::Information, NotificationType::Waiting }
Add new notification - add(const QString &message, uint interval, NotificationType::MessageType type, NotificationType::IconType icon)
Remove specific notification - remove(uint id)

Removing notifications is possible with a close button or will disappear automatically

In this PR, also refactored Input fields
Inputs
Samples:

MMInput {
    placeholderText: "Search"
    iconSource: Style.searchIcon
}
MMInput {
    text: "Calendar"
    iconSource: Style.calendarIcon
    warningMsg: "Would you like to be so kind and select a date please?"
}
MMPasswordInput {
    text: "Password"
    regexp: '(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9])(?=.{6,})'
    errorMsg: "Password must contain at least 6 characters\nMinimum 1 number, uppercase and lowercase letter and special character"
}
MMButtonInput {
    buttonText: "Send"
    placeholderText: "Write an informative message"
    onClicked: notificationModel.add(text, 60, NotificationType.Information, NotificationType.None)
}

@iiLubos iiLubos marked this pull request as draft October 18, 2023 09:21
@iiLubos iiLubos self-assigned this Oct 18, 2023
@PeterPetrik
Copy link
Contributor

nice!

Q: How it behaves when notification is spanning on multiple lines? Or is it forbidden?

@iiLubos
Copy link
Contributor Author

iiLubos commented Oct 18, 2023

nice!

Q: How it behaves when notification is spanning on multiple lines? Or is it forbidden?

For now, only one line is supported.
The notification can be responsive, if it makes sense

@PeterPetrik PeterPetrik added the FROZEN 🥶 do not merge before upcoming release label Oct 18, 2023
@PeterPetrik
Copy link
Contributor

If it is longer it could possibly do animation ? (like moving/scrolling text banners in TV ?)

@tomasMizera
Copy link
Collaborator

If it is longer it could possibly do animation ? (like moving/scrolling text banners in TV ?)

I would leave this decision with Andrej :)

@PeterPetrik
Copy link
Contributor

PeterPetrik commented Oct 19, 2023

Definitely, my worry is that on small screen devices (e.g. mine iPhone 2020 SE) usually even small sentences are too long. I am easy

@PeterPetrik PeterPetrik removed the FROZEN 🥶 do not merge before upcoming release label Oct 24, 2023
@iiLubos iiLubos marked this pull request as ready for review October 24, 2023 16:12
@iiLubos
Copy link
Contributor Author

iiLubos commented Oct 24, 2023

Notification is now responsible, max. 3 rows.

app/qmlV2/component/MMInput.qml Outdated Show resolved Hide resolved
@MerginMaps MerginMaps deleted a comment from jozefbudac Oct 27, 2023
gallery/notificationmodel.h Outdated Show resolved Hide resolved
@tomasMizera tomasMizera merged commit efa25fe into master Nov 14, 2023
6 checks passed
@tomasMizera tomasMizera deleted the master_redesign-notification branch November 14, 2023 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants