NotificationBox: Convert options to enum class
This commit is contained in:
committed by
abdullahtahiriyo
parent
1e3b728f35
commit
6e3bdd8f2a
@@ -996,9 +996,9 @@ void NotificationArea::showInNotificationArea()
|
||||
getMainWindow(),
|
||||
pImp->notificationExpirationTime,
|
||||
pImp->minimumOnScreenTime,
|
||||
NotificationBox::OnlyIfReferenceActive |
|
||||
NotificationBox::RestrictAreaToReference |
|
||||
NotificationBox::HideIfReferenceWidgetDeactivated,
|
||||
NotificationBox::Options::OnlyIfReferenceActive |
|
||||
NotificationBox::Options::RestrictAreaToReference |
|
||||
NotificationBox::Options::HideIfReferenceWidgetDeactivated,
|
||||
pImp->notificationWidth);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ class NotificationBox
|
||||
NotificationBox() = delete;
|
||||
|
||||
public:
|
||||
enum Options {
|
||||
enum class Options {
|
||||
None = 0x0,
|
||||
RestrictAreaToReference = 0x1,
|
||||
OnlyIfReferenceActive = 0x2,
|
||||
@@ -100,6 +100,12 @@ inline NotificationBox::Options operator|(NotificationBox::Options lhs, Notifica
|
||||
static_cast<std::underlying_type<NotificationBox::Options>::type>(rhs));
|
||||
}
|
||||
|
||||
inline bool operator&(NotificationBox::Options lhs, NotificationBox::Options rhs) {
|
||||
return (
|
||||
static_cast<std::underlying_type<NotificationBox::Options>::type>(lhs) &
|
||||
static_cast<std::underlying_type<NotificationBox::Options>::type>(rhs));
|
||||
}
|
||||
|
||||
}// namespace Gui
|
||||
|
||||
#endif// GUI_NOTIFICATIONBOX_H
|
||||
|
||||
Reference in New Issue
Block a user