mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-05 17:17:42 +00:00
* Fix OpenGL framebuffer object support on macOS
this enables the outline on macOS
* Revert "Fix OpenGL framebuffer object support on macOS"
This reverts commit 9872708954.
* Enable ARB framebuffer if OpenGL >= 3.0 (OrcaSlicer/OrcaSlicer#14770)
* FIX: plater toolbar image update
jira: STUDIO-12457
Change-Id: Ia855b4bd9bec884d52202f5d8f5cfad9efce0f2f
(cherry picked from commit 474691813b497654ef701fe7073992db366e81a9)
* FIX: thumbinal regen
jira: STUDIO-16732
Change-Id: I4cc4e76b36caf1a41793c1f84ee5e88a44ebdd42
(cherry picked from commit 53f33b7db260005e477842d6459b1b28aa8aa0d8)
* FIX: force update thumbinal once dirty
jira: STUDIO-13041
Change-Id: I770743b53c51351cb3b8a7133140974c75c05364
(cherry picked from commit 96198a12712f21d2b4521b6e3d1caff50bed21ff)
* FIX:thumbnail update
jira: STUDIO-13041 / STUDIO-13304
Change-Id: I9dec25f12454fc8485195cf5dc3feb421b6347c4
(cherry picked from commit cf778dc90f805d3f46e28f8f1d1d5814d3fb4d51)
---------
Co-authored-by: jun.zhang <jun.zhang@bambulab.com>
96 lines
2.0 KiB
C++
96 lines
2.0 KiB
C++
#ifndef slic3r_IMToolbar_hpp_
|
|
#define slic3r_IMToolbar_hpp_
|
|
|
|
#include <functional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "GLTexture.hpp"
|
|
#include "Event.hpp"
|
|
#include <imgui/imgui.h>
|
|
|
|
#define DEFAULT_TOOLBAR_BUTTON_WIDTH 80.0f
|
|
#define DEFAULT_TOOLBAR_BUTTON_HEIGHT 80.0f
|
|
|
|
namespace Slic3r {
|
|
namespace GUI {
|
|
|
|
class IMToolbarItem
|
|
{
|
|
public:
|
|
enum SliceState {
|
|
UNSLICED = 0,
|
|
SLICING = 1,
|
|
SLICED = 2,
|
|
SLICE_FAILED = 3,
|
|
};
|
|
|
|
bool selected{ false };
|
|
float percent;
|
|
GLTexture image_stats;
|
|
GLTexture image_slicing;
|
|
GLTexture image_idle;
|
|
GLTexture image_failed;
|
|
SliceState slice_state;
|
|
|
|
ImTextureID texture_id { 0 };
|
|
std::vector<unsigned char> image_data;
|
|
unsigned int image_width;
|
|
unsigned int image_height;
|
|
|
|
bool generate_texture();
|
|
~IMToolbarItem();
|
|
};
|
|
|
|
class IMToolbar {
|
|
private:
|
|
bool m_enabled { false };
|
|
|
|
public:
|
|
float icon_width;
|
|
float icon_height;
|
|
bool is_display_scrollbar;
|
|
bool show_stats_item{ false };
|
|
IMToolbar() {
|
|
icon_width = DEFAULT_TOOLBAR_BUTTON_WIDTH;
|
|
icon_height = DEFAULT_TOOLBAR_BUTTON_HEIGHT;
|
|
}
|
|
|
|
void del_all_item();
|
|
void del_stats_item();
|
|
|
|
IMToolbarItem* m_all_plates_stats_item = nullptr;
|
|
std::vector<IMToolbarItem*> m_items;
|
|
float fontScale;
|
|
|
|
bool is_enabled() const { return m_enabled; }
|
|
void set_enabled(bool enable);
|
|
|
|
void set_icon_size(float width, float height) {
|
|
icon_width = width;
|
|
icon_height = height;
|
|
}
|
|
|
|
int get_items_count() { return m_items.size(); }
|
|
};
|
|
|
|
class IMReturnToolbar {
|
|
private:
|
|
bool m_enabled{ false };
|
|
ImTextureID texture_id;
|
|
GLTexture return_textrue;
|
|
|
|
public:
|
|
IMReturnToolbar() {}
|
|
|
|
bool init();
|
|
bool is_enabled() const { return m_enabled; }
|
|
void set_enabled(bool enable) { m_enabled = enable; }
|
|
ImTextureID get_return_texture_id() { return texture_id; }
|
|
};
|
|
|
|
} // namespace GUI
|
|
} // namespace Slic3r
|
|
|
|
#endif // slic3r_IMToolbar_hpp_
|