Files
OrcaSlicer/src/slic3r/GUI/DailyTips.hpp
T
HanifKoh 1a5f91d727 Add Missing Includes Across src/slic3r/GUI (#16048)
* Add Missing Includes Across src/slic3r/GUI

Every GUI source and header now directly includes the headers declaring what it uses, rather than relying on the precompiled header or transitive includes. Generated with clang-tidy misc-include-cleaner, plus one hand edit making CalibrationPanel.hpp self-contained.

* Drop the OS-Specific Includes Added Outside Their Platform Guards

GLib, GTK, D-Bus and POSIX headers are only used inside platform #if blocks, which already include them. Added unconditionally at the top of the file they broke the Windows build.

* Add the clang-tidy Configuration That Generated These Includes

Only misc-include-cleaner's missing-include check, with the headers it must never suggest: per-platform, internal and OS-specific ones that would break other platforms or are not meant to be included directly.

* Match Windows Paths in the clang-tidy Ignore List

Header paths use backslashes on Windows, so every / in a pattern is now [/\\]. The Windows SDK headers are ignored alongside the other OS-specific ones, and the list is one pattern per line. Suggested by @raistlin7447 from a Windows clang-cl run.
2026-10-02 14:56:56 +08:00

75 lines
1.7 KiB
C++

#ifndef slic3r_GUI_DailyTips_hpp_
#define slic3r_GUI_DailyTips_hpp_
#include "HintNotification.hpp"
//#include <wx/time.h>
#include <imgui.h>
#include <cstddef>
#include <string>
#include <vector>
#include <memory>
namespace Slic3r { namespace GUI {
enum class DailyTipsLayout{
Horizontal,
Vertical
};
class DailyTipsDataRenderer;
class DailyTipsPanel {
static int uid;
public:
DailyTipsPanel(bool can_expand = true, DailyTipsLayout layout = DailyTipsLayout::Vertical);
void set_position(const ImVec2& pos);
void set_size(const ImVec2& size);
void set_can_expand(bool can_expand);
ImVec2 get_size();
void render();
void retrieve_data_from_hint_database(HintDataNavigation nav);
void expand(bool expand = true);
void collapse();
bool is_expanded();
void on_change_color_mode(bool is_dark);
void set_fade_opacity(float opacity);
protected:
void render_controller_buttons(const ImVec2& pos, const ImVec2& size);
void push_styles();
void pop_styles();
private:
std::unique_ptr<DailyTipsDataRenderer> m_dailytips_renderer;
size_t m_page_index{ 0 };
int m_pages_count;
bool m_is_expanded{ true };
bool m_can_expand{ true };
ImVec2 m_pos;
float m_width;
float m_height;
float m_content_height;
float m_footer_height;
int m_uid;
bool m_first_enter{ false };
bool m_is_dark{ false };
float m_fade_opacity{ 1.0f };
};
class DailyTipsWindow {
public:
DailyTipsWindow();
void open();
void close();
void render();
void on_change_color_mode(bool is_dark);
private:
DailyTipsPanel* m_panel{ nullptr };
bool m_show{ false };
bool m_is_dark{ false };
};
}}
#endif