digiKam
|
Classes | |
class | Private |
Public Types | |
enum | MessageType { Positive , Information , Warning , Error } |
Public Slots | |
void | animatedHide () |
void | animatedShow () |
void | setCloseButtonVisible (bool visible) |
void | setIcon (const QIcon &icon) |
void | setMessageType (DNotificationWidget::MessageType type) |
void | setText (const QString &text) |
void | setWordWrap (bool wordWrap) |
Signals | |
void | hideAnimationFinished () |
void | linkActivated (const QString &contents) |
void | linkHovered (const QString &contents) |
void | showAnimationFinished () |
Public Member Functions | |
void | addAction (QAction *action) |
void | animatedShowTemporized (int delay) |
void | clearAllActions () |
DNotificationWidget (const QString &text, QWidget *const parent=nullptr) | |
DNotificationWidget (QWidget *const parent=nullptr) | |
int | heightForWidth (int width) const override |
QIcon | icon () const |
bool | isCloseButtonVisible () const |
bool | isHideAnimationRunning () const |
bool | isShowAnimationRunning () const |
MessageType | messageType () const |
QSize | minimumSizeHint () const override |
void | removeAction (QAction *action) |
QSize | sizeHint () const override |
QString | text () const |
bool | wordWrap () const |
~DNotificationWidget () override | |
Protected Member Functions | |
bool | event (QEvent *event) override |
void | paintEvent (QPaintEvent *event) override |
void | resizeEvent (QResizeEvent *event) override |
Properties | |
bool | closeButtonVisible |
QIcon | icon |
MessageType | messageType |
QString | text |
bool | wordWrap |
Friends | |
class | Private |
This widget can be used to provide inline positive or negative feedback, or to implement opportunistic interactions.
|
explicit |
Constructs a DNotificationWidget with the specified parent
.
References Digikam::DNotificationWidget::Private::init(), and Digikam::DNotificationWidget::Private::timer.
|
explicit |
Constructs a DNotificationWidget with the specified parent
and contents text
.
References Digikam::DNotificationWidget::Private::init(), setText(), text, Digikam::DNotificationWidget::Private::text, and Digikam::DNotificationWidget::Private::timer.
|
override |
Destructor.
void Digikam::DNotificationWidget::addAction | ( | QAction * | action | ) |
Add action
to the message widget. For each action a button is added to the message widget in the order the actions were added.
action | the action to add |
References Digikam::DNotificationWidget::Private::updateLayout().
|
slot |
Hide the widget using an animation.
References Digikam::DNotificationWidget::Private::content, hideAnimationFinished(), Digikam::DNotificationWidget::Private::timeLine, and Digikam::DNotificationWidget::Private::updateSnapShot().
Referenced by Digikam::DNotificationWidget::Private::init().
|
slot |
Show the widget using an animation.
References Digikam::DNotificationWidget::Private::bestContentHeight(), Digikam::DNotificationWidget::Private::content, showAnimationFinished(), Digikam::DNotificationWidget::Private::timeLine, and Digikam::DNotificationWidget::Private::updateSnapShot().
Referenced by animatedShowTemporized().
void Digikam::DNotificationWidget::animatedShowTemporized | ( | int | delay | ) |
Show the widget using an animation. The widget is automatically hidden after the delay (in ms).
References animatedShow(), Digikam::DNotificationWidget::Private::delay, setText(), Digikam::DNotificationWidget::Private::text, and Digikam::DNotificationWidget::Private::timer.
Referenced by Digikam::ItemIconView::slotNotificationError().
void Digikam::DNotificationWidget::clearAllActions | ( | ) |
clear all actions from the message widget.
|
overrideprotected |
References Digikam::DNotificationWidget::Private::content, and Digikam::DNotificationWidget::Private::createLayout().
Referenced by paintEvent(), and resizeEvent().
|
override |
Returns the required height for width
.
width | the width in pixels |
References Digikam::DNotificationWidget::Private::content.
|
signal |
This signal is emitted when the hide animation is finished, started by calling animatedHide(). If animations are disabled, this signal is emitted immediately after the message widget got hidden.
Referenced by animatedHide().
QIcon Digikam::DNotificationWidget::icon | ( | ) | const |
The icon shown on the left of the text. By default, no icon is shown.
References Digikam::DNotificationWidget::Private::icon.
bool Digikam::DNotificationWidget::isCloseButtonVisible | ( | ) | const |
Check whether the close button is visible.
References Digikam::DNotificationWidget::Private::closeButton.
bool Digikam::DNotificationWidget::isHideAnimationRunning | ( | ) | const |
Check whether the hide animation started by calling animatedHide() is still running. If animations are disabled, this function always returns false.
References Digikam::DNotificationWidget::Private::timeLine.
bool Digikam::DNotificationWidget::isShowAnimationRunning | ( | ) | const |
Check whether the show animation started by calling animatedShow() is still running. If animations are disabled, this function always returns false.
References Digikam::DNotificationWidget::Private::timeLine.
|
signal |
This signal is emitted when the user clicks a link in the text label. The URL referred to by the href anchor is passed in contents.
contents | text of the href anchor |
Referenced by Digikam::DNotificationWidget::Private::init().
|
signal |
This signal is emitted when the user hovers over a link in the text label. The URL referred to by the href anchor is passed in contents.
contents | text of the href anchor |
Referenced by Digikam::DNotificationWidget::Private::init().
DNotificationWidget::MessageType Digikam::DNotificationWidget::messageType | ( | ) | const |
Get the type of this message. By default, the type is set to DNotificationWidget::Information.
References Digikam::DNotificationWidget::Private::messageType.
|
override |
Returns the minimum size of the message widget.
References Digikam::DNotificationWidget::Private::content.
|
overrideprotected |
void Digikam::DNotificationWidget::removeAction | ( | QAction * | action | ) |
Remove action
from the message widget.
action | the action to remove |
References Digikam::DNotificationWidget::Private::updateLayout().
|
overrideprotected |
|
slot |
Set the visibility of the close button. If visible
is true, a close button is shown that calls animatedHide() if clicked.
References Digikam::DNotificationWidget::Private::closeButton.
Referenced by Digikam::ItemIconView::ItemIconView().
|
slot |
Define an icon to be shown on the left of the text
References icon, Digikam::DNotificationWidget::Private::icon, and Digikam::DNotificationWidget::Private::iconLabel.
|
slot |
Set the message type to type
. By default, the message type is set to DNotificationWidget::Information.
References Digikam::DNotificationWidget::Private::content, Error, Information, Digikam::DNotificationWidget::Private::messageType, Positive, and Warning.
Referenced by Digikam::ItemIconView::slotNotificationError().
|
slot |
Set the text of the message widget to text
. If the message widget is already visible, the text changes on the fly.
text | the text to display, rich text is allowed |
References Digikam::DNotificationWidget::Private::delay, text, Digikam::DNotificationWidget::Private::text, and Digikam::DNotificationWidget::Private::textLabel.
Referenced by animatedShowTemporized(), DNotificationWidget(), and Digikam::ItemIconView::slotNotificationError().
|
slot |
Set word wrap to wordWrap
. If word wrap is enabled, the text() of the message widget is wrapped to fit the available width. If word wrap is disabled, the message widget's minimum size is such that the entire text fits.
wordWrap | disable/enable word wrap |
References Digikam::DNotificationWidget::Private::textLabel, Digikam::DNotificationWidget::Private::updateLayout(), wordWrap, and Digikam::DNotificationWidget::Private::wordWrap.
Referenced by Digikam::ItemIconView::ItemIconView().
|
signal |
This signal is emitted when the show animation is finished, started by calling animatedShow(). If animations are disabled, this signal is emitted immediately after the message widget got shown.
Referenced by animatedShow().
|
override |
Returns the preferred size of the message widget.
References Digikam::DNotificationWidget::Private::content.
QString Digikam::DNotificationWidget::text | ( | ) | const |
Get the text of this message widget.
References Digikam::DNotificationWidget::Private::textLabel.
bool Digikam::DNotificationWidget::wordWrap | ( | ) | const |
Check whether word wrap is enabled.
If word wrap is enabled, the message widget wraps the displayed text as required to the available width of the widget. This is useful to avoid breaking widget layouts.
References Digikam::DNotificationWidget::Private::wordWrap.
|
friend |
|
readwrite |
|
readwrite |
Referenced by setIcon().
|
readwrite |
|
readwrite |
Referenced by DNotificationWidget(), and setText().
|
readwrite |