unify orca web dialog style

This commit is contained in:
SoftFever
2026-07-05 01:17:17 +08:00
parent 383969d456
commit 5d8aa9610a
22 changed files with 439 additions and 544 deletions

View File

@@ -3,6 +3,7 @@
#include "GUI.hpp"
#include "GUI_Utils.hpp"
#include "Widgets/WebViewHostDialog.hpp"
#include "libslic3r/AppConfig.hpp"
#include <boost/thread/detail/thread.hpp>
#include <libslic3r/PresetBundle.hpp>
@@ -15,7 +16,6 @@
#include <wx/language.h>
#include <wx/string.h>
#include <wx/fswatcher.h>
#include <wx/webview.h>
namespace Slic3r { namespace GUI {
#define DESIGN_GRAY900_COLOR wxColour("#363636") // Label color
@@ -28,7 +28,7 @@ namespace Slic3r { namespace GUI {
#define DESIGN_INPUT_SIZE wxSize(FromDIP(120), -1)
#define DESIGN_LEFT_MARGIN 25
#define VERTICAL_GAP_SIZE FromDIP(4)
class PresetBundleDialog : public Slic3r::GUI::DPIDialog
class PresetBundleDialog : public Slic3r::GUI::WebViewHostDialog
{
public:
PresetBundleDialog(wxWindow* parent,
@@ -47,10 +47,8 @@ public:
bool seq_top_layer_only_changed() const { return m_seq_top_layer_only_changed; }
bool recreate_GUI() const { return m_recreate_GUI; }
void on_dpi_changed(const wxRect& suggested_rect) override;
// webview utilities
void load_url(wxString& url);
void ListBundles();
void OpenFolder(const std::string& id);
void DeleteBundle(const std::string& id);
@@ -59,11 +57,8 @@ public:
void OnPresetBundlePage();
// sends command to webview
void RunScript(const wxString& s);
// webview events
void OnScriptMessage(wxWebViewEvent& e);
void on_script_message(const nlohmann::json& payload) override;
void StartDialogWorker();
void StopDialogWorker();
@@ -86,7 +81,6 @@ protected:
bool m_recreate_GUI{false};
// Webview
wxWebView* m_browser{nullptr};
std::unordered_map<std::string, BundleMetadata> bundle_copy;
boost::thread m_dialog_worker_thread;