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

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

Collaboration diagram for Slic3r::GUI::DailyTipsWindow:

Public Member Functions

 DailyTipsWindow ()
void open ()
void close ()
void render ()
void on_change_color_mode (bool is_dark)

Private Attributes

DailyTipsPanel * m_panel { nullptr }
bool m_show { false }
bool m_is_dark { false }

Detailed Description

Constructor & Destructor Documentation

◆ DailyTipsWindow()

Slic3r::GUI::DailyTipsWindow::DailyTipsWindow ( )
575{
576 m_panel = new DailyTipsPanel(false, DailyTipsLayout::Vertical);
577}
DailyTipsPanel * m_panel
Definition DailyTips.hpp:68
@ Vertical
Definition DailyTips.hpp:17

References m_panel, and Slic3r::GUI::Vertical.

Member Function Documentation

◆ close()

void Slic3r::GUI::DailyTipsWindow::close ( )
586{
587 m_show = false;
588}
bool m_show
Definition DailyTips.hpp:69

References m_show.

◆ on_change_color_mode()

void Slic3r::GUI::DailyTipsWindow::on_change_color_mode ( bool is_dark)
646{
648 m_panel->on_change_color_mode(is_dark);
649}
static bool is_dark()
Definition TextureImportDialog.cpp:85
bool m_is_dark
Definition DailyTips.hpp:70

References is_dark(), m_is_dark, and m_panel.

Here is the call graph for this function:

◆ open()

void Slic3r::GUI::DailyTipsWindow::open ( )
580{
581 m_show = true;
582 m_panel->retrieve_data_from_hint_database(HintDataNavigation::Curr);
583}
@ Curr
Definition HintNotification.hpp:35

References Slic3r::GUI::Curr, m_panel, and m_show.

◆ render()

void Slic3r::GUI::DailyTipsWindow::render ( )
591{
592 if (!m_show)
593 return;
594 //if (m_show)
595 // ImGui::OpenPopup((_u8L("Daily Tips")).c_str());
596
597 ImGuiWrapper& imgui = *wxGetApp().imgui();
598 float scale = imgui.get_font_size() / 15.0f;
599
600 const Size& cnv_size = wxGetApp().plater()->get_current_canvas3D()->get_canvas_size();
601 ImVec2 center = ImVec2(cnv_size.get_width() * 0.5f, cnv_size.get_height() * 0.5f);
602 ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
603
604 ImVec2 padding = ImVec2(25, 25) * scale;
605 imgui.push_menu_style(scale);
606 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, padding);
607 ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 12.f * scale);
608 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10, 3) * scale);
609 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(10, 7) * scale);
610 ImGui::PushStyleColor(ImGuiCol_TitleBgActive, m_is_dark ? ImVec4(54 / 255.0f, 54 / 255.0f, 60 / 255.0f, 1.00f) : ImVec4(245 / 255.0f, 245 / 255.0f, 245 / 255.0f, 1.00f));
611 ImGui::GetCurrentContext()->DimBgRatio = 1.0f;
612 int windows_flag =
613 ImGuiWindowFlags_NoCollapse
614 | ImGuiWindowFlags_AlwaysAutoResize
615 | ImGuiWindowFlags_NoResize
616 | ImGuiWindowFlags_NoScrollbar
617 | ImGuiWindowFlags_NoScrollWithMouse;
618 imgui.push_bold_font();
619 //if (ImGui::BeginPopupModal((_u8L("Daily Tips")).c_str(), NULL, windows_flag))
620 if (ImGui::Begin((_u8L("Daily Tips")).c_str(), &m_show, windows_flag))
621 {
622 imgui.pop_bold_font();
623
624 ImVec2 panel_pos = ImGui::GetWindowPos() + ImGui::GetWindowContentRegionMin();
625 ImVec2 panel_size = ImVec2(400.0f, 435.0f) * scale;
626 m_panel->set_position(panel_pos);
627 m_panel->set_size(panel_size);
628 m_panel->render();
629
630 if (ImGui::IsKeyDown(ImGui::GetKeyIndex(ImGuiKey_Escape))) {
631 m_show = false;
632 ImGui::CloseCurrentPopup();
633 }
634 ImGui::End();
635 //ImGui::EndPopup();
636 }
637 else {
638 imgui.pop_bold_font();
639 }
640 ImGui::PopStyleVar(4);
641 ImGui::PopStyleColor();
642 imgui.pop_menu_style();
643}
int scale(const int val)
Definition WipeTowerDialog.cpp:58
void center(ExPolygonsWithIds &e)
Definition Emboss.cpp:1382
#define _u8L(s)
Definition I18N.hpp:11

References _u8L, Slic3r::center(), Slic3r::GUI::ImGuiWrapper::get_font_size(), Slic3r::GUI::Size::get_height(), Slic3r::GUI::Size::get_width(), m_is_dark, m_panel, m_show, Slic3r::GUI::ImGuiWrapper::pop_bold_font(), Slic3r::GUI::ImGuiWrapper::pop_menu_style(), Slic3r::GUI::ImGuiWrapper::push_bold_font(), Slic3r::GUI::ImGuiWrapper::push_menu_style(), and scale().

Here is the call graph for this function:

Member Data Documentation

◆ m_is_dark

bool Slic3r::GUI::DailyTipsWindow::m_is_dark { false }
private
70{ false };

Referenced by on_change_color_mode(), and render().

◆ m_panel

DailyTipsPanel* Slic3r::GUI::DailyTipsWindow::m_panel { nullptr }
private
68{ nullptr };

Referenced by DailyTipsWindow(), on_change_color_mode(), open(), and render().

◆ m_show

bool Slic3r::GUI::DailyTipsWindow::m_show { false }
private
69{ false };

Referenced by close(), open(), and render().


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DailyTips.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DailyTips.cpp