Add InlineMessage type and Gallery app example page

Authored by hein on Mar 24 2018, 9:30 PM.

Description

Add InlineMessage type and Gallery app example page

Summary:
InlineMessage can be used to show various messages to the user,
without requiring the use of a dialog.

InlineMessage is analogous to KWidgetAddons' KMessageWidget and
provides nearly the same API:

  • Message type: Information (default), Positive, Warning or Error
  • Message text
  • Icon (optional)
  • Close button (optional)
  • Actions list (shown as buttons)
  • Signals for link hover and link activation
  • Animation state

It does not implement the 'wordWrap' property of KMessageWidget.
Instead, wrapping the message text is always wrapped.

Further, unlike in KMessageWidget, actions buttons are added from
left to right, not from right to left.

Additionally, it improves over KMessageWidget in several ways:

  • If no icon is manually set, it shows an appropriate icon for the message type by default.
  • Overflow handling for many messages (à la the Card component).
  • More compact layouting: Message and action buttons are shown on the same line if they can fit.

All properties are declared abstractly in the template and all
visuals are implemented in the control, so that the style can
optionally override the appearance fully.

This patch also adds an example page to the Gallery app which
illustrates the various message types and features in an
interactive manner.

Random notes:

  • I would have preferred to make the template API completely abstract and had 'showCloseButton' as 'closable' originally but then changed it for consistency with the property in OverlaySheet.

Reviewers: Kirigami, mart

Subscribers: plasma-devel

Tags: Kirigami

Differential Revision: https://phabricator.kde.org/D11663

Details

Committed
heinMar 29 2018, 9:51 AM
Differential Revision
D11663: Add InlineMessage type and Gallery app example page
Parents
R169:2c9cb3b2b961: Minor cleanup.
Branches
Unknown
Tags
Unknown