OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::NotificationManager::HintNotification Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/HintNotification.hpp>

Inheritance diagram for Slic3r::GUI::NotificationManager::HintNotification:
Collaboration diagram for Slic3r::GUI::NotificationManager::HintNotification:

Public Types

enum class  EState {
  Unknown , Hidden , Shown , NotFading ,
  FadingOut , ClosePending , Finished , Hovered ,
  Paused
}
typedef std::function< void(PopNotification *)> DeleteCallback

Public Member Functions

 HintNotification (const NotificationData &n, NotificationIDProvider &id_provider, wxEvtHandler *evt_handler, bool new_hint)
virtual void init () override
void open_next ()
virtual void render (GLCanvas3D &canvas, float initial_y, bool move_from_overlay, float overlay_width, float right_margin)
virtual void bbl_render_block_notification (GLCanvas3D &canvas, float initial_y, bool move_from_overlay, float overlay_width, float right_margin)
virtual void close ()
void update (const NotificationData &n)
void append (const std::string &append_str)
bool is_finished () const
void reinit ()
float get_top () const
float get_bottom () const
float get_current_top () const
const NotificationType get_type () const
const NotificationData & get_data () const
std::string get_text1 () const
const bool is_gray () const
void set_gray (bool g)
virtual bool compare_text (const std::string &text) const
void hide (bool h)
virtual bool update_state (bool paused, const int64_t delta)
int64_t next_render () const
EState get_state () const
bool is_hovered () const
void set_hovered ()
void reset_timer ()
void set_Multiline (bool Multi)
virtual void on_change_color_mode (bool is_dark)
void set_scale (float scale)
void set_delete_callback (DeleteCallback)
bool is_valid_delete_callback ()

Protected Member Functions

virtual void set_next_window_size (ImGuiWrapper &imgui) override
virtual void count_spaces () override
virtual void count_lines () override
virtual bool on_text_click () override
virtual void render_text (ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y) override
virtual void render_close_button (ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y) override
virtual void render_minimize_button (ImGuiWrapper &imgui, const float win_pos_x, const float win_pos_y) override
void render_preferences_button (ImGuiWrapper &imgui, const float win_pos_x, const float win_pos_y)
void render_right_arrow_button (ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
void render_documentation_button (ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
void render_logo (ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
void retrieve_data (bool new_hint=true)
void open_documentation ()
virtual void render_hypertext (ImGuiWrapper &imgui, const float text_x, const float text_y, const std::string text, bool more=false)
void render_hyperlink_action (ImGuiWrapper &imgui, float text_x, float text_y, const std::string &text, const char *button_id, const std::function< void()> &on_click)
virtual void bbl_render_block_notif_text (ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
virtual void bbl_render_block_notif_buttons (ImGuiWrapper &imgui, ImVec2 win_size, ImVec2 win_pos)
virtual void bbl_render_block_notif_left_sign (ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
virtual void bbl_render_left_sign (ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
virtual void render_left_sign (ImGuiWrapper &imgui)
virtual bool push_background_color ()
virtual int get_duration ()
void ensure_ui_inited ()
void use_bbl_theme ()
void restore_default_theme ()

Protected Attributes

bool m_has_hint_data { false }
std::function< void(void)> m_hypertext_callback
std::string m_disabled_tags
std::string m_enabled_tags
bool m_runtime_disable
std::string m_documentation_link
float m_close_b_y { 0 }
float m_close_b_w { 0 }
long m_docu_hover_time { 0 }
long m_prefe_hover_time { 0 }
bool m_is_dark = false
bool m_is_dark_inited = false
const NotificationData m_data
NotificationIDProvider & m_id_provider
int m_id { 0 }
ImGUITheme m_DefaultTheme
ImVec4 m_WindowBkgColor
ImVec4 m_TextColor
ImVec4 m_HyperTextColor
ImVec4 m_HyperTextColorHover
ImVec4 m_ErrorColor
ImVec4 m_WarnColor
ImVec4 m_NormalColor
ImVec4 m_CurrentColor
float m_WindowRadius
bool m_WindowRadius_inited = false
EState m_state { EState::Unknown }
int64_t m_fading_start { 0LL }
int64_t m_notification_start
int64_t m_next_render { std::numeric_limits<int64_t>::max() }
float m_current_fade_opacity { 1.0f }
std::string m_text1
std::string m_hypertext
std::string m_text2
size_t pos_start = std::string::npos
size_t pos_end = std::string::npos
std::string error_start = "<Error>"
std::string error_end = "</Error>"
DeleteCallback m_on_delete_callback
float m_window_width_offset
float m_left_indentation
float m_window_height { 56.0f }
float m_window_width { 450.0f }
float m_top_y { 0.0f }
float m_bottom_y { 0.0f }
float m_line_height
std::vector< size_t > m_endlines
std::vector< size_t > m_endlines2
bool m_is_gray { false }
bool m_multiline { false }
bool m_minimize_b_visible { false }
size_t m_lines_count { 1 }
wxEvtHandler * m_evt_handler
float m_scale = 1.0f

Detailed Description

Member Typedef Documentation

◆ DeleteCallback

Member Enumeration Documentation

◆ EState

Enumerator
Unknown 
Hidden 
Shown 
NotFading 
FadingOut 
ClosePending 
Finished 
Hovered 
Paused 
476 {
477 Unknown, // NOT initialized
478 Hidden,
479 Shown, // Requesting Render at some time if duration != 0
480 NotFading, // Never jumps to state Fading out even if duration says so
481 FadingOut, // Requesting Render at some time
482 ClosePending, // Requesting Render
483 Finished, // Requesting Render
484 Hovered, // Followed by Shown
485 Paused
486 };
@ Unknown
Definition PresetBundle.hpp:42

Constructor & Destructor Documentation

◆ HintNotification()

Slic3r::GUI::NotificationManager::HintNotification::HintNotification ( const NotificationData & n,
NotificationIDProvider & id_provider,
wxEvtHandler * evt_handler,
bool new_hint )
inline
94 : PopNotification(n, id_provider, evt_handler)
95 {
96 retrieve_data(new_hint);
97 }
void retrieve_data(bool new_hint=true)
Definition HintNotification.cpp:1160
PopNotification(const NotificationData &n, NotificationIDProvider &id_provider, wxEvtHandler *evt_handler)
Definition NotificationManager.cpp:184

References Slic3r::GUI::NotificationManager::PopNotification::PopNotification(), and retrieve_data().

Here is the call graph for this function:

Member Function Documentation

◆ append()

void Slic3r::GUI::NotificationManager::PopNotification::append ( const std::string & append_str)
inherited
1063{
1064 m_text1 = m_text1 + "\n" + append_str;
1065 //m_hypertext = n.hypertext;
1066 //m_text2 = n.text2;
1067 //const_cast<NotificationData&>(m_data).callback = n.callback;
1068 init();
1069 m_multiline = false;
1070}
virtual void init()
Definition NotificationManager.cpp:622
bool m_multiline
Definition NotificationManager.hpp:662
std::string m_text1
Definition NotificationManager.hpp:628

References Slic3r::GUI::NotificationManager::init(), m_multiline, and m_text1.

Here is the call graph for this function:

◆ bbl_render_block_notif_buttons()

void Slic3r::GUI::NotificationManager::PopNotification::bbl_render_block_notif_buttons ( ImGuiWrapper & imgui,
ImVec2 win_size,
ImVec2 win_pos )
protectedvirtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::PluginMissingNotification.

906{
907 // close button
908 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
909 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
910 push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
911 push_style_color(ImGuiCol_TextSelectedBg, ImVec4(0, .75f, .75f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
912 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f));
913
914 std::wstring button_text;
915 button_text = ImGui::CloseBlockNotifButton;
916 ImVec2 button_pic_size = ImGui::CalcTextSize(into_u8(button_text).c_str());
917 ImVec2 button_size(button_pic_size.x * 2.f, button_pic_size.y * 2.f);
918
919 ImVec2 cursor_pos = { win_size.x - m_line_height * 2.0f, win_size.y / 2 - button_size.y / 2 };
920 ImGui::SetCursorPos(cursor_pos);
921 //if (ImGui::IsMouseHoveringRect(ImVec2(win_pos.x - win_size.x / 10.f, win_pos.y + win_size.y / 2 - button_pic_size.y),
922 // ImVec2(win_pos.x - win_size.x / 20.f, win_pos.y + win_size.y / 2 + button_pic_size.y),
923 // true))
924 if(ImGui::IsMouseHoveringRect(win_pos + cursor_pos, win_pos + cursor_pos + button_size))
925 {
926 button_text = ImGui::CloseBlockNotifHoverButton;
927 }
928 if (imgui.button(button_text.c_str(), button_size.x, button_size.y))
929 {
930 close();
931 }
932 ImGui::PopStyleColor(5);
933
934
936 //ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
937 //ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
938 //push_style_color(ImGuiCol_ButtonActive, ImGui::GetStyleColorVec4(ImGuiCol_WindowBg), m_state == EState::FadingOut, m_current_fade_opacity);
939 //push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
940 //push_style_color(ImGuiCol_TextSelectedBg, ImVec4(0, .75f, .75f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
942 //std::wstring button_text;
943 //button_text = m_is_dark ? ImGui::MinimalizeDarkButton : ImGui::MinimalizeButton;
944 //if (ImGui::IsMouseHoveringRect(ImVec2(win_pos_x - m_window_width / 10.f, win_pos_y + m_window_height - 2 * m_line_height + 1),
945 // ImVec2(win_pos_x, win_pos_y + m_window_height),
946 // true))
947 //{
948 // button_text = m_is_dark ? ImGui::MinimalizeHoverDarkButton : ImGui::MinimalizeHoverButton;
949 //}
950 //ImVec2 button_pic_size = ImGui::CalcTextSize(into_u8(button_text).c_str());
951 //ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
952 //ImGui::SetCursorPosX(m_window_width - m_line_height * 1.8f);
953 //ImGui::SetCursorPosY(m_window_height - button_size.y - 5);
954 //if (imgui.button(button_text.c_str(), button_size.x, button_size.y))
955 //{
956 // m_multiline = false;
957 //}
958
959 //ImGui::PopStyleColor(5);
960 //m_minimize_b_visible = true;
961}
float m_current_fade_opacity
Definition NotificationManager.hpp:623
@ FadingOut
Definition NotificationManager.hpp:481
float m_line_height
Definition NotificationManager.hpp:654
EState m_state
Definition NotificationManager.hpp:613
virtual void close()
Definition NotificationManager.cpp:477
void push_style_color(ImGuiCol idx, const ImVec4 &col, bool fading_out, float current_fade_opacity)
Definition HintNotification.cpp:81
std::string into_u8(const wxString &str)
Definition GUI.cpp:549

References Slic3r::GUI::ImGuiWrapper::button(), close(), FadingOut, Slic3r::GUI::into_u8(), m_current_fade_opacity, m_line_height, and m_state.

Referenced by bbl_render_block_notification().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bbl_render_block_notif_left_sign()

void Slic3r::GUI::NotificationManager::PopNotification::bbl_render_block_notif_left_sign ( ImGuiWrapper & imgui,
const float win_size_x,
const float win_size_y,
const float win_pos_x,
const float win_pos_y )
protectedvirtualinherited
972{
973 auto window = ImGui::GetCurrentWindow();
974 //window->DrawList->AddImage(user_texture_id, bb.Min + padding + margin, bb.Max - padding - margin, uv0, uv1, ImGui::GetColorU32(tint_col));
975
976 std::wstring text;
977 text = ImGui::BlockNotifErrorIcon;
978 ImGui::SetCursorPosX(m_line_height / 3);
979 ImGui::SetCursorPosY(m_window_height / 2 - m_line_height);
980 imgui.text(text.c_str());
981
982}
float m_window_height
Definition NotificationManager.hpp:647

References m_line_height, m_window_height, and Slic3r::GUI::ImGuiWrapper::text().

Referenced by bbl_render_block_notification().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bbl_render_block_notif_text()

void Slic3r::GUI::NotificationManager::PopNotification::bbl_render_block_notif_text ( ImGuiWrapper & imgui,
const float win_size_x,
const float win_size_y,
const float win_pos_x,
const float win_pos_y )
protectedvirtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::PluginMissingNotification.

649{
650 float x_offset = m_left_indentation;
651 int last_end = 0;
652 float starting_y = (m_lines_count == 2 ? win_size_y / 2 - m_line_height : (m_lines_count == 1 ? win_size_y / 2 - m_line_height / 2 : m_line_height / 2));
653 float shift_y = m_line_height;
654 std::string line;
655
656 for (size_t i = 0; i < (m_multiline ? m_endlines.size() : std::min(m_endlines.size(), (size_t)2)); i++) {
657 assert(m_endlines.size() > i && m_text1.size() >= m_endlines[i]);
658 line.clear();
659 ImGui::SetCursorPosX(x_offset);
660 ImGui::SetCursorPosY(starting_y + i * shift_y);
661 if (m_endlines.size() > i && m_text1.size() >= m_endlines[i]) {
662 if (i == 1 && m_endlines.size() > 2 && !m_multiline) {
663 // second line with "more" hypertext
664 line = m_text1.substr(m_endlines[0] + (m_text1[m_endlines[0]] == '\n' || m_text1[m_endlines[0]] == ' ' ? 1 : 0), m_endlines[1] - m_endlines[0] - (m_text1[m_endlines[0]] == '\n' || m_text1[m_endlines[0]] == ' ' ? 1 : 0));
665 while (ImGui::CalcTextSize(line.c_str()).x > m_window_width - m_window_width_offset - ImGui::CalcTextSize((".." + _u8L("More")).c_str()).x) {
666 line = line.substr(0, line.length() - 1);
667 }
668 line += "..";
669 }
670 else {
671 // regural line
672 line = m_text1.substr(last_end, m_endlines[i] - last_end);
673 }
674 last_end = m_endlines[i];
675 if (m_text1.size() > m_endlines[i])
676 last_end += (m_text1[m_endlines[i]] == '\n' || m_text1[m_endlines[i]] == ' ' ? 1 : 0);
677
678 if (pos_start != std::string::npos && pos_end != std::string::npos && m_endlines[i] - line.length() >= pos_start && m_endlines[i] <= pos_end) {
680 imgui.text(line.c_str());
681 ImGui::PopStyleColor();
682 }
683 else {
684 imgui.text(line.c_str());
685 }
686 }
687 }
688 //hyperlink text
689 if (!m_multiline && m_lines_count > 2) {
690 render_hypertext(imgui, x_offset + ImGui::CalcTextSize((line + " ").c_str()).x, starting_y + shift_y, _u8L("More"), true);
691 }
692 else if (!m_hypertext.empty()) {
693 const ImVec2 button_size = {52, 28};
694 ImVec2 cursor_pos = { win_size_x - m_line_height * 6.0f, win_size_y / 2 - button_size.y / 2 };
695 ImGui::SetCursorPos(cursor_pos);
696 ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1);
697 ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 2);
698 ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(1.f, 1.f, 1.f, 1.f));
699 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1.f, 1.f, 1.f, 0.f));
700 //if (imgui.button(_L("Jump"), button_size.x, button_size.y)) { if (on_text_click()) { close(); } }
701 ImGui::PopStyleColor(2);
702 ImGui::PopStyleVar(2);
703 render_hypertext(imgui, x_offset + ImGui::CalcTextSize((line + (line.empty() ? "" : " ")).c_str()).x, starting_y + (m_endlines.size() - 1) * shift_y, m_hypertext);
704 }
705
706 // text2 (text after hypertext) is not rendered for regular notifications
707 // its rendering is in HintNotification::render_text
708}
size_t pos_start
Definition NotificationManager.hpp:634
float m_window_width
Definition NotificationManager.hpp:648
size_t pos_end
Definition NotificationManager.hpp:635
std::vector< size_t > m_endlines
Definition NotificationManager.hpp:656
size_t m_lines_count
Definition NotificationManager.hpp:665
float m_left_indentation
Definition NotificationManager.hpp:645
std::string m_hypertext
Definition NotificationManager.hpp:630
float m_window_width_offset
Definition NotificationManager.hpp:643
ImVec4 m_ErrorColor
Definition NotificationManager.hpp:601
virtual void render_hypertext(ImGuiWrapper &imgui, const float text_x, const float text_y, const std::string text, bool more=false)
Definition NotificationManager.cpp:762
#define _u8L(s)
Definition I18N.hpp:11

References _u8L, FadingOut, m_current_fade_opacity, m_endlines, m_ErrorColor, m_hypertext, m_left_indentation, m_line_height, m_lines_count, m_multiline, m_state, m_text1, m_window_width, m_window_width_offset, pos_end, pos_start, render_hypertext(), and Slic3r::GUI::ImGuiWrapper::text().

Referenced by bbl_render_block_notification().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bbl_render_block_notification()

void Slic3r::GUI::NotificationManager::PopNotification::bbl_render_block_notification ( GLCanvas3D & canvas,
float initial_y,
bool move_from_overlay,
float overlay_width,
float right_margin )
virtualinherited
388{
390 init();
391
392 if (m_state == EState::Hidden) {
393 m_top_y = initial_y - GAP_WIDTH;
394 return;
395 }
396
398 {
400 return;
401 }
402
403 Size cnv_size = canvas.get_canvas_size();
404 ImGuiWrapper& imgui = *wxGetApp().imgui();
405 float right_gap = right_margin + (move_from_overlay ? overlay_width + m_line_height * 5 : 0);
406 bool fading_pop = false;
407
408 if (m_line_height != ImGui::CalcTextSize("A").y)
409 init();
410
412
413 // top y of window
414 m_top_y = initial_y + m_window_height;
415
416 ImVec2 win_pos(1.0f * (float) cnv_size.get_width() - right_gap, 1.0f * (float) cnv_size.get_height() - m_top_y);
417 imgui.set_next_window_pos(win_pos.x, win_pos.y, ImGuiCond_Always, 1.0f, 0.0f);
418 imgui.set_next_window_size(m_window_width, m_window_height, ImGuiCond_Always);
419
420 // color change based on fading out
421 if (m_state == EState::FadingOut) {
422 push_style_color(ImGuiCol_WindowBg, ImGui::GetStyleColorVec4(ImGuiCol_WindowBg), true, m_current_fade_opacity);
423 push_style_color(ImGuiCol_Text, ImGui::GetStyleColorVec4(ImGuiCol_Text), true, m_current_fade_opacity);
424 push_style_color(ImGuiCol_ButtonHovered, ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered), true, m_current_fade_opacity);
425 fading_pop = true;
426 }
427
428 bool bgrnd_color_pop = push_background_color();
429
430 // name of window indentifies window - has to be unique string
431 if (m_id == 0)
432 m_id = m_id_provider.allocate_id();
433 std::string name = "!!Ntfctn" + std::to_string(m_id);
434
437 { // ORCA match and ensure color usage
438 push_style_color(ImGuiCol_Border, m_WarnColor, true, m_current_fade_opacity);
439 push_style_color(ImGuiCol_WindowBg, m_WarnColor, true, m_current_fade_opacity);
440 }
442 { // ORCA match and ensure color usage
444 push_style_color(ImGuiCol_WindowBg, m_ErrorColor, true, m_current_fade_opacity);
445 }
446 push_style_color(ImGuiCol_Text, { 1,1,1,1 }, true, m_current_fade_opacity);
447
448 if (imgui.begin(name, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) {
449 ImVec2 win_size = ImGui::GetWindowSize();
450 ImVec2 win_pos = ImGui::GetWindowPos();
451 if (ImGui::IsMouseHoveringRect(win_pos, win_pos + win_size)) {
452 set_hovered();
453 }
454
455 //render left icon
456 bbl_render_block_notif_left_sign(imgui, win_size.x, win_size.y, win_pos.x, win_pos.y);
457 bbl_render_block_notif_text(imgui, win_size.x, win_size.y, win_pos.x, win_pos.y);
458 bbl_render_block_notif_buttons(imgui, win_size, win_pos);
459 //render_close_button(imgui, win_size.x, win_size.y, win_pos.x, win_pos.y);
460 //m_minimize_b_visible = false;
461 //if (m_multiline && m_lines_count > 3)
462 // render_minimize_button(imgui, win_pos.x, win_pos.y);
463 }
464 ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow());
465 imgui.end();
466
467 ImGui::PopStyleColor(3);
469
470 if (bgrnd_color_pop)
471 ImGui::PopStyleColor();
472
473 if (fading_pop)
474 ImGui::PopStyleColor(3);
475}
static constexpr float GAP_WIDTH
Definition NotificationManager.cpp:61
ImVec4 m_WarnColor
Definition NotificationManager.hpp:602
const NotificationData m_data
Definition NotificationManager.hpp:578
virtual void set_next_window_size(ImGuiWrapper &imgui)
Definition NotificationManager.cpp:640
virtual void bbl_render_block_notif_buttons(ImGuiWrapper &imgui, ImVec2 win_size, ImVec2 win_pos)
Definition NotificationManager.cpp:905
virtual void bbl_render_block_notif_text(ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
Definition NotificationManager.cpp:648
void use_bbl_theme()
Definition NotificationManager.cpp:236
virtual bool push_background_color()
Definition NotificationManager.cpp:483
@ ClosePending
Definition NotificationManager.hpp:482
@ Hidden
Definition NotificationManager.hpp:478
@ Unknown
Definition NotificationManager.hpp:477
@ Finished
Definition NotificationManager.hpp:483
int m_id
Definition NotificationManager.hpp:581
virtual void bbl_render_block_notif_left_sign(ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
Definition NotificationManager.cpp:971
NotificationIDProvider & m_id_provider
Definition NotificationManager.hpp:580
float m_top_y
Definition NotificationManager.hpp:650
void set_hovered()
Definition NotificationManager.hpp:517
void restore_default_theme()
Definition NotificationManager.cpp:279
@ SeriousWarningNotificationLevel
Definition NotificationManager.hpp:226
@ ErrorNotificationLevel
Definition NotificationManager.hpp:228

References bbl_render_block_notif_buttons(), bbl_render_block_notif_left_sign(), bbl_render_block_notif_text(), Slic3r::GUI::ImGuiWrapper::begin(), ClosePending, Slic3r::GUI::ImGuiWrapper::end(), Slic3r::GUI::NotificationManager::ErrorNotificationLevel, FadingOut, Finished, GAP_WIDTH, Slic3r::GUI::GLCanvas3D::get_canvas_size(), Slic3r::GUI::Size::get_height(), Slic3r::GUI::Size::get_width(), Hidden, Slic3r::GUI::NotificationManager::init(), m_current_fade_opacity, m_data, m_ErrorColor, m_id, m_id_provider, m_line_height, m_state, m_top_y, m_WarnColor, m_window_height, m_window_width, push_background_color(), restore_default_theme(), Slic3r::GUI::NotificationManager::SeriousWarningNotificationLevel, set_hovered(), Slic3r::GUI::ImGuiWrapper::set_next_window_pos(), Slic3r::GUI::ImGuiWrapper::set_next_window_size(), set_next_window_size(), Unknown, and use_bbl_theme().

Here is the call graph for this function:

◆ bbl_render_left_sign()

void Slic3r::GUI::NotificationManager::PopNotification::bbl_render_left_sign ( ImGuiWrapper & imgui,
const float win_size_x,
const float win_size_y,
const float win_pos_x,
const float win_pos_y )
protectedvirtualinherited
985{
987 ImDrawList *draw_list = ImGui::GetWindowDrawList();
988 ImVec2 round_rect_pos = ImVec2(win_pos_x - win_size_x + ImGui::GetStyle().WindowBorderSize, win_pos_y + ImGui::GetStyle().WindowBorderSize);
989 ImVec2 round_rect_size = ImVec2(m_WindowRadius * 2, win_size_y - 2 * ImGui::GetStyle().WindowBorderSize);
990
991 ImVec2 rect_pos = round_rect_pos + ImVec2(m_WindowRadius, 0);
992 ImVec2 rect_size = ImVec2(round_rect_size.x / 2, round_rect_size.y);
993
994 ImU32 clr = ImGui::GetColorU32(ImVec4(m_CurrentColor.x, m_CurrentColor.y, m_CurrentColor.z, m_current_fade_opacity));
995
996 draw_list->AddRectFilled(round_rect_pos, round_rect_pos + round_rect_size, clr, m_WindowRadius);
997 draw_list->AddRectFilled(rect_pos, rect_pos + rect_size, clr, 0);
998}
ImVec4 m_CurrentColor
Definition NotificationManager.hpp:604
float m_WindowRadius
Definition NotificationManager.hpp:606
void ensure_ui_inited()
Definition NotificationManager.cpp:205

References ensure_ui_inited(), m_current_fade_opacity, m_CurrentColor, and m_WindowRadius.

Referenced by render().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ close()

◆ compare_text()

bool Slic3r::GUI::NotificationManager::PopNotification::compare_text ( const std::string & text) const
virtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::PrintHostUploadNotification, and Slic3r::GUI::NotificationManager::URLDownloadNotification.

1073{
1074 std::wstring wt1 = boost::nowide::widen(m_text1);
1075 std::wstring wt2 = boost::nowide::widen(text);
1076 wt1.erase(std::remove_if(wt1.begin(), wt1.end(), ::iswspace), wt1.end());
1077 wt2.erase(std::remove_if(wt2.begin(), wt2.end(), ::iswspace), wt2.end());
1078 if (wt1.compare(wt2) == 0)
1079 return true;
1080 return false;
1081}

References m_text1.

◆ count_lines()

void Slic3r::GUI::NotificationManager::HintNotification::count_lines ( )
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::NotificationManager::PopNotification.

713{
714 std::string text = m_text1;
715 size_t last_end = 0;
716 m_lines_count = 0;
717
718 if (text.empty())
719 return;
720
721 m_endlines.clear();
722 while (last_end < text.length() - 1)
723 {
724 size_t next_hard_end = text.find_first_of('\n', last_end);
725 if (next_hard_end != std::string::npos && ImGui::CalcTextSize(text.substr(last_end, next_hard_end - last_end).c_str()).x < m_window_width - m_window_width_offset) {
726 //next line is ended by '/n'
727 m_endlines.push_back(next_hard_end);
728 last_end = next_hard_end + 1;
729 }
730 else {
731 // find next suitable endline
732 if (ImGui::CalcTextSize(text.substr(last_end).c_str()).x >= m_window_width - m_window_width_offset) {
733 // more than one line till end
734 size_t next_space = text.find_first_of(' ', last_end);
735 if (next_space > 0 && next_space < text.length()) {
736 size_t next_space_candidate = text.find_first_of(' ', next_space + 1);
737 while (next_space_candidate > 0 && ImGui::CalcTextSize(text.substr(last_end, next_space_candidate - last_end).c_str()).x < m_window_width - m_window_width_offset) {
738 next_space = next_space_candidate;
739 next_space_candidate = text.find_first_of(' ', next_space + 1);
740 }
741 }
742 else {
743 next_space = text.length();
744 }
745 // when one word longer than line.
746 if (ImGui::CalcTextSize(text.substr(last_end, next_space - last_end).c_str()).x > m_window_width - m_window_width_offset ||
747 ImGui::CalcTextSize(text.substr(last_end, next_space - last_end).c_str()).x < (m_window_width - m_window_width_offset) / 5 * 3
748 ) {
749 float width_of_a = ImGui::CalcTextSize("a").x;
750 int letter_count = (int)((m_window_width - m_window_width_offset) / width_of_a);
751 while (last_end + letter_count < text.size() && ImGui::CalcTextSize(text.substr(last_end, letter_count).c_str()).x < m_window_width - m_window_width_offset) {
752 letter_count += get_utf8_seq_length(text, last_end + letter_count);
753 }
754 m_endlines.push_back(last_end + letter_count);
755 last_end += letter_count;
756 }
757 else {
758 m_endlines.push_back(next_space);
759 last_end = next_space + 1;
760 }
761 }
762 else {
763 m_endlines.push_back(text.length());
764 last_end = text.length();
765 }
766
767 }
769 }
770 int prev_end = m_endlines.size() > 1 ? m_endlines[m_endlines.size() - 2] : 0;
771 int size_of_last_line = ImGui::CalcTextSize(text.substr(prev_end, last_end - prev_end).c_str()).x;
772 // hypertext calculation
773 if (!m_hypertext.empty()) {
774 if (size_of_last_line + ImGui::CalcTextSize(m_hypertext.c_str()).x > m_window_width - m_window_width_offset) {
775 // hypertext on new line
776 size_of_last_line = ImGui::CalcTextSize((m_hypertext + " ").c_str()).x;
777 m_endlines.push_back(last_end);
779 }
780 else {
781 size_of_last_line += ImGui::CalcTextSize((m_hypertext + " ").c_str()).x;
782 }
783 }
784 if (!m_text2.empty()) {
785 text = m_text2;
786 last_end = 0;
787 m_endlines2.clear();
788 // if size_of_last_line too large to fit anything
789 size_t first_end = std::min(text.find_first_of('\n'), text.find_first_of(' '));
790 if (size_of_last_line >= m_window_width - m_window_width_offset - ImGui::CalcTextSize(text.substr(0, first_end).c_str()).x) {
791 m_endlines2.push_back(0);
792 size_of_last_line = 0;
793 }
794 while (last_end < text.length() - 1)
795 {
796 size_t next_hard_end = text.find_first_of('\n', last_end);
797 if (next_hard_end != std::string::npos && ImGui::CalcTextSize(text.substr(last_end, next_hard_end - last_end).c_str()).x < m_window_width - m_window_width_offset - size_of_last_line) {
798 //next line is ended by '/n'
799 m_endlines2.push_back(next_hard_end);
800 last_end = next_hard_end + 1;
801 }
802 else {
803 // find next suitable endline
804 if (ImGui::CalcTextSize(text.substr(last_end).c_str()).x >= m_window_width - m_window_width_offset - size_of_last_line) {
805 // more than one line till end
806 size_t next_space = text.find_first_of(' ', last_end);
807 if (next_space > 0) {
808 size_t next_space_candidate = text.find_first_of(' ', next_space + 1);
809 while (next_space_candidate > 0 && ImGui::CalcTextSize(text.substr(last_end, next_space_candidate - last_end).c_str()).x < m_window_width - m_window_width_offset - size_of_last_line) {
810 next_space = next_space_candidate;
811 next_space_candidate = text.find_first_of(' ', next_space + 1);
812 }
813 }
814 else {
815 next_space = text.length();
816 }
817 // when one word longer than line.
818 if (ImGui::CalcTextSize(text.substr(last_end, next_space - last_end).c_str()).x > m_window_width - m_window_width_offset - size_of_last_line ||
819 ImGui::CalcTextSize(text.substr(last_end, next_space - last_end).c_str()).x + size_of_last_line < (m_window_width - m_window_width_offset) / 5 * 3
820 ) {
821 float width_of_a = ImGui::CalcTextSize("a").x;
822 int letter_count = (int)((m_window_width - m_window_width_offset - size_of_last_line) / width_of_a);
823 while (last_end + letter_count < text.size() && ImGui::CalcTextSize(text.substr(last_end, letter_count).c_str()).x < m_window_width - m_window_width_offset - size_of_last_line) {
824 letter_count += get_utf8_seq_length(text, last_end + letter_count);
825 }
826 m_endlines2.push_back(last_end + letter_count);
827 last_end += letter_count;
828 }
829 else {
830 m_endlines2.push_back(next_space);
831 last_end = next_space + 1;
832 }
833 }
834 else {
835 m_endlines2.push_back(text.length());
836 last_end = text.length();
837 }
838
839 }
840 if (size_of_last_line == 0) // if first line is continuation of previous text, do not add to line count.
842 size_of_last_line = 0; // should countain value only for first line (with hypertext)
843
844 }
845 }
846}
std::string m_text2
Definition NotificationManager.hpp:632
std::vector< size_t > m_endlines2
Definition NotificationManager.hpp:658
static int get_utf8_seq_length(const char *seq, size_t size)
Definition HintNotification.cpp:642

References Slic3r::GUI::get_utf8_seq_length(), Slic3r::GUI::NotificationManager::PopNotification::m_endlines, Slic3r::GUI::NotificationManager::PopNotification::m_endlines2, Slic3r::GUI::NotificationManager::PopNotification::m_hypertext, Slic3r::GUI::NotificationManager::PopNotification::m_lines_count, Slic3r::GUI::NotificationManager::PopNotification::m_text1, Slic3r::GUI::NotificationManager::PopNotification::m_text2, Slic3r::GUI::NotificationManager::PopNotification::m_window_width, and Slic3r::GUI::NotificationManager::PopNotification::m_window_width_offset.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ count_spaces()

void Slic3r::GUI::NotificationManager::HintNotification::count_spaces ( )
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::NotificationManager::PopNotification.

621{
622 //determine line width
623 m_line_height = ImGui::CalcTextSize("A").y;
624
625
626 std::string text;
627 text = ImGui::WarningMarker;
628 float picture_width = ImGui::CalcTextSize(text.c_str()).x;
629 m_left_indentation = picture_width * 1.5f + m_line_height / 2;
630
631 // no left button picture
632 //m_left_indentation = m_line_height;
633
634 if (m_documentation_link.empty())
636 else
638
640}
std::string m_documentation_link
Definition HintNotification.hpp:134

References m_documentation_link, Slic3r::GUI::NotificationManager::PopNotification::m_left_indentation, Slic3r::GUI::NotificationManager::PopNotification::m_line_height, Slic3r::GUI::NotificationManager::PopNotification::m_window_width, and Slic3r::GUI::NotificationManager::PopNotification::m_window_width_offset.

Referenced by init().

Here is the caller graph for this function:

◆ ensure_ui_inited()

void Slic3r::GUI::NotificationManager::PopNotification::ensure_ui_inited ( )
protectedinherited
206{
207 if (!m_is_dark_inited) {
208 m_is_dark = wxGetApp().plater()->get_current_canvas3D()->get_dark_mode_status();
209 m_is_dark_inited = true;
210 }
211
213 m_WindowRadius = 4.0f * wxGetApp().plater()->get_current_canvas3D()->get_scale();
215 }
216}
bool m_is_dark_inited
Definition NotificationManager.hpp:576
bool m_WindowRadius_inited
Definition NotificationManager.hpp:607
bool m_is_dark
Definition NotificationManager.hpp:575

References m_is_dark, m_is_dark_inited, m_WindowRadius, and m_WindowRadius_inited.

Referenced by bbl_render_left_sign(), render_close_button(), render_minimize_button(), and use_bbl_theme().

Here is the caller graph for this function:

◆ get_bottom()

float Slic3r::GUI::NotificationManager::PopNotification::get_bottom ( ) const
inlineinherited
502{ return m_bottom_y; }
float m_bottom_y
Definition NotificationManager.hpp:652

References m_bottom_y.

◆ get_current_top()

float Slic3r::GUI::NotificationManager::PopNotification::get_current_top ( ) const
inlineinherited
504{ return m_top_y; }

References m_top_y.

◆ get_data()

const NotificationData & Slic3r::GUI::NotificationManager::PopNotification::get_data ( ) const
inlineinherited
506{ return m_data; }

References m_data.

Referenced by Slic3r::GUI::NotificationManager::activate_existing(), Slic3r::GUI::NotificationManager::UpdatedItemsInfoNotification::add_type(), and Slic3r::GUI::NotificationManager::ExportFinishedNotification::on_eject_click().

Here is the caller graph for this function:

◆ get_duration()

virtual int Slic3r::GUI::NotificationManager::PopNotification::get_duration ( )
inlineprotectedvirtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::SlicingProgressNotification.

571{ return m_data.duration; }

References m_data.

Referenced by update_state().

Here is the caller graph for this function:

◆ get_state()

EState Slic3r::GUI::NotificationManager::PopNotification::get_state ( ) const
inlineinherited
515{ return m_state; }

References m_state.

Referenced by Slic3r::GUI::NotificationManager::ProgressIndicatorNotification::update_state(), and Slic3r::GUI::NotificationManager::SlicingProgressNotification::update_state().

Here is the caller graph for this function:

◆ get_text1()

std::string Slic3r::GUI::NotificationManager::PopNotification::get_text1 ( ) const
inlineinherited
507{ return m_text1; }

References m_text1.

◆ get_top()

float Slic3r::GUI::NotificationManager::PopNotification::get_top ( ) const
inlineinherited
500{ return m_top_y; }

References m_top_y.

◆ get_type()

const NotificationType Slic3r::GUI::NotificationManager::PopNotification::get_type ( ) const
inlineinherited
505{ return m_data.type; }

References m_data.

Referenced by Slic3r::GUI::NotificationManager::activate_existing().

Here is the caller graph for this function:

◆ hide()

void Slic3r::GUI::NotificationManager::PopNotification::hide ( bool h)
inherited
1084{
1085 if (is_finished()) return;
1087}
bool is_finished() const
Definition NotificationManager.hpp:497

References Hidden, is_finished(), m_state, and Unknown.

Here is the call graph for this function:

◆ init()

void Slic3r::GUI::NotificationManager::HintNotification::init ( )
overridevirtual

Reimplemented from Slic3r::GUI::NotificationManager::PopNotification.

849{
850 // Do not init closing notification
851 if (is_finished())
852 return;
853
854 count_spaces();
855 count_lines();
856
857 m_multiline = true;
858
862}
static int64_t timestamp_now()
Definition GLCanvas3D.hpp:1416
virtual void count_spaces() override
Definition HintNotification.cpp:620
virtual void count_lines() override
Definition HintNotification.cpp:712
int64_t m_notification_start
Definition NotificationManager.hpp:620
@ Shown
Definition NotificationManager.hpp:479

References count_lines(), count_spaces(), Slic3r::GUI::NotificationManager::PopNotification::is_finished(), Slic3r::GUI::NotificationManager::PopNotification::m_multiline, Slic3r::GUI::NotificationManager::PopNotification::m_notification_start, Slic3r::GUI::NotificationManager::PopNotification::m_state, Slic3r::GUI::NotificationManager::PopNotification::Shown, Slic3r::GUI::GLCanvas3D::timestamp_now(), and Slic3r::GUI::NotificationManager::PopNotification::Unknown.

Here is the call graph for this function:

◆ is_finished()

bool Slic3r::GUI::NotificationManager::PopNotification::is_finished ( ) const
inlineinherited

References ClosePending, Finished, and m_state.

Referenced by Slic3r::GUI::NotificationManager::PlaterWarningNotification::close(), hide(), Slic3r::GUI::NotificationManager::HintNotification::init(), init(), and next_render().

Here is the caller graph for this function:

◆ is_gray()

const bool Slic3r::GUI::NotificationManager::PopNotification::is_gray ( ) const
inlineinherited
508{ return m_is_gray; }
bool m_is_gray
Definition NotificationManager.hpp:660

References m_is_gray.

◆ is_hovered()

bool Slic3r::GUI::NotificationManager::PopNotification::is_hovered ( ) const
inlineinherited
516{ return m_state == EState::Hovered; }
@ Hovered
Definition NotificationManager.hpp:484

References Hovered, and m_state.

◆ is_valid_delete_callback()

bool Slic3r::GUI::NotificationManager::PopNotification::is_valid_delete_callback ( )
inherited
230{
232 return true;
233 return false;
234}
DeleteCallback m_on_delete_callback
Definition NotificationManager.hpp:639

References m_on_delete_callback.

◆ next_render()

int64_t Slic3r::GUI::NotificationManager::PopNotification::next_render ( ) const
inlineinherited
514{ return is_finished() ? 0 : m_next_render; }
int64_t m_next_render
Definition NotificationManager.hpp:622

References is_finished(), and m_next_render.

Referenced by update_state().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_change_color_mode()

void Slic3r::GUI::NotificationManager::PopNotification::on_change_color_mode ( bool is_dark)
virtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::SlicingProgressNotification.

219{
220 m_is_dark_inited = true;
222}
static bool is_dark()
Definition TextureImportDialog.cpp:85

References is_dark(), m_is_dark, and m_is_dark_inited.

Referenced by Slic3r::GUI::NotificationManager::SlicingProgressNotification::on_change_color_mode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_text_click()

bool Slic3r::GUI::NotificationManager::HintNotification::on_text_click ( )
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::NotificationManager::PopNotification.

877{
880 return false;
881}
bool m_runtime_disable
Definition HintNotification.hpp:133
std::string m_enabled_tags
Definition HintNotification.hpp:132
std::string m_disabled_tags
Definition HintNotification.hpp:131
std::function< void(void)> m_hypertext_callback
Definition HintNotification.hpp:130
bool tags_check(const std::string &disabled_tags, const std::string &enabled_tags)
Definition HintNotification.cpp:220

References m_disabled_tags, m_enabled_tags, m_hypertext_callback, and m_runtime_disable.

◆ open_documentation()

void Slic3r::GUI::NotificationManager::HintNotification::open_documentation ( )
protected
1154{
1155 if (!m_documentation_link.empty())
1156 {
1158 }
1159}
void launch_browser_if_allowed(const std::string &url)
Definition HintNotification.cpp:306

References m_documentation_link.

Referenced by render_documentation_button().

Here is the caller graph for this function:

◆ open_next()

void Slic3r::GUI::NotificationManager::HintNotification::open_next ( )
inline
99{ retrieve_data(); }

References retrieve_data().

Here is the call graph for this function:

◆ push_background_color()

bool Slic3r::GUI::NotificationManager::PopNotification::push_background_color ( )
protectedvirtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::PrintHostUploadNotification.

484{
485 if (m_is_gray) {
486 ImVec4 backcolor(0.7f, 0.7f, 0.7f, 0.5f);
487 push_style_color(ImGuiCol_WindowBg, backcolor, m_state == EState::FadingOut, m_current_fade_opacity);
488 return true;
489 }
491 ImVec4 backcolor = ImGui::GetStyleColorVec4(ImGuiCol_WindowBg);
492 backcolor.x += 0.3f;
493 push_style_color(ImGuiCol_WindowBg, backcolor, m_state == EState::FadingOut, m_current_fade_opacity);
494 return true;
495 }
497 ImVec4 backcolor = ImGui::GetStyleColorVec4(ImGuiCol_WindowBg);
498 backcolor.x += 0.3f;
499 backcolor.y += 0.15f;
500 push_style_color(ImGuiCol_WindowBg, backcolor, m_state == EState::FadingOut, m_current_fade_opacity);
501 return true;
502 }
503
504 return false;
505}
@ WarningNotificationLevel
Definition NotificationManager.hpp:224

References Slic3r::GUI::NotificationManager::ErrorNotificationLevel, FadingOut, m_current_fade_opacity, m_data, m_is_gray, m_state, and Slic3r::GUI::NotificationManager::WarningNotificationLevel.

Referenced by bbl_render_block_notification(), and render().

Here is the caller graph for this function:

◆ reinit()

void Slic3r::GUI::NotificationManager::PopNotification::reinit ( )
inlineinherited

References m_state, and Unknown.

◆ render()

void Slic3r::GUI::NotificationManager::PopNotification::render ( GLCanvas3D & canvas,
float initial_y,
bool move_from_overlay,
float overlay_width,
float right_margin )
virtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::SlicingProgressNotification.

295{
297 init();
298
299 if (m_state == EState::Hidden) {
300 m_top_y = initial_y - GAP_WIDTH;
301 return;
302 }
303
305 {
307 return;
308 }
309
310 Size cnv_size = canvas.get_canvas_size();
311 ImGuiWrapper& imgui = *wxGetApp().imgui();
312 ImVec2 mouse_pos = ImGui::GetMousePos();
313 float right_gap = right_margin + (move_from_overlay ? overlay_width + m_line_height * 5 : 0);
314 bool fading_pop = false;
315
316 if (m_line_height != ImGui::CalcTextSize("A").y)
317 init();
318
320
321 // top y of window
322 m_top_y = initial_y + m_window_height;
323
324 // position of upper-right corner
325 ImVec2 win_pos(1.0f * (float)cnv_size.get_width() - right_gap, 1.0f * (float)cnv_size.get_height() - m_top_y);
326 imgui.set_next_window_pos(win_pos.x, win_pos.y, ImGuiCond_Always, 1.0f, 0.0f);
327 imgui.set_next_window_size(m_window_width, m_window_height, ImGuiCond_Always);
328
329 // find if hovered FIXME: do it only in update state?
330 if (m_state == EState::Hovered) {
331 init();
332 }
333
334 if (mouse_pos.x < win_pos.x && mouse_pos.x > win_pos.x - m_window_width && mouse_pos.y > win_pos.y && mouse_pos.y < win_pos.y + m_window_height) {
335 // Uncomment if imgui window focus is needed on hover. I cant find any case.
336 //ImGui::SetNextWindowFocus();
337 set_hovered();
338 }
339
340 // color change based on fading out
341 if (m_state == EState::FadingOut) {
342 push_style_color(ImGuiCol_WindowBg, ImGui::GetStyleColorVec4(ImGuiCol_WindowBg), true, m_current_fade_opacity);
343 push_style_color(ImGuiCol_Text, ImGui::GetStyleColorVec4(ImGuiCol_Text), true, m_current_fade_opacity);
344 push_style_color(ImGuiCol_ButtonHovered, ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered), true, m_current_fade_opacity);
345 fading_pop = true;
346 }
347
348 bool bgrnd_color_pop = push_background_color();
349
350 // name of window indentifies window - has to be unique string
351 if (m_id == 0)
352 m_id = m_id_provider.allocate_id();
353 std::string name = "!!Ntfctn" + std::to_string(m_id);
354
356
357 int window_flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse;
358 if (imgui.begin(name, window_flags)) {
359 ImVec2 win_size = ImGui::GetWindowSize();
360
361 bbl_render_left_sign(imgui, win_size.x, win_size.y, win_pos.x, win_pos.y);
362 render_left_sign(imgui);
363 render_text(imgui, win_size.x, win_size.y, win_pos.x, win_pos.y);
364 m_minimize_b_visible = false;
365 if (m_multiline && m_lines_count > 3)
366 render_minimize_button(imgui, win_pos.x, win_pos.y);
367 render_close_button(imgui, win_size.x, win_size.y, win_pos.x, win_pos.y); // ORCA draw it after minimize button since its position related to minimize button
368 }
369
370 const bool gcode_window_visible = canvas.get_canvas_type() == GLCanvas3D::ECanvasType::CanvasPreview && wxGetApp().show_gcode_window();
371 if (!gcode_window_visible)
372 {
373 ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow());
374 }
375
376 imgui.end();
377
379
380 if (bgrnd_color_pop)
381 ImGui::PopStyleColor();
382
383 if (fading_pop)
384 ImGui::PopStyleColor(3);
385}
@ CanvasPreview
Definition GLCanvas3D.hpp:627
virtual void render_left_sign(ImGuiWrapper &imgui)
Definition NotificationManager.cpp:1000
virtual void render_minimize_button(ImGuiWrapper &imgui, const float win_pos_x, const float win_pos_y)
Definition NotificationManager.cpp:1016
virtual void render_text(ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
Definition NotificationManager.cpp:710
bool m_minimize_b_visible
Definition NotificationManager.hpp:664
virtual void render_close_button(ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
Definition NotificationManager.cpp:858
virtual void bbl_render_left_sign(ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
Definition NotificationManager.cpp:984

References bbl_render_left_sign(), Slic3r::GUI::ImGuiWrapper::begin(), Slic3r::GUI::GLCanvas3D::CanvasPreview, ClosePending, Slic3r::GUI::ImGuiWrapper::end(), FadingOut, Finished, GAP_WIDTH, Slic3r::GUI::GLCanvas3D::get_canvas_size(), Slic3r::GUI::GLCanvas3D::get_canvas_type(), Slic3r::GUI::Size::get_height(), Slic3r::GUI::Size::get_width(), Hidden, Hovered, Slic3r::GUI::NotificationManager::init(), m_current_fade_opacity, m_id, m_id_provider, m_line_height, m_lines_count, m_minimize_b_visible, m_multiline, m_state, m_top_y, m_window_height, m_window_width, push_background_color(), render_close_button(), render_left_sign(), render_minimize_button(), render_text(), restore_default_theme(), set_hovered(), Slic3r::GUI::ImGuiWrapper::set_next_window_pos(), Slic3r::GUI::ImGuiWrapper::set_next_window_size(), set_next_window_size(), Unknown, and use_bbl_theme().

Here is the call graph for this function:

◆ render_close_button()

void Slic3r::GUI::NotificationManager::HintNotification::render_close_button ( ImGuiWrapper & imgui,
const float win_size_x,
const float win_size_y,
const float win_pos_x,
const float win_pos_y )
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::NotificationManager::PopNotification.

971{
972 ImVec2 win_size(win_size_x, win_size_y);
973 ImVec2 win_pos(win_pos_x, win_pos_y);
974 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
975 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
976 push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
977 push_style_color(ImGuiCol_TextSelectedBg, ImVec4(0, .75f, .75f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
978 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f));
979
980
981 std::wstring button_text;
982 button_text = m_is_dark ? ImGui::CloseNotifDarkButton : ImGui::CloseNotifButton;
983
984 ImVec2 button_pic_size = ImGui::CalcTextSize(into_u8(button_text).c_str());
985 ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
986 m_close_b_w = button_size.y;
987 if (ImGui::IsMouseHoveringRect(ImVec2(win_pos.x - win_size.x / 10.f, win_pos.y + win_size.y / 2 - button_pic_size.y),
988 ImVec2(win_pos.x, win_pos.y + win_size.y / 2 + button_pic_size.y),
989 true))
990 {
991 button_text = m_is_dark ? ImGui::CloseNotifHoverDarkButton : ImGui::CloseNotifHoverButton;
992 if (ImGui::IsMouseClicked(ImGuiMouseButton_Left))
993 close();
994 }
995 ImGui::SetCursorPosX(win_size.x - m_line_height * 2.75f);
996 ImGui::SetCursorPosY(win_size.y / 2 - button_size.y);
997 if (imgui.button(button_text.c_str(), button_size.x, button_size.y))
998 {
999 close();
1000 }
1001
1002
1003 ImGui::PopStyleColor(5);
1004
1005
1006 render_right_arrow_button(imgui, win_size_x, win_size_y, win_pos_x, win_pos_y);
1007 //render_logo(imgui, win_size_x, win_size_y, win_pos_x, win_pos_y);
1008 render_preferences_button(imgui, win_pos_x, win_pos_y);
1009 if (!m_documentation_link.empty() && wxGetApp().app_config->get("suppress_hyperlinks") != "1")
1010 {
1011 render_documentation_button(imgui, win_size_x, win_size_y, win_pos_x, win_pos_y);
1012 }
1013
1014}
void render_documentation_button(ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
Definition HintNotification.cpp:1108
float m_close_b_w
Definition HintNotification.hpp:136
void render_right_arrow_button(ImGuiWrapper &imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
Definition HintNotification.cpp:1056
void render_preferences_button(ImGuiWrapper &imgui, const float win_pos_x, const float win_pos_y)
Definition HintNotification.cpp:1016

References Slic3r::GUI::ImGuiWrapper::button(), Slic3r::GUI::NotificationManager::PopNotification::close(), Slic3r::GUI::NotificationManager::PopNotification::FadingOut, Slic3r::GUI::into_u8(), m_close_b_w, Slic3r::GUI::NotificationManager::PopNotification::m_current_fade_opacity, m_documentation_link, Slic3r::GUI::NotificationManager::PopNotification::m_is_dark, Slic3r::GUI::NotificationManager::PopNotification::m_line_height, Slic3r::GUI::NotificationManager::PopNotification::m_state, render_documentation_button(), render_preferences_button(), and render_right_arrow_button().

Here is the call graph for this function:

◆ render_documentation_button()

void Slic3r::GUI::NotificationManager::HintNotification::render_documentation_button ( ImGuiWrapper & imgui,
const float win_size_x,
const float win_size_y,
const float win_pos_x,
const float win_pos_y )
protected
1109{
1110 auto scale = wxGetApp().plater()->get_current_canvas3D()->get_scale();
1111 ImVec2 win_size(win_size_x, win_size_y);
1112 ImVec2 win_pos(win_pos_x, win_pos_y);
1113 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
1114 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
1115 push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
1116 push_style_color(ImGuiCol_TextSelectedBg, ImVec4(0, .75f, .75f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
1117 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f));
1118
1119 std::wstring button_text;
1120 button_text = m_is_dark ? ImGui::DocumentationDarkButton : ImGui::DocumentationButton;
1121 std::string placeholder_text;
1122 placeholder_text = ImGui::EjectButton;
1123
1124 ImVec2 button_pic_size = ImGui::CalcTextSize(placeholder_text.c_str());
1125 ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
1126 if (ImGui::IsMouseHoveringRect(ImVec2(win_pos.x - m_line_height * 5.f, win_pos.y + win_size.y / 2 - button_pic_size.y),
1127 ImVec2(win_pos.x - m_line_height * 2.5f, win_pos.y + win_size.y / 2 + button_pic_size.y),
1128 true))
1129 {
1130 button_text = m_is_dark ? ImGui::DocumentationHoverDarkButton : ImGui::DocumentationHoverButton;
1131 // tooltip
1132 ImGui::PushStyleColor(ImGuiCol_PopupBg, ImGuiWrapper::COL_WINDOW_BACKGROUND);
1133 ImGui::PushStyleColor(ImGuiCol_Border, { 0,0,0,0 });
1134 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 8 * scale, 1 * scale });
1135 ImGui::BeginTooltip();
1136 imgui.text(_u8L("Open documentation in web browser"));
1137 ImGui::EndTooltip();
1138 ImGui::PopStyleColor(2);
1139 ImGui::PopStyleVar();
1140 if (ImGui::IsMouseClicked(ImGuiMouseButton_Left))
1142 }
1143 ImGui::SetCursorPosX(win_size.x - m_line_height * 5.0f);
1144 ImGui::SetCursorPosY(win_size.y / 2 - button_size.y);
1145 if (imgui.button(button_text.c_str(), button_size.x, button_size.y))
1146 {
1148 }
1149
1150 ImGui::PopStyleColor(5);
1151}
int scale(const int val)
Definition WipeTowerDialog.cpp:58
static const ImVec4 COL_WINDOW_BACKGROUND
Definition ImGuiWrapper.hpp:388
void open_documentation()
Definition HintNotification.cpp:1153

References _u8L, Slic3r::GUI::ImGuiWrapper::button(), Slic3r::GUI::ImGuiWrapper::COL_WINDOW_BACKGROUND, Slic3r::GUI::NotificationManager::PopNotification::FadingOut, Slic3r::GUI::NotificationManager::PopNotification::m_current_fade_opacity, Slic3r::GUI::NotificationManager::PopNotification::m_is_dark, Slic3r::GUI::NotificationManager::PopNotification::m_line_height, Slic3r::GUI::NotificationManager::PopNotification::m_state, open_documentation(), scale(), and Slic3r::GUI::ImGuiWrapper::text().

Referenced by render_close_button().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_hyperlink_action()

void Slic3r::GUI::NotificationManager::PopNotification::render_hyperlink_action ( ImGuiWrapper & imgui,
float text_x,
float text_y,
const std::string & text,
const char * button_id,
const std::function< void()> & on_click )
protectedinherited
824{
825 // Invisible button over the label
826 ImVec2 part_size = ImGui::CalcTextSize(text.c_str());
827 ImGui::SetCursorPosX(text_x - 4);
828 ImGui::SetCursorPosY(text_y - 5);
829 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
830 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
831 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f));
832 if (imgui.button(button_id, part_size.x + 6, part_size.y + 10) && on_click)
833 on_click();
834 ImGui::PopStyleColor(3);
835
836 // Hover color
837 ImVec4 color = m_HyperTextColor;
838 if (ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly))
839 color = m_HyperTextColorHover;
840
841 // Text
843 ImGui::SetCursorPosX(text_x);
844 ImGui::SetCursorPosY(text_y);
845 imgui.text(text.c_str());
846 ImGui::PopStyleColor();
847
848 // Underline
849 ImVec2 lineEnd = ImGui::GetItemRectMax();
850 lineEnd.y -= 2;
851 ImVec2 lineStart = lineEnd;
852 lineStart.x = ImGui::GetItemRectMin().x;
853 ImGui::GetWindowDrawList()->AddLine(lineStart, lineEnd,
854 IM_COL32((int)(color.x * 255), (int)(color.y * 255), (int)(color.z * 255),
855 (int)(color.w * 255.f * (m_state == EState::FadingOut ? m_current_fade_opacity : 1.f))));
856}
ImVec4 m_HyperTextColorHover
Definition NotificationManager.hpp:599
ImVec4 m_HyperTextColor
Definition NotificationManager.hpp:598

References Slic3r::GUI::ImGuiWrapper::button(), FadingOut, m_current_fade_opacity, m_HyperTextColor, m_HyperTextColorHover, m_state, and Slic3r::GUI::ImGuiWrapper::text().

Referenced by Slic3r::GUI::NotificationManager::SharedProfilesNotification::render_hypertext(), Slic3r::GUI::NotificationManager::OrcaSyncConflictNotification::render_text(), and Slic3r::GUI::NotificationManager::PluginMissingNotification::render_text().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_hypertext()

void Slic3r::GUI::NotificationManager::PopNotification::render_hypertext ( ImGuiWrapper & imgui,
const float text_x,
const float text_y,
const std::string text,
bool more = false )
protectedvirtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::SharedProfilesNotification.

763{
764 //invisible button
765 ImVec2 part_size = ImGui::CalcTextSize(text.c_str());
766 ImGui::SetCursorPosX(text_x -4);
767 ImGui::SetCursorPosY(text_y -5);
768 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.4f, .4f, .4f, 0.0f));
769 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.5f, .5f, .5f, 0.0f));
770 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.7f, .7f, .7f, 0.0f));
771 if (imgui.button(" ", part_size.x + 6, part_size.y + 10))
772 {
773 if (more)
774 {
775 m_multiline = true;
777 }
778 else if (on_text_click()) {
779 close();
780 }
781 }
782 ImGui::PopStyleColor(3);
783
784 //hover color
785 ImVec4 HyperColor = m_HyperTextColor;//ImVec4(150.f / 255.f, 100.f / 255.f, 0.f / 255.f, 1)
787 HyperColor = ImVec4(0.f, 0.f, 0.f, 0.4f);
789 HyperColor = ImVec4(135.f / 255.f, 43 / 255.f, 43 / 255.f, 1);
790 if (ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly))
791 {
793 HyperColor.y += 0.1f;
794 HyperColor.x += 0.2f;
795 }
797 HyperColor.y += 0.1f;
798 }
799 else {
800 HyperColor = m_HyperTextColorHover;
801 }
802 }
803
804 //text
806 ImGui::SetCursorPosX(text_x);
807 ImGui::SetCursorPosY(text_y);
808 imgui.text(text.c_str());
809 ImGui::PopStyleColor();
810
811 //underline
812 ImVec2 lineEnd = ImGui::GetItemRectMax();
813 lineEnd.y -= 2;
814 ImVec2 lineStart = lineEnd;
815 lineStart.x = ImGui::GetItemRectMin().x;
816 ImGui::GetWindowDrawList()->AddLine(lineStart, lineEnd,
817 IM_COL32((int) (HyperColor.x * 255), (int) (HyperColor.y * 255), (int) (HyperColor.z * 255),
818 (int) (HyperColor.w * 255.f * (m_state == EState::FadingOut ? m_current_fade_opacity : 1.f))));
819
820}
virtual bool on_text_click()
Definition NotificationManager.cpp:1047

References Slic3r::GUI::ImGuiWrapper::button(), close(), Slic3r::GUI::NotificationManager::ErrorNotificationLevel, FadingOut, m_current_fade_opacity, m_data, m_HyperTextColor, m_HyperTextColorHover, m_multiline, m_state, on_text_click(), Slic3r::GUI::NotificationManager::SeriousWarningNotificationLevel, set_next_window_size(), and Slic3r::GUI::ImGuiWrapper::text().

Referenced by bbl_render_block_notif_text(), Slic3r::GUI::NotificationManager::SharedProfilesNotification::render_hypertext(), Slic3r::GUI::NotificationManager::ExportFinishedNotification::render_text(), Slic3r::GUI::NotificationManager::HintNotification::render_text(), and render_text().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_left_sign()

void Slic3r::GUI::NotificationManager::PopNotification::render_left_sign ( ImGuiWrapper & imgui)
protectedvirtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::PrintHostUploadNotification.

1001{
1002 //if (m_data.level == NotificationLevel::ErrorNotificationLevel || m_data.level == NotificationLevel::WarningNotificationLevel) {
1003 // std::string text;
1004 // text = (m_data.level == NotificationLevel::ErrorNotificationLevel ? ImGui::ErrorMarker : ImGui::WarningMarker);
1005 // ImGui::SetCursorPosX(m_line_height / 3);
1006 // ImGui::SetCursorPosY(m_window_height / 2 - m_line_height);
1007 // imgui.text(text.c_str());
1008 //} else if (m_data.level == NotificationLevel::PrintInfoNotificationLevel || m_data.level == NotificationLevel::PrintInfoShortNotificationLevel) {
1009 // std::wstring text;
1010 // text = ImGui::InfoMarker;
1011 // ImGui::SetCursorPosX(m_line_height / 3);
1012 // ImGui::SetCursorPosY(m_window_height / 2 - m_line_height);
1013 // imgui.text(text.c_str());
1014 //}
1015}

Referenced by render().

Here is the caller graph for this function:

◆ render_logo()

void Slic3r::GUI::NotificationManager::HintNotification::render_logo ( ImGuiWrapper & imgui,
const float win_size_x,
const float win_size_y,
const float win_pos_x,
const float win_pos_y )
protected
1098{
1099 //std::string placeholder_text;
1100 //placeholder_text = ImGui::EjectButton;
1101 //ImVec2 button_pic_size = ImGui::CalcTextSize(placeholder_text.c_str());
1102 //std::wstring text;
1103 //text = ImGui::ClippyMarker;
1104 //ImGui::SetCursorPosX(button_pic_size.x / 3);
1105 //ImGui::SetCursorPosY(win_size_y / 2 - button_pic_size.y * 2.f);
1106 //imgui.text(text.c_str());
1107}

◆ render_minimize_button()

virtual void Slic3r::GUI::NotificationManager::HintNotification::render_minimize_button ( ImGuiWrapper & imgui,
const float win_pos_x,
const float win_pos_y )
inlineoverrideprotectedvirtual

◆ render_preferences_button()

void Slic3r::GUI::NotificationManager::HintNotification::render_preferences_button ( ImGuiWrapper & imgui,
const float win_pos_x,
const float win_pos_y )
protected
1017{
1018 auto scale = wxGetApp().plater()->get_current_canvas3D()->get_scale();
1019 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
1020 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
1021 push_style_color(ImGuiCol_ButtonActive, ImGui::GetStyleColorVec4(ImGuiCol_WindowBg), m_state == EState::FadingOut, m_current_fade_opacity);
1022 push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
1023 push_style_color(ImGuiCol_TextSelectedBg, ImVec4(0, .75f, .75f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
1024
1025 std::wstring button_text;
1026 button_text = m_is_dark ? ImGui::PreferencesDarkButton : ImGui::PreferencesButton;
1027 //hover
1028 if (ImGui::IsMouseHoveringRect(ImVec2(win_pos_x - m_window_width / 15.f, win_pos_y + m_window_height - 1.5f * m_line_height),
1029 ImVec2(win_pos_x, win_pos_y + m_window_height),
1030 true)) {
1031 button_text = m_is_dark ? ImGui::PreferencesHoverDarkButton : ImGui::PreferencesHoverButton;
1032 // tooltip
1033 ImGui::PushStyleColor(ImGuiCol_PopupBg, ImGuiWrapper::COL_WINDOW_BACKGROUND);
1034 ImGui::PushStyleColor(ImGuiCol_Border, { 0,0,0,0 });
1035 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 8 * scale, 1 * scale });
1036 ImGui::BeginTooltip();
1037 imgui.text(_u8L("Open Preferences"));
1038 ImGui::EndTooltip();
1039 ImGui::PopStyleColor(2);
1040 ImGui::PopStyleVar();
1041 }
1042
1043 ImVec2 button_pic_size = ImGui::CalcTextSize(into_u8(button_text).c_str());
1044 ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
1045 ImGui::SetCursorPosX(m_window_width - m_line_height * 1.75f);
1046 ImGui::SetCursorPosY(m_window_height - button_size.y - m_close_b_w / 4.f);
1047 if (imgui.button(button_text.c_str(), button_size.x, button_size.y))
1048 {
1049 wxGetApp().open_preferences();
1050 }
1051
1052 ImGui::PopStyleColor(5);
1053 // preferences button is in place of minimize button
1054 m_minimize_b_visible = true;
1055}

References _u8L, Slic3r::GUI::ImGuiWrapper::button(), Slic3r::GUI::ImGuiWrapper::COL_WINDOW_BACKGROUND, Slic3r::GUI::NotificationManager::PopNotification::FadingOut, Slic3r::GUI::into_u8(), m_close_b_w, Slic3r::GUI::NotificationManager::PopNotification::m_current_fade_opacity, Slic3r::GUI::NotificationManager::PopNotification::m_is_dark, Slic3r::GUI::NotificationManager::PopNotification::m_line_height, Slic3r::GUI::NotificationManager::PopNotification::m_minimize_b_visible, Slic3r::GUI::NotificationManager::PopNotification::m_state, Slic3r::GUI::NotificationManager::PopNotification::m_window_height, Slic3r::GUI::NotificationManager::PopNotification::m_window_width, scale(), and Slic3r::GUI::ImGuiWrapper::text().

Referenced by render_close_button().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_right_arrow_button()

void Slic3r::GUI::NotificationManager::HintNotification::render_right_arrow_button ( ImGuiWrapper & imgui,
const float win_size_x,
const float win_size_y,
const float win_pos_x,
const float win_pos_y )
protected
1057{
1058 // Used for debuging
1059 auto scale = wxGetApp().plater()->get_current_canvas3D()->get_scale();
1060 ImVec2 win_size(win_size_x, win_size_y);
1061 ImVec2 win_pos(win_pos_x, win_pos_y);
1062 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
1063 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
1064 push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
1065 push_style_color(ImGuiCol_TextSelectedBg, ImVec4(0, .75f, .75f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
1066 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f));
1067
1068 std::wstring button_text;
1069 button_text = m_is_dark ? ImGui::RightArrowDarkButton : ImGui::RightArrowButton;
1070
1071 ImVec2 button_pic_size = ImGui::CalcTextSize(into_u8(button_text).c_str());
1072 ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
1073 if (ImGui::IsMouseHoveringRect(ImVec2(win_pos_x - m_window_width / 7.5f, win_pos_y + m_window_height - 1.5f * m_line_height),
1074 ImVec2(win_pos_x - m_window_width / 15.f, win_pos_y + m_window_height),
1075 true))
1076 {
1077 button_text = m_is_dark ? ImGui::RightArrowHoverDarkButton : ImGui::RightArrowHoverButton;
1078 // tooltip
1079 ImGui::PushStyleColor(ImGuiCol_PopupBg, ImGuiWrapper::COL_WINDOW_BACKGROUND);
1080 ImGui::PushStyleColor(ImGuiCol_Border, { 0,0,0,0 });
1081 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 8 * scale, 1 * scale });
1082 ImGui::BeginTooltip();
1083 imgui.text(_u8L("Open next tip"));
1084 ImGui::EndTooltip();
1085 ImGui::PopStyleColor(2);
1086 ImGui::PopStyleVar();
1087 }
1088 ImGui::SetCursorPosX(m_window_width - m_line_height * 3.f);
1089 ImGui::SetCursorPosY(m_window_height - button_size.y - m_close_b_w / 4.f);
1090 if (imgui.button(button_text.c_str(), button_size.x * 0.8f, button_size.y * 1.f))
1091 {
1092 retrieve_data();
1093 }
1094
1095 ImGui::PopStyleColor(5);
1096}

References _u8L, Slic3r::GUI::ImGuiWrapper::button(), Slic3r::GUI::ImGuiWrapper::COL_WINDOW_BACKGROUND, Slic3r::GUI::NotificationManager::PopNotification::FadingOut, Slic3r::GUI::into_u8(), m_close_b_w, Slic3r::GUI::NotificationManager::PopNotification::m_current_fade_opacity, Slic3r::GUI::NotificationManager::PopNotification::m_is_dark, Slic3r::GUI::NotificationManager::PopNotification::m_line_height, Slic3r::GUI::NotificationManager::PopNotification::m_state, Slic3r::GUI::NotificationManager::PopNotification::m_window_height, Slic3r::GUI::NotificationManager::PopNotification::m_window_width, retrieve_data(), scale(), and Slic3r::GUI::ImGuiWrapper::text().

Referenced by render_close_button().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ render_text()

void Slic3r::GUI::NotificationManager::HintNotification::render_text ( ImGuiWrapper & imgui,
const float win_size_x,
const float win_size_y,
const float win_pos_x,
const float win_pos_y )
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::NotificationManager::PopNotification.

884{
885 if (!m_has_hint_data) {
887 }
888
889 float x_offset = m_left_indentation;
890 int last_end = 0;
891 float starting_y = (/*m_lines_count < 4 ? m_line_height / 2 * (4 - m_lines_count + 1) :*/ m_line_height / 2);
892 float shift_y = m_line_height;
893 std::string line;
894
895 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, m_HyperTextColor);
896 for (size_t i = 0; i < (m_multiline ? /*m_lines_count*/m_endlines.size() : 2); i++) {
897 line.clear();
898 ImGui::SetCursorPosX(x_offset);
899 ImGui::SetCursorPosY(starting_y + i * shift_y);
900 if (m_endlines.size() > i && m_text1.size() >= m_endlines[i]) {
901 if (i == 1 && m_endlines.size() > 2 && !m_multiline) {
902 // second line with "more" hypertext
903 line = m_text1.substr(m_endlines[0] + (m_text1[m_endlines[0]] == '\n' || m_text1[m_endlines[0]] == ' ' ? 1 : 0), m_endlines[1] - m_endlines[0] - (m_text1[m_endlines[0]] == '\n' || m_text1[m_endlines[0]] == ' ' ? 1 : 0));
904 while (ImGui::CalcTextSize(line.c_str()).x > m_window_width - m_window_width_offset - ImGui::CalcTextSize((".." + _u8L("More")).c_str()).x) {
905 line = line.substr(0, line.length() - 1);
906 }
907 line += "..";
908 }
909 else {
910 // regural line
911 line = m_text1.substr(last_end, m_endlines[i] - last_end);
912 }
913 // first line is headline (for hint notification it must be divided by \n)
914 if (m_text1.find('\n') >= m_endlines[i]) {
915 line = ImGui::ColorMarkerStart + line + ImGui::ColorMarkerEnd;
916 }
917 // Add ImGui::ColorMarkerStart if there is ImGui::ColorMarkerEnd first (start was at prev line)
918 if (line.find_first_of(ImGui::ColorMarkerEnd) < line.find_first_of(ImGui::ColorMarkerStart)) {
919 line = ImGui::ColorMarkerStart + line;
920 }
921
922 last_end = m_endlines[i];
923 if (m_text1.size() > m_endlines[i])
924 last_end += (m_text1[m_endlines[i]] == '\n' || m_text1[m_endlines[i]] == ' ' ? 1 : 0);
925 imgui.text(line.c_str());
926 }
927
928 }
929 //hyperlink text
930 if (!m_multiline && m_lines_count > 2) {
931 render_hypertext(imgui, x_offset + ImGui::CalcTextSize((line + " ").c_str()).x, starting_y + shift_y, _u8L("More"), true);
932 }
933 else if (!m_hypertext.empty()) {
934 render_hypertext(imgui, x_offset + ImGui::CalcTextSize((line + (line.empty() ? "" : " ")).c_str()).x, starting_y + (m_endlines.size() - 1) * shift_y, m_hypertext);
935 }
936
937 // text2
938 if (!m_text2.empty() && m_multiline) {
939 starting_y += (m_endlines.size() - 1) * shift_y;
940 last_end = 0;
941 for (size_t i = 0; i < (m_multiline ? m_endlines2.size() : 2); i++) {
942 if (i == 0) //first line X is shifted by hypertext
943 ImGui::SetCursorPosX(x_offset + ImGui::CalcTextSize((line + m_hypertext + (line.empty() ? " " : " ")).c_str()).x);
944 else
945 ImGui::SetCursorPosX(x_offset);
946
947 ImGui::SetCursorPosY(starting_y + i * shift_y);
948 line.clear();
949 if (m_endlines2.size() > i && m_text2.size() >= m_endlines2[i]) {
950
951 // regural line
952 line = m_text2.substr(last_end, m_endlines2[i] - last_end);
953
954 // Add ImGui::ColorMarkerStart if there is ImGui::ColorMarkerEnd first (start was at prev line)
955 if (line.find_first_of(ImGui::ColorMarkerEnd) < line.find_first_of(ImGui::ColorMarkerStart)) {
956 line = ImGui::ColorMarkerStart + line;
957 }
958
959 last_end = m_endlines2[i];
960 if (m_text2.size() > m_endlines2[i])
961 last_end += (m_text2[m_endlines2[i]] == '\n' || m_text2[m_endlines2[i]] == ' ' ? 1 : 0);
962 imgui.text(line.c_str());
963 }
964
965 }
966 }
967 ImGui::PopStyleColor(1);
968}
bool m_has_hint_data
Definition HintNotification.hpp:129

References _u8L, Slic3r::GUI::NotificationManager::PopNotification::m_endlines, Slic3r::GUI::NotificationManager::PopNotification::m_endlines2, m_has_hint_data, Slic3r::GUI::NotificationManager::PopNotification::m_hypertext, Slic3r::GUI::NotificationManager::PopNotification::m_HyperTextColor, Slic3r::GUI::NotificationManager::PopNotification::m_left_indentation, Slic3r::GUI::NotificationManager::PopNotification::m_line_height, Slic3r::GUI::NotificationManager::PopNotification::m_lines_count, Slic3r::GUI::NotificationManager::PopNotification::m_multiline, Slic3r::GUI::NotificationManager::PopNotification::m_text1, Slic3r::GUI::NotificationManager::PopNotification::m_text2, Slic3r::GUI::NotificationManager::PopNotification::m_window_width, Slic3r::GUI::NotificationManager::PopNotification::m_window_width_offset, Slic3r::GUI::NotificationManager::PopNotification::render_hypertext(), retrieve_data(), and Slic3r::GUI::ImGuiWrapper::text().

Here is the call graph for this function:

◆ reset_timer()

void Slic3r::GUI::NotificationManager::PopNotification::reset_timer ( )
inlineinherited

References m_notification_start, m_state, Shown, and Slic3r::GUI::GLCanvas3D::timestamp_now().

Here is the call graph for this function:

◆ restore_default_theme()

void Slic3r::GUI::NotificationManager::PopNotification::restore_default_theme ( )
protectedinherited
280{
281 ImGuiStyle &OldStyle = ImGui::GetStyle();
282
283 OldStyle.WindowPadding = m_DefaultTheme.mWindowPadding;
284 OldStyle.WindowRounding = m_DefaultTheme.mWindowRound;
285
286 ImGui::PopStyleColor(3);
287 ImGui::PopStyleVar();
288 //OldStyle.Colors[ImGuiCol_WindowBg] = m_DefaultTheme.mWindowBkg;
289 // OldStyle.Colors[ImGuiCol_Text] = m_DefaultTheme.mTextColor;
290 // OldStyle.Colors[ImGuiCol_Border] = m_DefaultTheme.mBorderColor;
291}
ImGUITheme m_DefaultTheme
Definition NotificationManager.hpp:593

References m_DefaultTheme.

Referenced by bbl_render_block_notification(), render(), and Slic3r::GUI::NotificationManager::SlicingProgressNotification::render().

Here is the caller graph for this function:

◆ retrieve_data()

void Slic3r::GUI::NotificationManager::HintNotification::retrieve_data ( bool new_hint = true)
protected
1161{
1163 if (hint_data == nullptr)
1164 close();
1165
1166 if (hint_data != nullptr)
1167 {
1168 NotificationData nd{ NotificationType::DidYouKnowHint,
1170 0,
1171 hint_data->text,
1172 hint_data->hypertext, nullptr,
1173 hint_data->follow_text };
1174 m_hypertext_callback = hint_data->callback;
1175 m_disabled_tags = hint_data->disabled_tags;
1176 m_enabled_tags = hint_data->enabled_tags;
1177 m_runtime_disable = hint_data->runtime_disable;
1178 m_documentation_link = hint_data->documentation_link;
1179 m_has_hint_data = true;
1180 update(nd);
1181 }
1182}
HintData * get_hint(HintDataNavigation nav)
Definition HintNotification.cpp:505
static HintDatabase & get_instance()
Definition HintNotification.hpp:44
void update(const NotificationData &n)
Definition NotificationManager.cpp:1053
@ HintNotificationLevel
Definition NotificationManager.hpp:214
@ DidYouKnowHint
Definition NotificationManager.hpp:137
@ Next
Definition HintNotification.hpp:37
@ Curr
Definition HintNotification.hpp:35

References Slic3r::GUI::HintData::callback, Slic3r::GUI::NotificationManager::PopNotification::close(), Slic3r::GUI::Curr, Slic3r::GUI::DidYouKnowHint, Slic3r::GUI::HintData::disabled_tags, Slic3r::GUI::HintData::documentation_link, Slic3r::GUI::HintData::enabled_tags, Slic3r::GUI::HintData::follow_text, Slic3r::GUI::HintDatabase::get_hint(), Slic3r::GUI::HintDatabase::get_instance(), Slic3r::GUI::NotificationManager::HintNotificationLevel, Slic3r::GUI::HintData::hypertext, m_disabled_tags, m_documentation_link, m_enabled_tags, m_has_hint_data, m_hypertext_callback, m_runtime_disable, Slic3r::GUI::Next, Slic3r::GUI::HintData::runtime_disable, Slic3r::GUI::HintData::text, and Slic3r::GUI::NotificationManager::PopNotification::update().

Referenced by HintNotification(), open_next(), render_right_arrow_button(), and render_text().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_delete_callback()

void Slic3r::GUI::NotificationManager::PopNotification::set_delete_callback ( DeleteCallback callback)
inherited
225{
226 m_on_delete_callback =callback;
227}

References m_on_delete_callback.

◆ set_gray()

void Slic3r::GUI::NotificationManager::PopNotification::set_gray ( bool g)
inlineinherited
509{ m_is_gray = g; }

References m_is_gray.

◆ set_hovered()

void Slic3r::GUI::NotificationManager::PopNotification::set_hovered ( )
inlineinherited

References ClosePending, Finished, Hidden, Hovered, m_state, and Unknown.

Referenced by bbl_render_block_notification(), render(), and Slic3r::GUI::NotificationManager::SlicingProgressNotification::render().

Here is the caller graph for this function:

◆ set_Multiline()

void Slic3r::GUI::NotificationManager::PopNotification::set_Multiline ( bool Multi)
inlineinherited
520{ m_multiline = Multi; }

References m_multiline.

◆ set_next_window_size()

void Slic3r::GUI::NotificationManager::HintNotification::set_next_window_size ( ImGuiWrapper & imgui)
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::NotificationManager::PopNotification.

865{
866 /*
867 m_window_height = m_multiline ?
868 (m_lines_count + 1.f) * m_line_height :
869 4.f * m_line_height;
870 m_window_height += 1 * m_line_height; // top and bottom
871 */
872
873 m_window_height = std::max((m_lines_count + 1.f) * m_line_height, 5.f * m_line_height);
874}

References Slic3r::GUI::NotificationManager::PopNotification::m_line_height, Slic3r::GUI::NotificationManager::PopNotification::m_lines_count, and Slic3r::GUI::NotificationManager::PopNotification::m_window_height.

◆ set_scale()

void Slic3r::GUI::NotificationManager::PopNotification::set_scale ( float scale)
inlineinherited
522{ m_scale = scale; }
float m_scale
Definition NotificationManager.hpp:669

References m_scale, and scale().

Here is the call graph for this function:

◆ update()

void Slic3r::GUI::NotificationManager::PopNotification::update ( const NotificationData & n)
inherited
1054{
1055 m_text1 = n.text1;
1056 m_hypertext = n.hypertext;
1057 m_text2 = n.text2;
1058 const_cast<NotificationData&>(m_data).callback = n.callback;
1059 init();
1060}

References Slic3r::GUI::NotificationManager::NotificationData::callback, Slic3r::GUI::NotificationManager::NotificationData::hypertext, Slic3r::GUI::NotificationManager::init(), m_data, m_hypertext, m_text1, m_text2, Slic3r::GUI::NotificationManager::NotificationData::text1, and Slic3r::GUI::NotificationManager::NotificationData::text2.

Referenced by Slic3r::GUI::NotificationManager::UpdatedItemsInfoNotification::add_type(), Slic3r::GUI::NotificationManager::ExportFinishedNotification::on_eject_click(), Slic3r::GUI::NotificationManager::HintNotification::retrieve_data(), Slic3r::GUI::NotificationManager::ProgressIndicatorNotification::set_status_text(), and Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_status_text().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_state()

bool Slic3r::GUI::NotificationManager::PopNotification::update_state ( bool paused,
const int64_t delta )
virtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::ProgressIndicatorNotification, and Slic3r::GUI::NotificationManager::SlicingProgressNotification.

1090{
1091
1092 m_next_render = std::numeric_limits<int64_t>::max();
1093
1094 if (m_state == EState::Unknown) {
1095 init();
1096 return true;
1097 }
1098
1099 if (m_state == EState::Hidden) {
1100 return false;
1101 }
1102
1103 int64_t now = GLCanvas3D::timestamp_now();
1104
1105 // reset fade opacity for non-closing notifications or hover during fading
1108 }
1109
1110 // reset timers - hovered state is set in render
1111 if (m_state == EState::Hovered) {
1112 init();
1113 // Timers when not fading
1115 int64_t up_time = now - m_notification_start;
1116 if (up_time >= get_duration() * 1000) {
1118 m_fading_start = now;
1119 } else {
1120 m_next_render = get_duration() * 1000 - up_time;
1121 }
1122 }
1123 // Timers when fading
1124 if (m_state == EState::FadingOut && !paused) {
1125 int64_t curr_time = now - m_fading_start;
1126 int64_t next_render = FADING_OUT_TIMEOUT - delta;
1127 m_current_fade_opacity = std::clamp(1.0f - 0.001f * static_cast<float>(curr_time) / FADING_OUT_DURATION, 0.0f, 1.0f);
1128 if (m_current_fade_opacity <= 0.0f) {
1130 return true;
1131 } else if (next_render <= 20) {
1133 return true;
1134 } else {
1136 return false;
1137 }
1138 }
1139
1140 if (m_state == EState::Finished) {
1141 return true;
1142 }
1143
1146 return true;
1147 }
1148 return false;
1149}
static constexpr int FADING_OUT_TIMEOUT
Definition NotificationManager.cpp:65
static constexpr float FADING_OUT_DURATION
Definition NotificationManager.cpp:63
int64_t m_fading_start
Definition NotificationManager.hpp:617
@ NotFading
Definition NotificationManager.hpp:480
int64_t next_render() const
Definition NotificationManager.hpp:514
virtual int get_duration()
Definition NotificationManager.hpp:571

References ClosePending, FADING_OUT_DURATION, FADING_OUT_TIMEOUT, FadingOut, Finished, get_duration(), Hidden, Hovered, Slic3r::GUI::NotificationManager::init(), m_current_fade_opacity, m_fading_start, m_next_render, m_notification_start, m_state, next_render(), NotFading, Slic3r::GUI::GLCanvas3D::timestamp_now(), and Unknown.

Referenced by Slic3r::GUI::NotificationManager::ProgressIndicatorNotification::update_state(), and Slic3r::GUI::NotificationManager::SlicingProgressNotification::update_state().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ use_bbl_theme()

void Slic3r::GUI::NotificationManager::PopNotification::use_bbl_theme ( )
protectedinherited
237{
239
240 ImGuiStyle &OldStyle = ImGui::GetStyle();
241
242 m_DefaultTheme.mWindowPadding = OldStyle.WindowPadding;
243 m_DefaultTheme.mWindowBkg = OldStyle.Colors[ImGuiCol_WindowBg];
244 m_DefaultTheme.mBorderColor = OldStyle.Colors[ImGuiCol_Border];
245 m_DefaultTheme.mTextColor = OldStyle.Colors[ImGuiCol_Text];
246 m_DefaultTheme.mWindowRound = OldStyle.WindowRounding;
247
248 OldStyle.WindowPadding = ImVec2(0, 0);
249 OldStyle.WindowRounding = m_WindowRadius;
250
255 else {
256 if (m_data.use_warn_color)
258 else
260 }
261
262 //OldStyle.Colors[ImGuiCol_Border] = m_CurrentColor;
263
264 // OldStyle.Colors[ImGuiCol_WindowBg] = m_WindowBkgColor;
265 // OldStyle.Colors[ImGuiCol_Text] = m_TextColor;
266
267 m_WindowBkgColor = m_is_dark ? ImVec4(45 / 255.f, 45 / 255.f, 49 / 255.f, 1.f) : ImVec4(1, 1, 1, 1);
268 m_TextColor = m_is_dark ? ImVec4(224 / 255.f, 224 / 255.f, 224 / 255.f, 1.f) : ImVec4(.2f, .2f, .2f, 1.0f);
269 m_HyperTextColor = m_is_dark ? ImVec4(0, 0.588, 0.533, 1) : ImVec4(0, 0.588, 0.533, 1);
270 m_HyperTextColorHover = m_is_dark ? ImVec4(38.f / 255.f, 166.f / 255.f, 154.f / 255.f, 1) : ImVec4(0.f, 129.f / 255.f, 114.f / 255.f, 1); //#26A69A / #008172;
271
272 m_is_dark ? push_style_color(ImGuiCol_Border, {62 / 255.f, 62 / 255.f, 69 / 255.f, 1.f}, true, m_current_fade_opacity) : push_style_color(ImGuiCol_Border, m_CurrentColor, true, m_current_fade_opacity);
275 ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, m_WindowRadius / 4);
276}
ImVec4 m_WindowBkgColor
Definition NotificationManager.hpp:595
ImVec4 m_TextColor
Definition NotificationManager.hpp:596
ImVec4 m_NormalColor
Definition NotificationManager.hpp:603

References ensure_ui_inited(), Slic3r::GUI::NotificationManager::ErrorNotificationLevel, m_current_fade_opacity, m_CurrentColor, m_data, m_DefaultTheme, m_ErrorColor, m_HyperTextColor, m_HyperTextColorHover, m_is_dark, m_NormalColor, m_TextColor, m_WarnColor, m_WindowBkgColor, m_WindowRadius, and Slic3r::GUI::NotificationManager::WarningNotificationLevel.

Referenced by bbl_render_block_notification(), render(), and Slic3r::GUI::NotificationManager::SlicingProgressNotification::render().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ error_end

std::string Slic3r::GUI::NotificationManager::PopNotification::error_end = "</Error>"
protectedinherited

Referenced by count_lines().

◆ error_start

std::string Slic3r::GUI::NotificationManager::PopNotification::error_start = "<Error>"
protectedinherited

Referenced by count_lines().

◆ m_bottom_y

float Slic3r::GUI::NotificationManager::PopNotification::m_bottom_y { 0.0f }
protectedinherited
652{ 0.0f };

Referenced by get_bottom().

◆ m_close_b_w

float Slic3r::GUI::NotificationManager::HintNotification::m_close_b_w { 0 }
protected

◆ m_close_b_y

float Slic3r::GUI::NotificationManager::HintNotification::m_close_b_y { 0 }
protected
135{ 0 };

◆ m_current_fade_opacity

float Slic3r::GUI::NotificationManager::PopNotification::m_current_fade_opacity { 1.0f }
protectedinherited
623{ 1.0f };

Referenced by bbl_render_block_notif_buttons(), bbl_render_block_notif_text(), bbl_render_block_notification(), bbl_render_left_sign(), push_background_color(), Slic3r::GUI::NotificationManager::PrintHostUploadNotification::push_background_color(), render(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::render(), Slic3r::GUI::NotificationManager::ProgressBarNotification::render_bar(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_bar(), Slic3r::GUI::NotificationManager::PrintHostUploadNotification::render_cancel_button(), Slic3r::GUI::NotificationManager::ProgressIndicatorNotification::render_cancel_button(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_cancel_button(), Slic3r::GUI::NotificationManager::URLDownloadNotification::render_cancel_button_inner(), Slic3r::GUI::NotificationManager::HintNotification::render_close_button(), render_close_button(), Slic3r::GUI::NotificationManager::URLDownloadNotification::render_close_button_inner(), Slic3r::GUI::NotificationManager::HintNotification::render_documentation_button(), Slic3r::GUI::NotificationManager::ExportFinishedNotification::render_eject_button(), render_hyperlink_action(), render_hypertext(), render_minimize_button(), Slic3r::GUI::NotificationManager::URLDownloadNotification::render_open_button_inner(), Slic3r::GUI::NotificationManager::URLDownloadNotification::render_pause_button_inner(), Slic3r::GUI::NotificationManager::HintNotification::render_preferences_button(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_progress_close_button(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_progress_text(), Slic3r::GUI::NotificationManager::HintNotification::render_right_arrow_button(), render_text(), Slic3r::GUI::NotificationManager::SharedProfilesNotification::render_text(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_progress_state(), update_state(), Slic3r::GUI::NotificationManager::ProgressIndicatorNotification::update_state(), and use_bbl_theme().

◆ m_CurrentColor

ImVec4 Slic3r::GUI::NotificationManager::PopNotification::m_CurrentColor
protectedinherited

◆ m_data

◆ m_DefaultTheme

ImGUITheme Slic3r::GUI::NotificationManager::PopNotification::m_DefaultTheme
protectedinherited

◆ m_disabled_tags

std::string Slic3r::GUI::NotificationManager::HintNotification::m_disabled_tags
protected

Referenced by on_text_click(), and retrieve_data().

◆ m_docu_hover_time

long Slic3r::GUI::NotificationManager::HintNotification::m_docu_hover_time { 0 }
protected
138{ 0 };

◆ m_documentation_link

std::string Slic3r::GUI::NotificationManager::HintNotification::m_documentation_link
protected

◆ m_enabled_tags

std::string Slic3r::GUI::NotificationManager::HintNotification::m_enabled_tags
protected

Referenced by on_text_click(), and retrieve_data().

◆ m_endlines

◆ m_endlines2

std::vector<size_t> Slic3r::GUI::NotificationManager::PopNotification::m_endlines2
protectedinherited

◆ m_ErrorColor

ImVec4 Slic3r::GUI::NotificationManager::PopNotification::m_ErrorColor
protectedinherited

◆ m_evt_handler

◆ m_fading_start

int64_t Slic3r::GUI::NotificationManager::PopNotification::m_fading_start { 0LL }
protectedinherited
617{ 0LL };

Referenced by update_state().

◆ m_has_hint_data

bool Slic3r::GUI::NotificationManager::HintNotification::m_has_hint_data { false }
protected
129{ false };

Referenced by render_text(), and retrieve_data().

◆ m_hypertext

◆ m_hypertext_callback

std::function<void(void)> Slic3r::GUI::NotificationManager::HintNotification::m_hypertext_callback
protected

Referenced by on_text_click(), and retrieve_data().

◆ m_HyperTextColor

◆ m_HyperTextColorHover

◆ m_id

int Slic3r::GUI::NotificationManager::PopNotification::m_id { 0 }
protectedinherited

◆ m_id_provider

NotificationIDProvider& Slic3r::GUI::NotificationManager::PopNotification::m_id_provider
protectedinherited

◆ m_is_dark

◆ m_is_dark_inited

bool Slic3r::GUI::NotificationManager::PopNotification::m_is_dark_inited = false
protectedinherited

◆ m_is_gray

bool Slic3r::GUI::NotificationManager::PopNotification::m_is_gray { false }
protectedinherited
660{ false };

Referenced by is_gray(), push_background_color(), and set_gray().

◆ m_left_indentation

◆ m_line_height

float Slic3r::GUI::NotificationManager::PopNotification::m_line_height
protectedinherited

Referenced by bbl_render_block_notif_buttons(), bbl_render_block_notif_left_sign(), bbl_render_block_notif_text(), bbl_render_block_notification(), Slic3r::GUI::NotificationManager::ExportFinishedNotification::count_spaces(), Slic3r::GUI::NotificationManager::HintNotification::count_spaces(), count_spaces(), Slic3r::GUI::NotificationManager::PrintHostUploadNotification::count_spaces(), Slic3r::GUI::NotificationManager::UpdatedItemsInfoNotification::count_spaces(), Slic3r::GUI::NotificationManager::URLDownloadNotification::count_spaces(), render(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::render(), Slic3r::GUI::NotificationManager::PrintHostUploadNotification::render_bar(), Slic3r::GUI::NotificationManager::ProgressBarNotification::render_bar(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_bar(), Slic3r::GUI::NotificationManager::URLDownloadNotification::render_bar(), Slic3r::GUI::NotificationManager::PrintHostUploadNotification::render_cancel_button(), Slic3r::GUI::NotificationManager::ProgressIndicatorNotification::render_cancel_button(), Slic3r::GUI::NotificationManager::URLDownloadNotification::render_cancel_button_inner(), Slic3r::GUI::NotificationManager::HintNotification::render_close_button(), render_close_button(), Slic3r::GUI::NotificationManager::URLDownloadNotification::render_close_button_inner(), Slic3r::GUI::NotificationManager::HintNotification::render_documentation_button(), Slic3r::GUI::NotificationManager::ExportFinishedNotification::render_eject_button(), render_minimize_button(), Slic3r::GUI::NotificationManager::URLDownloadNotification::render_open_button_inner(), Slic3r::GUI::NotificationManager::URLDownloadNotification::render_pause_button_inner(), Slic3r::GUI::NotificationManager::HintNotification::render_preferences_button(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_progress_text(), Slic3r::GUI::NotificationManager::HintNotification::render_right_arrow_button(), Slic3r::GUI::NotificationManager::ExportFinishedNotification::render_text(), Slic3r::GUI::NotificationManager::HintNotification::render_text(), Slic3r::GUI::NotificationManager::OrcaSyncConflictNotification::render_text(), Slic3r::GUI::NotificationManager::PluginMissingNotification::render_text(), render_text(), Slic3r::GUI::NotificationManager::ProgressBarNotification::render_text(), Slic3r::GUI::NotificationManager::SharedProfilesNotification::render_text(), Slic3r::GUI::NotificationManager::HintNotification::set_next_window_size(), and set_next_window_size().

◆ m_lines_count

◆ m_minimize_b_visible

◆ m_multiline

◆ m_next_render

int64_t Slic3r::GUI::NotificationManager::PopNotification::m_next_render { std::numeric_limits<int64_t>::max() }
protectedinherited

◆ m_NormalColor

ImVec4 Slic3r::GUI::NotificationManager::PopNotification::m_NormalColor
protectedinherited

◆ m_notification_start

int64_t Slic3r::GUI::NotificationManager::PopNotification::m_notification_start
protectedinherited

◆ m_on_delete_callback

DeleteCallback Slic3r::GUI::NotificationManager::PopNotification::m_on_delete_callback
protectedinherited

◆ m_prefe_hover_time

long Slic3r::GUI::NotificationManager::HintNotification::m_prefe_hover_time { 0 }
protected
139{ 0 };

◆ m_runtime_disable

bool Slic3r::GUI::NotificationManager::HintNotification::m_runtime_disable
protected

Referenced by on_text_click(), and retrieve_data().

◆ m_scale

float Slic3r::GUI::NotificationManager::PopNotification::m_scale = 1.0f
protectedinherited

Referenced by set_scale().

◆ m_state

EState Slic3r::GUI::NotificationManager::PopNotification::m_state { EState::Unknown }
protectedinherited

Referenced by Slic3r::GUI::NotificationManager::UpdatedItemsInfoNotification::add_type(), bbl_render_block_notif_buttons(), bbl_render_block_notif_text(), bbl_render_block_notification(), Slic3r::GUI::NotificationManager::PlaterWarningNotification::close(), close(), get_state(), hide(), Slic3r::GUI::NotificationManager::HintNotification::init(), init(), Slic3r::GUI::NotificationManager::PrintHostUploadNotification::init(), Slic3r::GUI::NotificationManager::ProgressBarNotification::init(), Slic3r::GUI::NotificationManager::ProgressIndicatorNotification::init(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::init(), is_finished(), is_hovered(), push_background_color(), Slic3r::GUI::NotificationManager::PrintHostUploadNotification::push_background_color(), Slic3r::GUI::NotificationManager::PlaterWarningNotification::real_close(), reinit(), render(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::render(), Slic3r::GUI::NotificationManager::PrintHostUploadNotification::render_cancel_button(), Slic3r::GUI::NotificationManager::ProgressIndicatorNotification::render_cancel_button(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_cancel_button(), Slic3r::GUI::NotificationManager::URLDownloadNotification::render_cancel_button_inner(), Slic3r::GUI::NotificationManager::HintNotification::render_close_button(), render_close_button(), Slic3r::GUI::NotificationManager::URLDownloadNotification::render_close_button_inner(), Slic3r::GUI::NotificationManager::HintNotification::render_documentation_button(), Slic3r::GUI::NotificationManager::ExportFinishedNotification::render_eject_button(), render_hyperlink_action(), render_hypertext(), render_minimize_button(), Slic3r::GUI::NotificationManager::URLDownloadNotification::render_open_button_inner(), Slic3r::GUI::NotificationManager::URLDownloadNotification::render_pause_button_inner(), Slic3r::GUI::NotificationManager::HintNotification::render_preferences_button(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_progress_close_button(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_progress_text(), Slic3r::GUI::NotificationManager::HintNotification::render_right_arrow_button(), render_text(), Slic3r::GUI::NotificationManager::SharedProfilesNotification::render_text(), reset_timer(), set_hovered(), Slic3r::GUI::NotificationManager::ProgressIndicatorNotification::set_percentage(), Slic3r::GUI::NotificationManager::URLDownloadNotification::set_percentage(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_progress_state(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_sidebar_collapsed(), Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_status_text(), Slic3r::GUI::NotificationManager::PlaterWarningNotification::show(), and update_state().

◆ m_text1

◆ m_text2

std::string Slic3r::GUI::NotificationManager::PopNotification::m_text2
protectedinherited

◆ m_TextColor

ImVec4 Slic3r::GUI::NotificationManager::PopNotification::m_TextColor
protectedinherited

Referenced by PopNotification(), and use_bbl_theme().

◆ m_top_y

float Slic3r::GUI::NotificationManager::PopNotification::m_top_y { 0.0f }
protectedinherited

◆ m_WarnColor

ImVec4 Slic3r::GUI::NotificationManager::PopNotification::m_WarnColor
protectedinherited

◆ m_window_height

◆ m_window_width

◆ m_window_width_offset

◆ m_WindowBkgColor

ImVec4 Slic3r::GUI::NotificationManager::PopNotification::m_WindowBkgColor
protectedinherited

Referenced by PopNotification(), and use_bbl_theme().

◆ m_WindowRadius

float Slic3r::GUI::NotificationManager::PopNotification::m_WindowRadius
protectedinherited

◆ m_WindowRadius_inited

bool Slic3r::GUI::NotificationManager::PopNotification::m_WindowRadius_inited = false
protectedinherited

Referenced by ensure_ui_inited().

◆ pos_end

size_t Slic3r::GUI::NotificationManager::PopNotification::pos_end = std::string::npos
protectedinherited

◆ pos_start

size_t Slic3r::GUI::NotificationManager::PopNotification::pos_start = std::string::npos
protectedinherited

The documentation for this class was generated from the following files: