Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

Palette bar: File and Edit first, then A to Z

islandmed5e7e9bd71afe
diff --git a/src/app/Config.cpp b/src/app/Config.cpp
index 60069eb8..9bec1a7b 100644
--- a/src/app/Config.cpp
+++ b/src/app/Config.cpp
@@ -43,6 +43,7 @@ Json toJson(const UiPrefs& p) {
j.set("lightboxAtStartup", p.lightboxAtStartup);
j.set("libraryFolder", p.libraryFolder);
j.set("cameraNotch", double(p.cameraNotch));
+ j.set("alphabeticalPalettes", p.alphabeticalPalettes);
return j;
}
@@ -58,6 +59,7 @@ void fromJson(const Json& j, UiPrefs& p) {
p.lightboxAtStartup = j["lightboxAtStartup"].asBool(p.lightboxAtStartup);
if (j["libraryFolder"].isString()) p.libraryFolder = j["libraryFolder"].asString();
p.cameraNotch = std::clamp(int(j["cameraNotch"].asNumber(p.cameraNotch)), 0, 2);
+ p.alphabeticalPalettes = j["alphabeticalPalettes"].asBool(p.alphabeticalPalettes);
}
namespace {
@@ -688,6 +690,11 @@ void drawInterfaceSection(App& app) {
ImGui::Checkbox("Auto collapse right tray", &p.autoCollapseRight);
ui::HelpText("Auto collapse right tray", nullptr,
"Opening a palette in the right tray collapses the others when they would not fit.", "Preferences > Interface");
+ ImGui::Checkbox("Palettes strictly A-Z (ZBrush order)", &p.alphabeticalPalettes);
+ ui::HelpText("Palettes strictly A-Z", nullptr,
+ "Off: File and Edit come first in the palette bar, then the rest A to Z. On: every palette A to Z, as in "
+ "ZBrush.",
+ "Preferences > Interface");
ImGui::Checkbox("Left-handed layout", &app.layout().leftHanded);
ui::HelpText("Left-handed layout", nullptr, "Mirror the shelves and trays: tools on the left, navigation on the right.",
"Preferences > Interface");
diff --git a/src/app/Config.h b/src/app/Config.h
index 0319dc23..ef379b71 100644
--- a/src/app/Config.h
+++ b/src/app/Config.h
@@ -25,6 +25,7 @@ struct UiPrefs {
float uiScale = 0.0f; // 0 = follow the display; otherwise applied at the next start
bool lightboxAtStartup = true;
std::string libraryFolder; // "" = Documents/SculptForge
+ bool alphabeticalPalettes = false; // strict A-Z palette bar like ZBrush (default: File, Edit first)
int cameraNotch = 0; // keep the UI out of a laptop's camera notch: 0 automatic, 1 always, 2 never
};
diff --git a/src/app/Shell.cpp b/src/app/Shell.cpp
index 6ec14bed..3e38633a 100644
--- a/src/app/Shell.cpp
+++ b/src/app/Shell.cpp
@@ -782,8 +782,18 @@ void App::drawPaletteBar(const ShellGeometry& g) {
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 0.0f);
int count = 0;
const PaletteDef* list = palettes(count);
- for (int i = 0; i < count; ++i) {
- const PaletteDef& p = list[i];
+ // File and Edit first, where every other desktop app has them, then the rest A to Z. ZBrush purists can
+ // switch to strict alphabetical order in Preferences > Interface.
+ std::vector<int> order;
+ if (!uiPrefs_.alphabeticalPalettes)
+ for (const char* first : {"file", "edit"})
+ for (int i = 0; i < count; ++i)
+ if (std::string_view(list[i].id) == first) order.push_back(i);
+ for (int i = 0; i < count; ++i)
+ if (std::find(order.begin(), order.end(), i) == order.end()) order.push_back(i);
+ for (size_t k = 0; k < order.size(); ++k) {
+ const int i = int(k);
+ const PaletteDef& p = list[order[k]];
const bool inTray = std::count(layout_.leftTray.begin(), layout_.leftTray.end(), p.id) +
std::count(layout_.rightTray.begin(), layout_.rightTray.end(), p.id) >
0;
@@ -792,7 +802,7 @@ void App::drawPaletteBar(const ShellGeometry& g) {
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, theme::headerHover);
ImGui::PushStyleColor(ImGuiCol_ButtonActive, theme::header);
ImGui::PushStyleColor(ImGuiCol_Text, inTray ? theme::accent : open ? theme::textOnAccent : theme::text);
- if (i) ImGui::SameLine();
+ if (i) ImGui::SameLine(0.0f, k == 2 && !uiPrefs_.alphabeticalPalettes ? 10.0f * s : -1.0f); // gap after File, Edit
const std::string label = std::string(p.name) + "##palette." + p.id;
// While a drop-down is open, the click that closes it (ImGui swallows that one) opens another palette
// when it lands on that palette's name, as in a menu bar; on the open palette's own name it just closes.