mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-19 21:51:06 +00:00
Add a themed WebView color picker with persistent favorites (#16197)
* Define validated color picker selection contract * Integrate web color picker with gradient and alpha controls Co-authored-by: yw4z <ywsyildiz@gmail.com> * Apply shared Orca theme to web color picker * Host color picker in a validated WebView dialog * Persist color picker favorites in user preferences * Integrate localized web color picker with filament actions * Add color picker browser regressions and verify direct includes * Fit color picker content in a borderless floating panel * Anchor color picker panels to their triggering controls * Use accent foreground for selected color picker switches * Integrate web color picker into generic color fields * Use web color picker for AMS custom colors * Use shared web color picker from Linux sidebar menu * Use web color picker when adding texture import material * Preserve alpha in filament color picker actions * Clean up color picker asset whitespace * Use application translations for color picker validation * Preserve existing formatting in color picker integration * Match SpeedDial rounded window handling on macOS * Align color picker host behavior with SpeedDial * Consolidate color picker implementation into its dialog * Remove native color picker fallback * Limit color picker interfaces to production consumers * Use shared WebView translation field name * Reapply anchored color picker placement after GTK show * update * fix increment buttons not working on spin inputs * Use thumb color from its own channel * init gradients with shifted color for second color * fix hsl sliders cannot move freely and lock downs other one * unify save button and color preview & increase stored color count to 32 * switch to hsl based calculation and fix plot and slider drag events * update * add support for multi colored gradients * Update test_filament_color_picker.cpp * add filtering color palette and store sidebar and combo state * open dialog with calculated size * apply shadow to dialog on windows * add tooltip for gradient add color button * Restore draggable fixed-size color picker frame * Fix color picker sidebar sizing in WebKit * Fix invisible default filament color button on macOS * Remove duplicated color defs for color picker * Remove duplicate HTML color picker frame * Match color picker tests to current theme roles * update icons * use focus color on background of filter box * align gradient switch with hex input * fix initial window sizing * Preserve caller color order when drawing filament icons --------- Co-authored-by: yw4z <ywsyildiz@gmail.com>
This commit is contained in:
1 parent
5d73410281
commit
26f5fd6251
29 files changed
+4066
-449
No files matched your search
@@ -19,7 +19,7 @@
|
||||
#include <wx/dcclient.h>
|
||||
#include <wx/dcmemory.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/colourdata.h>
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/anybutton.h>
|
||||
#include <wx/object.h>
|
||||
#include <wx/popupwin.h>
|
||||
@@ -630,43 +630,6 @@ std::vector<std::vector<std::string>> read_color_pack(std::vector<std::string> c
|
||||
return color_info;
|
||||
}
|
||||
|
||||
wxColourData show_sys_picker_dialog(wxWindow *parent, const wxColourData &clr_data)
|
||||
{
|
||||
wxColourData data = clr_data;
|
||||
data.SetChooseFull(true);
|
||||
|
||||
// Load custom colors from config (support both "r,g,b,a" and "#RRGGBB" formats)
|
||||
std::vector<std::string> colors = Slic3r::GUI::wxGetApp().app_config->get_custom_color_from_config();
|
||||
for (int i = 0; i < (int)colors.size(); i++) {
|
||||
wxColour c;
|
||||
if (colors[i].find(',') != std::string::npos)
|
||||
c = string_to_wxColor(colors[i]);
|
||||
else
|
||||
c = wxColour(colors[i]);
|
||||
if (c.IsOk())
|
||||
data.SetCustomColour(i, c);
|
||||
}
|
||||
|
||||
wxColourDialog dialog(parent, &data);
|
||||
dialog.SetTitle(_L("Please choose the filament color"));
|
||||
|
||||
if (dialog.ShowModal() == wxID_OK) {
|
||||
data = dialog.GetColourData();
|
||||
|
||||
// Save custom colors to config (use RGBA string format for consistency)
|
||||
std::vector<std::string> colors;
|
||||
colors.resize(CUSTOM_COLOR_COUNT);
|
||||
for (int i = 0; i < CUSTOM_COLOR_COUNT; i++) {
|
||||
wxColour custom_clr = data.GetCustomColour(i);
|
||||
if (custom_clr.IsOk())
|
||||
colors[i] = color_to_string(custom_clr);
|
||||
}
|
||||
Slic3r::GUI::wxGetApp().app_config->save_custom_color_to_config(colors);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
wxBitmap *get_extruder_color_icon(std::vector<std::string> colors, bool is_gradient, std::string label, int icon_width, int icon_height,
|
||||
const std::vector<wxColour> *ramp){
|
||||
|
||||
|
||||
Reference in new issue
Block a user