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

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

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

Public Types

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

Public Member Functions

 SlicingProgressNotification (const NotificationData &n, NotificationIDProvider &id_provider, wxEvtHandler *evt_handler, std::function< bool()> callback)
void set_percentage (float percent)
DailyTipsPanel * get_dailytips_panel ()
SlicingProgressState get_progress_state ()
void set_status_text (const std::string &text)
void set_cancel_callback (std::function< bool()> callback)
bool has_cancel_callback () const
bool set_progress_state (float percent)
bool set_progress_state (SlicingProgressState state, float percent=0.f)
void set_print_info (const std::string &info)
void set_sidebar_collapsed (bool collapsed)
bool update_state (bool paused, const int64_t delta) override
void set_fff (bool b)
void set_export_possible (bool b)
void on_change_color_mode (bool is_dark) override
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)
int64_t next_render () const
EState get_state () const
bool is_hovered () const
void set_hovered ()
void reset_timer ()
void set_Multiline (bool Multi)
void set_scale (float scale)
void set_delete_callback (DeleteCallback)
bool is_valid_delete_callback ()

Protected Member Functions

void init () override
void render (GLCanvas3D &canvas, float initial_y, bool move_from_overlay, float overlay_width, float right_margin) override
void render_progress_text (const ImVec2 &pos)
void render_bar (const ImVec2 &pos, const ImVec2 &size)
void render_cancel_button (const ImVec2 &pos, const ImVec2 &size)
void render_progress_close_button (const ImVec2 &pos, const ImVec2 &size)
void render_dailytips_panel (const ImVec2 &pos, const ImVec2 &size)
void render_show_dailytips (const ImVec2 &pos)
void on_show_dailytips ()
void on_cancel_button ()
int get_duration () override
virtual void set_next_window_size (ImGuiWrapper &imgui)
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)
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)
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 void render_minimize_button (ImGuiWrapper &imgui, const float win_pos_x, const float win_pos_y)
virtual bool on_text_click ()
virtual void count_spaces ()
virtual void count_lines ()
virtual bool push_background_color ()
void ensure_ui_inited ()
void use_bbl_theme ()
void restore_default_theme ()

Protected Attributes

ImVec2 m_window_pos
float m_percentage { 0.0f }
int64_t m_before_complete_start
std::function< bool()> m_cancel_callback
SlicingProgressState m_sp_state { SlicingProgressState::SP_PROGRESS }
bool m_sidebar_collapsed { false }
bool m_export_possible { false }
DailyTipsPanel * m_dailytips_panel { nullptr }
bool m_has_print_info { false }
std::string m_print_info
bool m_is_fff { true }
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

◆ SlicingProgressState

Enumerator
SP_NO_SLICING 
SP_BEGAN 
SP_PROGRESS 
SP_CANCELLED 
SP_COMPLETED 
20 {
21 SP_NO_SLICING, // hidden
22 SP_BEGAN, // still hidden but allows to go to SP_PROGRESS state. This prevents showing progress after slicing was canceled.
23 SP_PROGRESS, // never fades outs, no close button, has cancel button
24 SP_CANCELLED, // fades after 10 seconds, simple message
25 //SP_BEFORE_COMPLETED, // to keep displaying DailyTips for 3 seconds
26 SP_COMPLETED // Has export hyperlink and print info, fades after 20 sec if sidebar is shown, otherwise no fade out
27 };

Constructor & Destructor Documentation

◆ SlicingProgressNotification()

Slic3r::GUI::NotificationManager::SlicingProgressNotification::SlicingProgressNotification ( const NotificationData & n,
NotificationIDProvider & id_provider,
wxEvtHandler * evt_handler,
std::function< bool()> callback )
inline
29 : PopNotification(n, id_provider, evt_handler)
30 , m_cancel_callback(callback)
31 , m_dailytips_panel(new DailyTipsPanel(true, DailyTipsLayout::Vertical))
32 {
34 }
PopNotification(const NotificationData &n, NotificationIDProvider &id_provider, wxEvtHandler *evt_handler)
Definition NotificationManager.cpp:184
bool set_progress_state(float percent)
Definition SlicingProgressNotification.cpp:65
std::function< bool()> m_cancel_callback
Definition SlicingProgressNotification.hpp:77
DailyTipsPanel * m_dailytips_panel
Definition SlicingProgressNotification.hpp:82
@ Vertical
Definition DailyTips.hpp:17

References Slic3r::GUI::NotificationManager::PopNotification::PopNotification(), m_cancel_callback, m_dailytips_panel, set_progress_state(), and SP_NO_SLICING.

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::PopNotification::count_lines ( )
protectedvirtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::HintNotification.

530{
531 std::string text = m_text1;
532 size_t last_end = 0;
533 m_lines_count = 0;
534
535 if (text.empty())
536 return;
537
538 // handle with marks
539 if (pos_start == std::string::npos && pos_end == std::string::npos) {
540 pos_start = text.find(error_start);
541 if (pos_start != std::string::npos) {
542 text.erase(pos_start, error_start.length());
543 pos_end = text.find(error_end);
544 if (pos_end != std::string::npos) {
545 text.erase(pos_end, error_end.length());
546 }
547 }
548 m_text1 = text;
549 }
550
551 m_endlines.clear();
552 while (last_end < text.length())
553 {
554 size_t next_hard_end = text.find_first_of('\n', last_end);
555 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) {
556 //next line is ended by '/n'
557 m_endlines.push_back(next_hard_end);
558 last_end = next_hard_end + 1;
559 }
560 else {
561 // find next suitable endline
562 if (ImGui::CalcTextSize(text.substr(last_end).c_str()).x >= m_window_width - m_window_width_offset) {
563 // more than one line till end
564 size_t next_space = text.find_first_of(' ', last_end);
565 if (next_space > 0 && next_space < text.length()) {
566 size_t next_space_candidate = text.find_first_of(' ', next_space + 1);
567 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) {
568 next_space = next_space_candidate;
569 next_space_candidate = text.find_first_of(' ', next_space + 1);
570 }
571 } else {
572 next_space = text.length();
573 }
574 // when one word longer than line.
575 if (ImGui::CalcTextSize(text.substr(last_end, next_space - last_end).c_str()).x > m_window_width - m_window_width_offset ||
576 ImGui::CalcTextSize(text.substr(last_end, next_space - last_end).c_str()).x < (m_window_width - m_window_width_offset) / 4 * 3
577 ) {
578 //BBS
579 wxString wx_text = from_u8(text.substr(last_end, text.length() - last_end).c_str());
580 float width_of_char = ImGui::CalcTextSize("a").x;
581 int letter_count = (int) ((m_window_width - m_window_width_offset) / width_of_char) / 2; // give a predict value of char count
582 int output_count = 0;
583 while (true) {
584 if (letter_count >= wx_text.size())
585 break;
586 float used_space = ImGui::CalcTextSize(into_u8(wx_text.SubString(0, letter_count)).c_str()).x;
587 if (used_space > m_window_width - m_window_width_offset)
588 break;
589 letter_count++;
590 }
591 if (letter_count > 0) {
592 output_count = into_u8(wx_text.SubString(0, letter_count - 1)).size();
593 }
594 m_endlines.push_back(last_end + output_count);
595 last_end += output_count;
596 } else {
597 m_endlines.push_back(next_space);
598 last_end = next_space + 1;
599 }
600 }
601 else {
602 m_endlines.push_back(text.length());
603 last_end = text.length();
604 }
605
606 }
608 }
609 // hypertext calculation
610 if (!m_hypertext.empty()) {
611 int prev_end = m_endlines.size() > 1 ? m_endlines[m_endlines.size() - 2] : 0; // m_endlines.size() - 2 because we are fitting hypertext instead of last endline
612 if (ImGui::CalcTextSize((escape_string_cstyle(text.substr(prev_end, last_end - prev_end)) + m_hypertext).c_str()).x > m_window_width - m_window_width_offset) {
613 m_endlines.push_back(last_end);
615 }
616 }
617
618 // m_text_2 (text after hypertext) is not used for regular notifications right now.
619 // its caluculation is in HintNotification::count_lines()
620}
std::string error_start
Definition NotificationManager.hpp:636
std::string error_end
Definition NotificationManager.hpp:637
wxString from_u8(const std::string &str)
Definition GUI.cpp:544
std::string escape_string_cstyle(const std::string &str)
Definition Config.cpp:76

References error_end, error_start, Slic3r::escape_string_cstyle(), Slic3r::GUI::from_u8(), Slic3r::GUI::into_u8(), m_endlines, m_hypertext, m_lines_count, m_text1, m_window_width, m_window_width_offset, pos_end, and pos_start.

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::PopNotification::count_spaces ( )
protectedvirtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::ExportFinishedNotification, Slic3r::GUI::NotificationManager::HintNotification, Slic3r::GUI::NotificationManager::PrintHostUploadNotification, Slic3r::GUI::NotificationManager::UpdatedItemsInfoNotification, and Slic3r::GUI::NotificationManager::URLDownloadNotification.

507{
508 //determine line width
509 m_line_height = ImGui::CalcTextSize("A").y;
510
512 //if (m_data.level == NotificationLevel::ErrorNotificationLevel
513 // || m_data.level == NotificationLevel::WarningNotificationLevel
514 // || m_data.level == NotificationLevel::PrintInfoNotificationLevel
515 // || m_data.level == NotificationLevel::PrintInfoShortNotificationLevel) {
516 // std::string text;
517 // text = (m_data.level == NotificationLevel::ErrorNotificationLevel ? ImGui::ErrorMarker : ImGui::WarningMarker);
518 // float picture_width = ImGui::CalcTextSize(text.c_str()).x;
519 // m_left_indentation = picture_width + m_line_height / 2;
520 //}
525 }
527}

References Slic3r::GUI::NotificationManager::ErrorNotificationLevel, m_data, m_left_indentation, m_line_height, m_window_width, m_window_width_offset, and Slic3r::GUI::NotificationManager::SeriousWarningNotificationLevel.

Referenced by Slic3r::GUI::NotificationManager::ExportFinishedNotification::count_spaces(), Slic3r::GUI::NotificationManager::URLDownloadNotification::count_spaces(), and 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_dailytips_panel()

DailyTipsPanel * Slic3r::GUI::NotificationManager::SlicingProgressNotification::get_dailytips_panel ( )
inline
36{ return m_dailytips_panel; }

References m_dailytips_panel.

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

Here is the caller graph for this function:

◆ 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()

int Slic3r::GUI::NotificationManager::SlicingProgressNotification::get_duration ( )
overrideprotectedvirtual

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

184{
186 return 3;
188 return 3;
189 else
190 return 0;
191}
SlicingProgressState m_sp_state
Definition SlicingProgressNotification.hpp:78

References m_sp_state, SP_CANCELLED, and SP_COMPLETED.

◆ get_progress_state()

SlicingProgressState Slic3r::GUI::NotificationManager::SlicingProgressNotification::get_progress_state ( )
inline
37{ return m_sp_state; }

References m_sp_state.

◆ 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:

◆ has_cancel_callback()

bool Slic3r::GUI::NotificationManager::SlicingProgressNotification::has_cancel_callback ( ) const
inline
42{ return m_cancel_callback != nullptr; }

References m_cancel_callback.

◆ 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::SlicingProgressNotification::init ( )
overrideprotectedvirtual

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

40{
43 if (m_endlines.empty()) {
44 m_endlines.push_back(0);
45 }
46 if (m_lines_count >= 2) {
47 m_lines_count = std::min((size_t)3, m_lines_count);
48 m_multiline = true;
49 while (m_endlines.size() < m_lines_count)
50 m_endlines.push_back(m_endlines.back());
51 }
52 else {
53 m_lines_count = 1;
54 m_multiline = false;
55 }
58 }
59 else {
61 }
62
63}
@ Shown
Definition NotificationManager.hpp:479
@ NotFading
Definition NotificationManager.hpp:480

References Slic3r::GUI::NotificationManager::PopNotification::init(), Slic3r::GUI::NotificationManager::PopNotification::m_endlines, Slic3r::GUI::NotificationManager::PopNotification::m_lines_count, Slic3r::GUI::NotificationManager::PopNotification::m_multiline, m_sp_state, Slic3r::GUI::NotificationManager::PopNotification::m_state, Slic3r::GUI::NotificationManager::PopNotification::NotFading, Slic3r::GUI::NotificationManager::PopNotification::Shown, and SP_PROGRESS.

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_cancel_button()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::on_cancel_button ( )
protected

References m_cancel_callback, set_progress_state(), and SP_NO_SLICING.

Referenced by render_cancel_button().

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

◆ on_change_color_mode()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::on_change_color_mode ( bool is_dark)
overridevirtual

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

34{
36 m_dailytips_panel->on_change_color_mode(is_dark);
37}
static bool is_dark()
Definition TextureImportDialog.cpp:85
virtual void on_change_color_mode(bool is_dark)
Definition NotificationManager.cpp:218

References is_dark(), m_dailytips_panel, and Slic3r::GUI::NotificationManager::PopNotification::on_change_color_mode().

Here is the call graph for this function:

◆ on_show_dailytips()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::on_show_dailytips ( )
protected
446{
447 wxGetApp().plater()->get_dailytips()->open();
448}

Referenced by render_show_dailytips().

Here is the caller graph for this function:

◆ on_text_click()

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

Reimplemented in Slic3r::GUI::NotificationManager::ExportFinishedNotification, Slic3r::GUI::NotificationManager::HintNotification, and Slic3r::GUI::NotificationManager::SharedProfilesNotification.

1048{
1049 if(m_data.callback != nullptr)
1050 return m_data.callback(m_evt_handler);
1051 return false;
1052}
wxEvtHandler * m_evt_handler
Definition NotificationManager.hpp:667

References m_data, and m_evt_handler.

Referenced by render_hypertext().

Here is the caller 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::SlicingProgressNotification::render ( GLCanvas3D & canvas,
float initial_y,
bool move_from_overlay,
float overlay_width,
float right_margin )
overrideprotectedvirtual

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

206{
208 init();
209
210 ImGuiWrapper& imgui = *wxGetApp().imgui();
211 float scale = imgui.get_font_size() / 15.0f;
212
213 bool fading_pop = false;
214 if (m_state == EState::FadingOut) {
215 push_style_color(ImGuiCol_WindowBg, ImGui::GetStyleColorVec4(ImGuiCol_WindowBg), true, m_current_fade_opacity);
216 push_style_color(ImGuiCol_Text, ImGui::GetStyleColorVec4(ImGuiCol_Text), true, m_current_fade_opacity);
217 push_style_color(ImGuiCol_ButtonHovered, ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered), true, m_current_fade_opacity);
218 fading_pop = true;
219 }
221 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(8 * scale, 0));
222 // for debug
223 //ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, m_WindowRadius / 4);
224 //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);
225 ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
226 push_style_color(ImGuiCol_Border, { 0, 0, 0, 0 }, true, m_current_fade_opacity);
227
228 Size cnv_size = canvas.get_canvas_size();
229
230 //m_window_width = 600.f * scale;
231 //if (m_sp_state == SlicingProgressNotification::SlicingProgressState::SP_COMPLETED || m_sp_state == SlicingProgressNotification::SlicingProgressState::SP_CANCELLED)
232 // m_window_width = m_line_height * 25;
233 const ImVec2 progress_child_window_padding = ImVec2(15.f, 0.f) * scale;
234 const ImVec2 dailytips_child_window_padding = m_dailytips_panel->is_expanded() ? ImVec2(15.f, 10.f) * scale : ImVec2(15.f, 0.f) * scale;
235 const ImVec2 bottom_padding = ImVec2(0.f, 0.f) * scale;
236 const float progress_panel_width = (m_window_width - 2 * progress_child_window_padding.x);
237 const float progress_panel_height = (58.0f * scale) + (m_lines_count - 1) * m_line_height;
238 const float dailytips_panel_width = (m_window_width - 2 * dailytips_child_window_padding.x);
239 const float gcodeviewer_height = wxGetApp().plater()->get_preview_canvas3D()->get_gcode_viewer().get_legend_height();
240 //const float dailytips_panel_height = std::min(380.0f * scale, std::max(90.0f, (cnv_size.get_height() - gcodeviewer_height - progress_panel_height - dailytips_child_window_padding.y - initial_y - m_line_height * 4)));
241 const float dailytips_panel_height = 125.0f * scale;
242 const ImVec2 dailytips_size = ImVec2(dailytips_panel_width, dailytips_panel_height);
243 //Orca: Update the child's effective height before positioning this parent window.
244 m_dailytips_panel->set_size(dailytips_size);
245
246 float right_gap = right_margin + (move_from_overlay ? overlay_width + m_line_height * 5 : 0);
247 m_window_height = progress_panel_height + m_dailytips_panel->get_size().y + progress_child_window_padding.y + dailytips_child_window_padding.y + bottom_padding.y;
248 m_top_y = initial_y + m_window_height;
249 m_window_pos = ImVec2((float)cnv_size.get_width() - right_gap - m_window_width, (float)cnv_size.get_height() - m_top_y);
250 imgui.set_next_window_pos(m_window_pos.x, m_window_pos.y, ImGuiCond_Always, 0.0f, 0.0f);
251 ImGui::SetNextWindowSizeConstraints(ImVec2(m_window_width, m_window_height), ImVec2(m_window_width, m_window_height));
252
253 // name of window indentifies window - has to be unique string
254 if (m_id == 0)
255 m_id = m_id_provider.allocate_id();
256 std::string name = "!!Ntfctn" + std::to_string(m_id);
257 int window_flags = ImGuiWindowFlags_NoCollapse |
258 ImGuiWindowFlags_NoTitleBar |
259 ImGuiWindowFlags_NoMove |
260 ImGuiWindowFlags_NoResize |
261 ImGuiWindowFlags_NoScrollbar |
262 ImGuiWindowFlags_NoScrollWithMouse;
263 int child_window_flags = ImGuiWindowFlags_NoCollapse |
264 ImGuiWindowFlags_NoScrollbar |
265 ImGuiWindowFlags_NoScrollWithMouse;
266 if (imgui.begin(name, window_flags)) {
267 ImGuiWindow* parent_window = ImGui::GetCurrentWindow();
268
269 //if (m_sp_state == SlicingProgressState::SP_CANCELLED || m_sp_state == SlicingProgressState::SP_COMPLETED) {
270 // ImVec2 button_size = ImVec2(38.f, 38.f) * scale;
271 // float button_right_margin_x = 3.0f * scale;
272 // ImVec2 button_pos = m_window_pos + ImVec2(m_window_width - button_size.x - button_right_margin_x, (m_window_height - button_size.y) / 2.0f);
273 // float text_left_margin_x = 15.0f * scale;
274 // ImVec2 text_pos = m_window_pos + ImVec2(text_left_margin_x, m_window_height / 2.0f - m_line_height * 1.2f);
275 // ImVec2 view_dailytips_text_pos = m_window_pos + ImVec2(text_left_margin_x, m_window_height / 2.0f + m_line_height * 0.2f);
276
277 // bbl_render_left_sign(imgui, m_window_width, m_window_height, m_window_pos.x + m_window_width, m_window_pos.y);
278 // render_progress_text(text_pos);
279 // render_progress_close_button(button_pos, button_size);
280 // render_show_dailytips(view_dailytips_text_pos);
281 //}
282
284 std::string child_name = "##SlicingProgressPanel" + std::to_string(parent_window->ID);
285
286 ImGui::SetNextWindowPos(parent_window->Pos + progress_child_window_padding);
287 if (ImGui::BeginChild(child_name.c_str(), ImVec2(progress_panel_width, progress_panel_height), false, child_window_flags)) {
288 ImVec2 child_window_pos = ImGui::GetWindowPos();
289 ImVec2 button_size = ImVec2(38.f, 38.f) * scale;
290 float margin_x = 8.0f * scale;
291 ImVec2 progress_bar_size = ImVec2(progress_panel_width - button_size.x - margin_x, 4.0f * scale);
292 float text_bottom = progress_bar_size.y + m_line_height * 1.2f + 7.f * scale;
293 ImVec2 progress_bar_pos = child_window_pos + ImVec2(0, progress_panel_height - text_bottom);
294 ImVec2 button_pos = child_window_pos + ImVec2(progress_panel_width - button_size.x, progress_panel_height - text_bottom - button_size.y / 2.0f);
295 ImVec2 text_pos = ImVec2(progress_bar_pos.x, progress_bar_pos.y - m_line_height * (1.2f + m_lines_count - 1));
296
297 render_progress_text(text_pos);
298 render_progress_close_button(button_pos, button_size);
300 render_bar(progress_bar_pos, progress_bar_size);
301 render_cancel_button(button_pos, button_size);
302 }
303 }
304 ImGui::EndChild();
305
306 // Separator Line
307 ImVec2 separator_min = ImVec2(ImGui::GetCursorScreenPos().x + progress_child_window_padding.x, ImGui::GetCursorScreenPos().y);
308 ImVec2 separator_max = ImVec2(ImGui::GetCursorScreenPos().x + progress_child_window_padding.x + progress_panel_width, ImGui::GetCursorScreenPos().y);
309 ImGui::GetCurrentWindow()->DrawList->AddLine(separator_min, separator_max, ImColor(238, 238, 238, (int)(255 * m_current_fade_opacity)));
310
311 child_name = "##DailyTipsPanel" + std::to_string(parent_window->ID);
312 ImVec2 dailytips_pos = ImGui::GetCursorScreenPos() + dailytips_child_window_padding;
313 m_dailytips_panel->set_position(dailytips_pos);
314 m_dailytips_panel->set_fade_opacity(m_current_fade_opacity);
315 ImGui::SetNextWindowPos(dailytips_pos);
316 if (ImGui::BeginChild(child_name.c_str(), ImVec2(dailytips_panel_width, dailytips_panel_height), false, child_window_flags)) {
317 render_dailytips_panel(dailytips_pos, dailytips_size);
318 }
319 ImGui::EndChild();
320 }
321
322 if (ImGui::IsMouseHoveringRect(ImGui::GetWindowPos(), ImGui::GetWindowPos() + ImGui::GetWindowSize(), true)) {
323 set_hovered();
324 }
325 }
326 imgui.end();
327
328
329 ImGui::PopStyleVar(2);
330 ImGui::PopStyleColor(1);
332 if (fading_pop)
333 ImGui::PopStyleColor(3);
334}
int scale(const int val)
Definition WipeTowerDialog.cpp:58
void render_progress_text(const ImVec2 &pos)
Definition SlicingProgressNotification.cpp:336
void render_dailytips_panel(const ImVec2 &pos, const ImVec2 &size)
Definition SlicingProgressNotification.cpp:406
ImVec2 m_window_pos
Definition SlicingProgressNotification.hpp:73
void render_bar(const ImVec2 &pos, const ImVec2 &size)
Definition SlicingProgressNotification.cpp:380
void init() override
Definition SlicingProgressNotification.cpp:39
void render_progress_close_button(const ImVec2 &pos, const ImVec2 &size)
Definition SlicingProgressNotification.cpp:479
void render_cancel_button(const ImVec2 &pos, const ImVec2 &size)
Definition SlicingProgressNotification.cpp:450

References Slic3r::GUI::ImGuiWrapper::begin(), Slic3r::GUI::ImGuiWrapper::end(), Slic3r::GUI::NotificationManager::PopNotification::FadingOut, Slic3r::GUI::GLCanvas3D::get_canvas_size(), Slic3r::GUI::ImGuiWrapper::get_font_size(), Slic3r::GUI::NotificationManager::PopNotification::Hovered, Slic3r::GUI::NotificationManager::init(), Slic3r::GUI::NotificationManager::PopNotification::m_current_fade_opacity, m_dailytips_panel, Slic3r::GUI::NotificationManager::PopNotification::m_id, Slic3r::GUI::NotificationManager::PopNotification::m_id_provider, Slic3r::GUI::NotificationManager::PopNotification::m_line_height, Slic3r::GUI::NotificationManager::PopNotification::m_lines_count, m_sp_state, Slic3r::GUI::NotificationManager::PopNotification::m_state, Slic3r::GUI::NotificationManager::PopNotification::m_top_y, Slic3r::GUI::NotificationManager::PopNotification::m_window_height, m_window_pos, Slic3r::GUI::NotificationManager::PopNotification::m_window_width, render_bar(), render_cancel_button(), render_dailytips_panel(), render_progress_close_button(), render_progress_text(), Slic3r::GUI::NotificationManager::PopNotification::restore_default_theme(), scale(), Slic3r::GUI::NotificationManager::PopNotification::set_hovered(), Slic3r::GUI::ImGuiWrapper::set_next_window_pos(), SP_CANCELLED, SP_COMPLETED, SP_PROGRESS, Slic3r::GUI::NotificationManager::PopNotification::Unknown, and Slic3r::GUI::NotificationManager::PopNotification::use_bbl_theme().

Here is the call graph for this function:

◆ render_bar()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_bar ( const ImVec2 & pos,
const ImVec2 & size )
protected
381{
383 return;
384
385 ImGuiWrapper& imgui = *wxGetApp().imgui();
386
387 ImColor progress_color = ImColor(0, 150, 136, (int)(255 * m_current_fade_opacity));
388 ImColor bg_color = ImColor(217, 217, 217, (int)(255 * m_current_fade_opacity));
389
390 ImVec2 lineStart = pos;
391 ImVec2 lineEnd = lineStart + size;
392 ImVec2 midPoint = ImVec2(lineStart.x + (lineEnd.x - lineStart.x) * m_percentage, lineEnd.y);
393 ImGui::GetWindowDrawList()->AddRectFilled(lineStart, lineEnd, bg_color);
394 ImGui::GetWindowDrawList()->AddRectFilled(lineStart, midPoint, progress_color);
395
396 // percentage text
397 ImVec2 text_pos = ImVec2(pos.x, pos.y + size.y + m_line_height * 0.2f);
398 std::string text;
399 std::stringstream stream;
400 stream << std::fixed << std::setprecision(2) << (int)(m_percentage * 100) << "%";
401 text = stream.str();
402 ImGui::SetCursorScreenPos(text_pos);
403 imgui.text(text.c_str());
404}
float m_percentage
Definition SlicingProgressNotification.hpp:74
wxColour bg_color()
Definition SpeedDialDialog.cpp:69
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16

References Slic3r::GUI::NotificationManager::PopNotification::m_current_fade_opacity, Slic3r::GUI::NotificationManager::PopNotification::m_line_height, m_percentage, m_sp_state, SP_PROGRESS, and Slic3r::GUI::ImGuiWrapper::text().

Referenced by render().

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

◆ render_cancel_button()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_cancel_button ( const ImVec2 & pos,
const ImVec2 & size )
protected
451{
453 ImGuiWrapper& imgui = *wxGetApp().imgui();
454
455 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
456 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
457 push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
458 push_style_color(ImGuiCol_TextSelectedBg, ImVec4(0, .75f, .75f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
459 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f));
460
461 ImVec2 button_size = size;
462 ImVec2 button_pos = pos;
463 ImGui::SetCursorScreenPos(button_pos);
464
465 std::wstring button_text;
466 button_text = ImGui::CancelButton;
467 if (ImGui::IsMouseHoveringRect(button_pos, button_pos + button_size, true))
468 {
469 button_text = ImGui::CancelHoverButton;
470 if (ImGui::IsMouseClicked(ImGuiMouseButton_Left))
472 }
473 imgui.button(button_text.c_str());
474
475 ImGui::PopStyleColor(5);
476 }
477}
void on_cancel_button()
Definition SlicingProgressNotification.cpp:174

References Slic3r::GUI::ImGuiWrapper::button(), Slic3r::GUI::NotificationManager::PopNotification::FadingOut, Slic3r::GUI::NotificationManager::PopNotification::m_current_fade_opacity, m_sp_state, Slic3r::GUI::NotificationManager::PopNotification::m_state, on_cancel_button(), and SP_PROGRESS.

Referenced by render().

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

◆ render_close_button()

void Slic3r::GUI::NotificationManager::PopNotification::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 )
protectedvirtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::ExportFinishedNotification, Slic3r::GUI::NotificationManager::HintNotification, Slic3r::GUI::NotificationManager::PluginMissingNotification, Slic3r::GUI::NotificationManager::ProgressIndicatorNotification, and Slic3r::GUI::NotificationManager::URLDownloadNotification.

859{
861 ImVec2 win_size(win_size_x, win_size_y);
862 ImVec2 win_pos(win_pos_x, win_pos_y);
863 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
864 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
865 push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
866 push_style_color(ImGuiCol_TextSelectedBg, ImVec4(0, .75f, .75f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
867 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f));
868
869
870 std::wstring button_text;
871 button_text = m_is_dark ? ImGui::CloseNotifDarkButton : ImGui::CloseNotifButton;
872 //button_text = ImGui::PreferencesButton;
873
874 //if (ImGui::IsMouseHoveringRect(ImVec2(win_pos.x - win_size.x / 10.f, win_pos.y),
875 // ImVec2(win_pos.x, win_pos.y + win_size.y - ( m_minimize_b_visible ? 2 * m_line_height : 0)),
876 // true))
877 if (ImGui::IsMouseHoveringRect(ImVec2(win_pos.x - win_size.x / 10.f, win_pos.y), ImVec2(win_pos.x, win_pos.y + 2 * m_line_height+10),true))
878 {
879 button_text = m_is_dark ? ImGui::CloseNotifHoverDarkButton : ImGui::CloseNotifHoverButton;
880 }
881 ImVec2 button_pic_size = ImGui::CalcTextSize(into_u8(button_text).c_str());
882 ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
883 ImGui::SetCursorPosX(win_size.x - m_line_height * 2.75f);
884 //ImGui::SetCursorPosY(win_size.y / 2 - button_size.y);
886 ImGui::SetCursorPosY(0);
887 else
888 ImGui::SetCursorPosY(win_size.y / 2 - button_size.y);
889 if (imgui.button(button_text.c_str(), button_size.x, button_size.y))
890 {
891 close();
892 }
893
894 //invisible large button
895 ImGui::SetCursorPosX(win_size.x - m_line_height * 2.35f);
896 ImGui::SetCursorPosY(0);
897 if (imgui.button(" ", m_line_height * 2.125, win_size.y - ( m_minimize_b_visible ? 2 * m_line_height : 0)))
898 {
899 close();
900 }
901
902 ImGui::PopStyleColor(5);
903}
bool m_minimize_b_visible
Definition NotificationManager.hpp:664

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

Referenced by render(), Slic3r::GUI::NotificationManager::ExportFinishedNotification::render_close_button(), and Slic3r::GUI::NotificationManager::ProgressIndicatorNotification::render_close_button().

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

◆ render_dailytips_panel()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_dailytips_panel ( const ImVec2 & pos,
const ImVec2 & size )
protected
407{
408 m_dailytips_panel->render();
409}

References m_dailytips_panel.

Referenced by render().

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_minimize_button()

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

Reimplemented in Slic3r::GUI::NotificationManager::ExportFinishedNotification, Slic3r::GUI::NotificationManager::HintNotification, Slic3r::GUI::NotificationManager::PluginMissingNotification, and Slic3r::GUI::NotificationManager::ProgressBarNotification.

1017{
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
1026 //button - if part if treggered
1027 std::wstring button_text;
1028 button_text = m_is_dark ? ImGui::MinimalizeDarkButton : ImGui::MinimalizeButton;
1029 if (ImGui::IsMouseHoveringRect(ImVec2(win_pos_x - m_window_width / 10.f, win_pos_y + m_window_height - 2 * m_line_height + 1),
1030 ImVec2(win_pos_x, win_pos_y + m_window_height),
1031 true))
1032 {
1033 button_text = m_is_dark ? ImGui::MinimalizeHoverDarkButton : ImGui::MinimalizeHoverButton;
1034 }
1035 ImVec2 button_pic_size = ImGui::CalcTextSize(into_u8(button_text).c_str());
1036 ImVec2 button_size(button_pic_size.x * 1.25f, button_pic_size.y * 1.25f);
1037 ImGui::SetCursorPosX(m_window_width - m_line_height * 1.8f);
1038 ImGui::SetCursorPosY(m_window_height - button_size.y - 5);
1039 if (imgui.button(button_text.c_str(), button_size.x, button_size.y))
1040 {
1041 m_multiline = false;
1042 }
1043
1044 ImGui::PopStyleColor(5);
1045 m_minimize_b_visible = true;
1046}

References Slic3r::GUI::ImGuiWrapper::button(), ensure_ui_inited(), FadingOut, Slic3r::GUI::into_u8(), m_current_fade_opacity, m_is_dark, m_line_height, m_minimize_b_visible, m_multiline, m_state, m_window_height, and m_window_width.

Referenced by render().

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

◆ render_progress_close_button()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_progress_close_button ( const ImVec2 & pos,
const ImVec2 & size )
protected
480{
482 ImGuiWrapper& imgui = *wxGetApp().imgui();
483
484 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
485 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
486 push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
487 push_style_color(ImGuiCol_TextSelectedBg, ImVec4(0, .75f, .75f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
488 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f));
489
490 ImVec2 button_size = size;
491 ImVec2 button_pos = pos;
492 ImGui::SetCursorScreenPos(button_pos);
493
494 std::wstring button_text;
495 button_text = m_is_dark ? ImGui::CloseNotifDarkButton : ImGui::CloseNotifButton;
496 if (ImGui::IsMouseHoveringRect(button_pos, button_pos + button_size, true))
497 {
498 button_text = m_is_dark ? ImGui::CloseNotifHoverDarkButton : ImGui::CloseNotifHoverButton;
499 if (ImGui::IsMouseClicked(ImGuiMouseButton_Left))
500 close();
501 }
502 imgui.button(button_text.c_str());
503
504 ImGui::PopStyleColor(5);
505 }
506}

References Slic3r::GUI::ImGuiWrapper::button(), Slic3r::GUI::NotificationManager::PopNotification::close(), Slic3r::GUI::NotificationManager::PopNotification::FadingOut, Slic3r::GUI::NotificationManager::PopNotification::m_current_fade_opacity, Slic3r::GUI::NotificationManager::PopNotification::m_is_dark, m_sp_state, Slic3r::GUI::NotificationManager::PopNotification::m_state, SP_CANCELLED, and SP_COMPLETED.

Referenced by render().

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

◆ render_progress_text()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_progress_text ( const ImVec2 & pos)
protected
337{
338 ImGuiWrapper& imgui = *wxGetApp().imgui();
339 float scale = imgui.get_font_size() / 15.0f;
340 ImVec2 icon_size = ImVec2(38.f, 38.f) * scale;
342 // complete icon
343 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
344 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
345 push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
346 push_style_color(ImGuiCol_TextSelectedBg, ImVec4(0, .75f, .75f, 1.f), m_state == EState::FadingOut, m_current_fade_opacity);
347 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f));
348
349 ImGui::SetCursorScreenPos(pos);
350 std::wstring icon_text;
351 icon_text = ImGui::CompleteIcon;
352 imgui.button(icon_text.c_str());
353
354 ImGui::PopStyleColor(5);
355
356 // complete text
357 imgui.push_bold_font();
358 ImGui::SetCursorScreenPos(ImVec2(pos.x + icon_size.x + ImGui::CalcTextSize(" ").x, pos.y + (icon_size.y - m_line_height) / 2));
359 imgui.text(m_text1.substr(0, m_endlines[0]).c_str());
360 imgui.pop_bold_font();
361 return;
362 }
364 imgui.push_bold_font();
365 ImGui::SetCursorScreenPos(ImVec2(pos.x + ImGui::CalcTextSize(" ").x, pos.y + (icon_size.y - m_line_height) / 2));
366 imgui.text(m_text1.substr(0, m_endlines[0]).c_str());
367 imgui.pop_bold_font();
368 }
370 // multi-line text
371 int last_end = 0;
372 for (auto i = 0; i < m_lines_count; i++) {
373 ImGui::SetCursorScreenPos(pos + ImVec2(0, i * m_line_height));
374 imgui.text(m_text1.substr(last_end, m_endlines[i] - last_end).c_str());
375 last_end = m_endlines[i];
376 }
377 }
378}

References Slic3r::GUI::ImGuiWrapper::button(), Slic3r::GUI::NotificationManager::PopNotification::FadingOut, Slic3r::GUI::ImGuiWrapper::get_font_size(), Slic3r::GUI::NotificationManager::PopNotification::m_current_fade_opacity, Slic3r::GUI::NotificationManager::PopNotification::m_endlines, Slic3r::GUI::NotificationManager::PopNotification::m_line_height, Slic3r::GUI::NotificationManager::PopNotification::m_lines_count, m_sp_state, Slic3r::GUI::NotificationManager::PopNotification::m_state, Slic3r::GUI::NotificationManager::PopNotification::m_text1, Slic3r::GUI::ImGuiWrapper::pop_bold_font(), Slic3r::GUI::ImGuiWrapper::push_bold_font(), scale(), SP_CANCELLED, SP_COMPLETED, SP_PROGRESS, and Slic3r::GUI::ImGuiWrapper::text().

Referenced by render().

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

◆ render_show_dailytips()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::render_show_dailytips ( const ImVec2 & pos)
protected
412{
414 return;
415
416 ImGuiWrapper& imgui = *wxGetApp().imgui();
417
418 ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
419 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
420 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(.0f, .0f, .0f, .0f));
421 ImGui::PushStyleColor(ImGuiCol_Text, ImColor(31, 142, 234).Value);
422
423 ImGui::SetCursorScreenPos(pos);
424 std::wstring button_text;
425 button_text = ImGui::OpenArrowIcon;
426 imgui.button(_L("View all Daily tips") + " " + button_text);
427 //click behavior
428 if (ImGui::IsMouseHoveringRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), true))
429 {
430 //underline
431 ImVec2 lineEnd = ImGui::GetItemRectMax();
432 lineEnd.x -= ImGui::CalcTextSize("A").x / 2;
433 lineEnd.y -= 2;
434 ImVec2 lineStart = lineEnd;
435 lineStart.x = ImGui::GetItemRectMin().x;
436 ImGui::GetWindowDrawList()->AddLine(lineStart, lineEnd, ImColor(31, 142, 234));
437
438 if (ImGui::IsMouseClicked(ImGuiMouseButton_Left))
440 }
441
442 ImGui::PopStyleColor(4);
443}
#define _L(s)
Definition OBJ.cpp:34
void on_show_dailytips()
Definition SlicingProgressNotification.cpp:445

References _L, Slic3r::GUI::ImGuiWrapper::button(), m_sp_state, on_show_dailytips(), SP_CANCELLED, and SP_COMPLETED.

Here is the call graph for this function:

◆ render_text()

void Slic3r::GUI::NotificationManager::PopNotification::render_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::ExportFinishedNotification, Slic3r::GUI::NotificationManager::HintNotification, Slic3r::GUI::NotificationManager::OrcaSyncConflictNotification, Slic3r::GUI::NotificationManager::PluginMissingNotification, Slic3r::GUI::NotificationManager::ProgressBarNotification, and Slic3r::GUI::NotificationManager::SharedProfilesNotification.

711{
712 float x_offset = m_left_indentation;
713 int last_end = 0;
714 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));
715 float shift_y = m_line_height;
716 std::string line;
717
718 for (size_t i = 0; i < (m_multiline ? m_endlines.size() : std::min(m_endlines.size(), (size_t)2)); i++) {
719 assert(m_endlines.size() > i && m_text1.size() >= m_endlines[i]);
720 line.clear();
721 ImGui::SetCursorPosX(x_offset);
722 ImGui::SetCursorPosY(starting_y + i * shift_y);
723 if (m_endlines.size() > i && m_text1.size() >= m_endlines[i]) {
724 if (i == 1 && m_endlines.size() > 2 && !m_multiline) {
725 // second line with "more" hypertext
726 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));
727 while (ImGui::CalcTextSize(line.c_str()).x > m_window_width - m_window_width_offset - ImGui::CalcTextSize((".." + _u8L("More")).c_str()).x) {
728 line = line.substr(0, line.length() - 1);
729 }
730 line += "..";
731 }
732 else {
733 // regural line
734 line = m_text1.substr(last_end, m_endlines[i] - last_end);
735 }
736 last_end = m_endlines[i];
737 if (m_text1.size() > m_endlines[i])
738 last_end += (m_text1[m_endlines[i]] == '\n' || m_text1[m_endlines[i]] == ' ' ? 1 : 0);
739
740 if (pos_start != std::string::npos && pos_end != std::string::npos&& m_endlines[i] - line.length() >= pos_start && m_endlines[i] <= pos_end) {
742 imgui.text(line.c_str());
743 ImGui::PopStyleColor();
744 }
745 else {
746 imgui.text(line.c_str());
747 }
748 }
749 }
750 //hyperlink text
751 if (!m_multiline && m_lines_count > 2) {
752 render_hypertext(imgui, x_offset + ImGui::CalcTextSize((line + " ").c_str()).x, starting_y + shift_y, _u8L("More"), true);
753 }
754 else if (!m_hypertext.empty()) {
755 render_hypertext(imgui, x_offset + ImGui::CalcTextSize((line + (line.empty() ? "" : " ")).c_str()).x, starting_y + (m_endlines.size() - 1) * shift_y, m_hypertext);
756 }
757
758 // text2 (text after hypertext) is not rendered for regular notifications
759 // its rendering is in HintNotification::render_text
760}

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 render(), and Slic3r::GUI::NotificationManager::ExportFinishedNotification::render_text().

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

◆ reset_timer()

void Slic3r::GUI::NotificationManager::PopNotification::reset_timer ( )
inlineinherited
static int64_t timestamp_now()
Definition GLCanvas3D.hpp:1416
int64_t m_notification_start
Definition NotificationManager.hpp:620

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:

◆ set_cancel_callback()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_cancel_callback ( std::function< bool()> callback)
inline
41{ m_cancel_callback = callback; }

References m_cancel_callback.

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

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_export_possible()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_export_possible ( bool b)
inline
55{ m_export_possible = b; }
bool m_export_possible
Definition SlicingProgressNotification.hpp:81

References m_export_possible.

Referenced by set_progress_state(), and Slic3r::GUI::NotificationManager::set_slicing_progress_export_possible().

Here is the caller graph for this function:

◆ set_fff()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_fff ( bool b)
inline
54{ m_is_fff = b; }
bool m_is_fff
Definition SlicingProgressNotification.hpp:87

References m_is_fff.

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

Here is the caller graph for this function:

◆ 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::PopNotification::set_next_window_size ( ImGuiWrapper & imgui)
protectedvirtualinherited

Reimplemented in Slic3r::GUI::NotificationManager::HintNotification.

641{
643 std::max(m_lines_count, (size_t)2) * m_line_height :
644 2 * m_line_height;
645 m_window_height += 1 * m_line_height; // top and bottom
646}

References m_line_height, m_lines_count, m_multiline, and m_window_height.

Referenced by bbl_render_block_notification(), render(), and render_hypertext().

Here is the caller graph for this function:

◆ set_percentage()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_percentage ( float percent)
inline
35{ m_percentage = percent; }

References m_percentage.

Referenced by set_progress_state().

Here is the caller graph for this function:

◆ set_print_info()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_print_info ( const std::string & info)
158{
161 } else {
162 m_has_print_info = true;
163 m_print_info = info;
164 }
165}
std::string m_print_info
Definition SlicingProgressNotification.hpp:86
bool m_has_print_info
Definition SlicingProgressNotification.hpp:85

References m_has_print_info, m_print_info, m_sp_state, set_progress_state(), and SP_COMPLETED.

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

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

◆ set_progress_state() [1/2]

bool Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_progress_state ( float percent)
66{
67 if (percent < 0.f)
68 return true;//set_progress_state(SlicingProgressState::SP_CANCELLED);
69 else if (percent >= 1.f) {
72 }
73 else
75}
int64_t m_before_complete_start
Definition SlicingProgressNotification.hpp:75

References m_before_complete_start, set_progress_state(), SP_COMPLETED, SP_PROGRESS, and Slic3r::GUI::GLCanvas3D::timestamp_now().

Referenced by SlicingProgressNotification(), on_cancel_button(), set_print_info(), set_progress_state(), Slic3r::GUI::NotificationManager::set_slicing_progress_began(), Slic3r::GUI::NotificationManager::set_slicing_progress_canceled(), Slic3r::GUI::NotificationManager::set_slicing_progress_hidden(), Slic3r::GUI::NotificationManager::set_slicing_progress_percentage(), and update_state().

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

◆ set_progress_state() [2/2]

bool Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_progress_state ( SlicingProgressState state,
float percent = 0.f )
78{
79 switch (state)
80 {
84 m_has_print_info = false;
86 m_sp_state = state;
87 return true;
91 m_has_print_info = false;
93 m_sp_state = state;
95 return true;
98 return false;
99 set_percentage(percent);
100 m_sp_state = state;
102 return true;
104 set_percentage(-1);
105 m_has_print_info = false;
106 set_export_possible(false);
107 m_sp_state = state;
108 return true;
111 return false;
113 m_has_print_info = false;
114 // m_export_possible is important only for SP_PROGRESS state, thus we can reset it here
115 set_export_possible(false);
116 m_sp_state = state;
117 return true;
118 default:
119 break;
120 }
121 return false;
122}
void set_export_possible(bool b)
Definition SlicingProgressNotification.hpp:55
void set_percentage(float percent)
Definition SlicingProgressNotification.hpp:35

References Slic3r::GUI::NotificationManager::PopNotification::Hidden, Slic3r::GUI::NotificationManager::PopNotification::m_current_fade_opacity, m_has_print_info, m_percentage, m_sp_state, Slic3r::GUI::NotificationManager::PopNotification::m_state, set_export_possible(), set_percentage(), SP_BEGAN, SP_CANCELLED, SP_COMPLETED, SP_NO_SLICING, and SP_PROGRESS.

Here is the call graph for this function:

◆ 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:

◆ set_sidebar_collapsed()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_sidebar_collapsed ( bool collapsed)
168{
169 m_sidebar_collapsed = collapsed;
172}
bool m_sidebar_collapsed
Definition SlicingProgressNotification.hpp:79

References m_sidebar_collapsed, m_sp_state, Slic3r::GUI::NotificationManager::PopNotification::m_state, Slic3r::GUI::NotificationManager::PopNotification::NotFading, and SP_COMPLETED.

Referenced by Slic3r::GUI::NotificationManager::set_sidebar_collapsed(), and Slic3r::GUI::NotificationManager::set_slicing_complete_print_time().

Here is the caller graph for this function:

◆ set_status_text()

void Slic3r::GUI::NotificationManager::SlicingProgressNotification::set_status_text ( const std::string & text)
125{
126 switch (m_sp_state)
127 {
130 break;
132 {
134 update(data);
136 }
137 break;
139 {
141 update(data);
143 }
144 break;
146 {
147 NotificationData data{ NotificationType::SlicingProgress, NotificationLevel::ProgressBarNotificationLevel, 0, _u8L("Slice complete") };
148 update(data);
150 }
151 break;
152 default:
153 break;
154 }
155}
void update(const NotificationData &n)
Definition NotificationManager.cpp:1053
@ ProgressBarNotificationLevel
Definition NotificationManager.hpp:212
@ SlicingProgress
Definition NotificationManager.hpp:118

References _u8L, Slic3r::GUI::NotificationManager::PopNotification::Hidden, m_sp_state, Slic3r::GUI::NotificationManager::PopNotification::m_state, Slic3r::GUI::NotificationManager::PopNotification::NotFading, Slic3r::GUI::NotificationManager::ProgressBarNotificationLevel, Slic3r::GUI::NotificationManager::PopNotification::Shown, Slic3r::GUI::SlicingProgress, SP_CANCELLED, SP_COMPLETED, SP_NO_SLICING, SP_PROGRESS, and Slic3r::GUI::NotificationManager::PopNotification::update().

Referenced by Slic3r::GUI::NotificationManager::set_slicing_progress_canceled(), and Slic3r::GUI::NotificationManager::set_slicing_progress_percentage().

Here is the call graph for this function:
Here is the caller 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}
std::string m_text2
Definition NotificationManager.hpp:632

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::SlicingProgressNotification::update_state ( bool paused,
const int64_t delta )
overridevirtual

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

194{
195 bool ret = PopNotification::update_state(paused, delta);
197 ret = true;
198
199 // sets Estate to hidden
202 return ret;
203}
virtual bool update_state(bool paused, const int64_t delta)
Definition NotificationManager.cpp:1089
EState get_state() const
Definition NotificationManager.hpp:515

References Slic3r::GUI::NotificationManager::PopNotification::ClosePending, Slic3r::GUI::NotificationManager::PopNotification::Finished, Slic3r::GUI::NotificationManager::PopNotification::get_state(), m_sp_state, set_progress_state(), SP_COMPLETED, SP_NO_SLICING, and Slic3r::GUI::NotificationManager::PopNotification::update_state().

Here is the call 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_before_complete_start

int64_t Slic3r::GUI::NotificationManager::SlicingProgressNotification::m_before_complete_start
protected

Referenced by set_progress_state().

◆ m_bottom_y

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

Referenced by get_bottom().

◆ m_cancel_callback

std::function<bool()> Slic3r::GUI::NotificationManager::SlicingProgressNotification::m_cancel_callback
protected

◆ 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_dailytips_panel

DailyTipsPanel* Slic3r::GUI::NotificationManager::SlicingProgressNotification::m_dailytips_panel { nullptr }
protected

◆ m_data

◆ m_DefaultTheme

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

◆ 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_export_possible

bool Slic3r::GUI::NotificationManager::SlicingProgressNotification::m_export_possible { false }
protected
81{ false };

Referenced by set_export_possible().

◆ m_fading_start

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

Referenced by update_state().

◆ m_has_print_info

bool Slic3r::GUI::NotificationManager::SlicingProgressNotification::m_has_print_info { false }
protected
85{ false };

Referenced by set_print_info(), and set_progress_state().

◆ m_hypertext

◆ 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_fff

bool Slic3r::GUI::NotificationManager::SlicingProgressNotification::m_is_fff { true }
protected
87{ true };

Referenced by set_fff().

◆ 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_percentage

float Slic3r::GUI::NotificationManager::SlicingProgressNotification::m_percentage { 0.0f }
protected
74{ 0.0f };

Referenced by render_bar(), set_percentage(), and set_progress_state().

◆ m_print_info

std::string Slic3r::GUI::NotificationManager::SlicingProgressNotification::m_print_info
protected

Referenced by set_print_info().

◆ m_scale

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

Referenced by set_scale().

◆ m_sidebar_collapsed

bool Slic3r::GUI::NotificationManager::SlicingProgressNotification::m_sidebar_collapsed { false }
protected
79{ false };

Referenced by set_sidebar_collapsed().

◆ m_sp_state

◆ 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_pos

ImVec2 Slic3r::GUI::NotificationManager::SlicingProgressNotification::m_window_pos
protected

Referenced by render().

◆ 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: