37 std::string buttonName =
"OK";
46 float lifeTimeSec = -1.0f;
61 MRVIEWER_API
void draw(
float scaling,
float scenePosX,
float topPanelHeight );
64 float defaultNotificationLifeTimeSeconds = 5.0f;
69 struct NotificationWithTimer
75 std::vector<NotificationWithTimer> notifications_;
76 std::vector<NotificationWithTimer> notificationsHistory_;
77 bool requestRedraw_ =
false;
78 bool historyMode_ =
false;
81 Time requestedTime_{ Time::max() };
82 AsyncRequest asyncRequest_;
86 void drawHistoryButton_(
float scaling,
float scenePosX );
88 void drawHistory_(
float scaling,
float scenePosX,
float topPanelHeight );
90 void drawFloating_(
float scaling,
float scenePosX );
93 bool scrollDownNeeded_ =
false;
94 float prevHistoryScrollMax_ = 0.0f;
95 struct DrawNotificationSettings
100 bool historyMode{
false };
101 Vector2f* currentPos{
nullptr };
105 bool drawNotification_(
const DrawNotificationSettings& settings );
106 void addNotification_( std::vector<NotificationWithTimer>& store,
const RibbonNotification& notification );
107 void filterInvalid_(
int numInvalid = -1 );
108 void requestClosestRedraw_();
#define MR_MAKE_FLAG_OPERATORS(T)
Definition MRFlagOperators.h:6
Definition MRRibbonNotification.h:56
MRVIEWER_API void draw(float scaling, float scenePosX, float topPanelHeight)
MRVIEWER_API void pushNotification(const RibbonNotification ¬ification)
auto width(const Box< V > &box)
returns size along x axis
Definition MRMesh/MRBox.h:247
Definition MRCameraOrientationPlugin.h:8
std::chrono::time_point< std::chrono::system_clock > Time
Definition MRAsyncTimer.h:17
NotificationType
Definition MRNotificationType.h:7
unsigned NotificationTagMask
Definition MRRibbonNotification.h:27
Definition MRRibbonNotification.h:30
std::function< void()> OnButtonClick
Definition MRRibbonNotification.h:33
OnButtonClick onButtonClick
Definition MRRibbonNotification.h:34
std::string text
Definition MRRibbonNotification.h:41
bool operator==(const RibbonNotification &other) const
std::string header
Definition MRRibbonNotification.h:39