NotificationBox: Convert options to enum class

This commit is contained in:
Abdullah Tahiri
2023-03-21 08:52:37 +01:00
committed by abdullahtahiriyo
parent 1e3b728f35
commit 6e3bdd8f2a
2 changed files with 10 additions and 4 deletions

View File

@@ -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);
}
}

View File

@@ -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