71 MRVIEWER_API
void draw(
float scaling,
const Box2i& limitFramebuffer );
78 float defaultNotificationLifeTimeSeconds = 5.0f;
86 struct NotificationWithTimer
92 std::vector<NotificationWithTimer> notifications_;
93 std::vector<NotificationWithTimer> notificationsHistory_;
94 bool requestRedraw_ =
false;
95 bool historyMode_ =
false;
97 float showHistoryBtnMaxTime_{ -1.0f };
98 float currentHistoryBtnTimer_{ -1.0f };
100 Time requestedTime_{ Time::max() };
101 AsyncRequest asyncRequest_;
105 void drawHistoryButton_(
float scaling,
const Box2i& limitFramebuffer );
107 void drawHistory_(
float scaling,
const Box2i& limitFramebuffer );
109 void drawFloating_(
float scaling,
const Box2i& limitFramebuffer );
112 bool scrollDownNeeded_ =
false;
113 float prevHistoryScrollMax_ = 0.0f;
114 struct DrawNotificationSettings
117 float scalig{ 1.0f };
119 bool historyMode{
false };
120 Vector2f* currentPos{
nullptr };
124 bool drawNotification_(
const DrawNotificationSettings& settings );
125 void addNotification_( std::vector<NotificationWithTimer>& store,
const RibbonNotification& notification );
126 void filterInvalid_(
int numInvalid = -1 );
127 void requestClosestRedraw_();
#define MR_MAKE_FLAG_OPERATORS(T)
Definition MRFlagOperators.h:6
Definition MRRibbonNotification.h:64
MRVIEWER_API void setHitoryButtonMaxLifeTime(float histBtnMaxLifeTime)
MRVIEWER_API void pushNotification(const RibbonNotification ¬ification)
MRVIEWER_API void draw(float scaling, const Box2i &limitFramebuffer)
auto width(const Box< V > &box)
returns size along x axis
Definition MRMesh/MRBox.h:247
std::chrono::time_point< std::chrono::system_clock > Time
Definition MRAsyncTimer.h:17
NotificationType
Definition MRNotificationType.h:7
unsigned NotificationTagMask
Definition MRRibbonNotification.h:28
RibbonNotificationCorner
corner where notifications will appear
Definition MRRibbonNotification.h:32
Definition MRRibbonNotification.h:38
std::string buttonName
Definition MRRibbonNotification.h:45
NotificationTagMask tags
Definition MRRibbonNotification.h:56
std::function< void()> OnButtonClick
Definition MRRibbonNotification.h:41
OnButtonClick onButtonClick
Definition MRRibbonNotification.h:42
std::string text
Definition MRRibbonNotification.h:49
NotificationType type
Definition MRRibbonNotification.h:51
float lifeTimeSec
Definition MRRibbonNotification.h:54
bool operator==(const RibbonNotification &other) const
std::string header
Definition MRRibbonNotification.h:47