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.
C++ 3d3d-sculptingcppdear-imguidigital-sculptingfbxgame-developmentgaussian-splattinggltfimage-to-3dmcpopenglopenusdsculptingtext-to-3dunreal-engine
UI polish round 2: readable options, one row height, choices by meaning, quiet sliders
islandmed551998b71608
diff --git a/docs/ui-design.md b/docs/ui-design.mdindex c70117db..e3e1dd7a 100644--- a/docs/ui-design.md+++ b/docs/ui-design.md@@ -485,11 +485,14 @@ Keep the existing orange accent, but only for **one thing per group**: the curre| `header` | `#2b2b2f` / hover `#37373c` | palette and sub-palette headers || `frame` | `#28282c` / hover `#323237` | slider and input frames || `button` | `#333337` / hover `#414146` / pressed `#4e4e55` | buttons |-| `accent` | `#f0882e` (hover `#ff9a45`) | the **current tool or mode** of a group (bg accent, text `#ffffff`): Draw/Move/Scale/Rotate, Sculpt/Paint, the brush, MaskPen/MaskLasso...; slider grab and bar, check marks, LightBox active tab |-| `toggleOn` | `#4a4a50` (hover `#56565c`), text `textBright` `#f2f2f2` | options that are on (Zadd, X, Pressure > Strength, Mask, Menus): raised grey with a 2 px accent underline (a side bar on the right shelf), never a solid accent fill |-| `trough` | `#242428` | unselected segments of a mode group; the 1 2 3 presets |-| `selection` | accent at 18% | selected list rows (`ImGuiCol_Header`), with a 2 px accent bar on the left |-| `text` / `textDim` | `#d8d8d8` / `#8c8c90` | |+| `accent` | `#f0882e` (hover `#ff9a45`) | the **current tool or mode** of a group (bg accent, text `#ffffff`): Draw/Move/Scale/Rotate, Sculpt/Paint, the brush, MaskPen/MaskLasso...; the 2 px underline of an option that is on; a slider bar only while dragging; LightBox active tab |+| `toggleOff` | `#29292e` (hover `#36363c`), text `textOff` `#b4b4b9` (6.9:1) | options that are off: a dark chip with a readable label, so off never looks disabled (disabled is faded by alpha) |+| `toggleOn` | `#4c4c53` (hover `#58585f`), text `textBright` `#f2f2f2` | options that are on (X, Rgb, Pressure > Strength, Mask, Menus): raised grey with a 2 px accent underline (a side bar on the right shelf), never a solid accent fill. Also the chosen side of a **choice** (`ui::IsChoiceAction`: Zadd \| Zsub), without the underline |+| `trough` | `#2c2c31` | unselected segments of a mode or choice group |+| `selection` | `#3a3a41` (active `#45454c`) | selected list rows (`ImGuiCol_Header`): a lighter neutral row, with a 2 px accent bar on the left where the list draws one |+| `sliderFill` / `sliderBar` | white 9% / `#85858c` | the filled part of a `SliderInside` and the thin bar along its bottom (accent while dragging); plain slider grabs are `sliderBar` too |+| `checkMark` / `checkBorder` | `#e6e6e8` / `#55555c` | check marks (neutral); the outline of an unchecked box (`ui::Checkbox`) |+| `text` / `textOff` / `textDim` | `#d8d8d8` / `#b4b4b9` / `#8c8c90` | || `border` | `#111113` | 1 px between regions || `danger` | `#e5604a` | errors || canvas | neutral charcoal, soft radial vignette (`kBgFS`); 1 px `#0e0e10` frame; default material Soft Clay (matte warm grey) | |@@ -498,7 +501,9 @@ Style:- Rounding: `WindowRounding 0` (shells), `PopupRounding 6`, `FrameRounding 3`, `GrabRounding 2`.- Spacing: `FramePadding (6,3)`, `ItemSpacing (4,4)`, `ItemInnerSpacing (4,4)`.- `ScrollbarSize 10`, `GrabMinSize 6`.-- Top shelf hierarchy: mode groups full size on a trough; options 12 px, 22 px high, dim until on; LightBox / AI Brush plain buttons. The title strip's QuickSave, 1 2 3 and Menus have no fill until hovered; its readout is 12 px.+- Top shelf hierarchy, by meaning: every item is the full row height in the 15 px font, so both rows share one baseline. Modes (Draw \| Move \| Scale \| Rotate, Sculpt \| Paint) and choices (Zadd \| Zsub) are 1 px-gap segments on `trough`; options (Front, Dynamic, X/Y/Z, Rgb, Pressure...) are separate `toggleOff` chips; LightBox / AI Brush plain buttons. The ActiveTris / TotalTris readout is one 12 px line on the row's centre line. The Draw palette uses the same looks (Pressure toggles are buttons there too) and 12 px dim section labels with a hairline.+- Title strip: QuickSave, 1 2 3 and Menus are `toggleOff` chips; the readout is 12 px `textDim`, the status message 15 px `textBright` so it stands out.+- Palette drop-downs open below the top shelf (under the palette bar when Tab hides the shelves), never over the tool rows.- Font: Inter Regular 15 x scale (as now). Shelf labels and tile captions 12 px (a second Inter size), help titles Inter SemiBold 15, console ProggyClean 13.- Trays: sub-palette headers are quiet (no fill until hovered or open, a small chevron, a hairline under each); the accent is not used on them. The active row of a list (SubTools) is the accent at ~15% with a 2 px accent bar on its left, not a solid fill. Helper text is 12 px `textDim`.- The left tray's colour field is drawn by hand (`App::drawColorWidget`, Pickers.cpp): a rounded saturation/value square with a ring marker, an 8 px hue strip with a thin pill notch, and the main/second swatches with a 1 px edge.diff --git a/src/app/Palettes.cpp b/src/app/Palettes.cppindex 7bd18d54..fe8cbb96 100644--- a/src/app/Palettes.cpp+++ b/src/app/Palettes.cpp@@ -103,6 +103,30 @@ void hint(const App& app, const char* text) {if (app.smallFont()) ImGui::PopFont();}+// A row of option toggles drawn like the top shelf's (Rgb, Front, Dynamic, Pressure > ...): dark chips with a readable+// label, raised with an accent underline when on (ui::ActionButton).+void drawOptionRow(App& app, std::initializer_list<const char*> ids) {+ ImGui::PushStyleColor(ImGuiCol_Button, theme::toggleOff);+ ImGui::PushStyleColor(ImGuiCol_ButtonHovered, theme::toggleOffHover);+ ImGui::PushStyleColor(ImGuiCol_Text, theme::textOff);+ actionRow(app, ids);+ ImGui::PopStyleColor(3);+}++// A section inside a palette ("Dynamic topology", "Tablet"): a small dim label and a hairline to the right edge,+// with a little air above, instead of ImGui's SeparatorText.+void sectionLabel(const App& app, const char* text) {+ const float s = ImGui::GetFontSize() / 15.0f;+ ImGui::Dummy(ImVec2(0, 3.0f * s));+ if (app.smallFont()) ImGui::PushFont(app.smallFont());+ const ImVec2 p = ImGui::GetCursorScreenPos();+ ImGui::TextColored(theme::textDim, "%s", text);+ const float x = ImGui::GetItemRectMax().x + 8.0f * s, y = std::floor((ImGui::GetItemRectMin().y + ImGui::GetItemRectMax().y) * 0.5f);+ const float right = p.x + ImGui::GetContentRegionAvail().x;+ if (right > x) ImGui::GetWindowDrawList()->AddLine(ImVec2(x, y + 0.5f), ImVec2(right, y + 0.5f), theme::u32(theme::sectionRule));+ if (app.smallFont()) ImGui::PopFont();+}+} // namespacebool App::subpalette(const char* id, const char* title) {@@ -198,14 +222,17 @@ void App::drawPalette_Draw() {"The brush falloff: below 0 a broad, hard tip, above 0 a soft point. The brush cursor's inner ring shows ""where the brush works at half strength.","Draw");+ // The same looks as the top shelf: Sculpt | Paint is a mode (the accent), Zadd | Zsub a choice (raised grey),+ // the rest options (dark chips, an underline when on). Sliders stay neutral, so the accent marks one thing.+ ImGui::Dummy(ImVec2(0, 2.0f * uiScale_));segmented(*this, {"draw.sculpt", "draw.paint"});segmented(*this, {"draw.zadd", "draw.zsub"});- actionRow(*this, {"draw.rgb", "draw.front_faces"});- ImGui::SeparatorText("Dynamic topology");- actionRow(*this, {"draw.dynamic"});+ drawOptionRow(*this, {"draw.rgb", "draw.front_faces"});+ sectionLabel(*this, "Dynamic topology");+ drawOptionRow(*this, {"draw.dynamic"});ImGui::SetNextItemWidth(-1);drawDetailSlider("##dyntopo_detail_palette");- if (ImGui::Checkbox("Constant detail", &uiPrefs_.dyntopoConstantDetail))+ if (ui::Checkbox("Constant detail", &uiPrefs_.dyntopoConstantDetail))doc_.sculptor.dyntopo.constantDetail = uiPrefs_.dyntopoConstantDetail;ui::HelpText("Constant detail", nullptr,"Off (the default): the triangle size follows the brush size on screen, as in Sculptris Pro. On: one "@@ -214,13 +241,17 @@ void App::drawPalette_Draw() {if (doc_.sculptor.dyntopo.enabled && !dyntopoBlocker(doc_.mesh).empty())hint(*this, "This SubTool has subdivision levels, so strokes don't remesh it: delete the lower (or higher) levels ""first.");- ImGui::SeparatorText("Tablet");- ImGui::Checkbox("Pressure > strength", &pressureStrength_);- ui::HelpAction(*this, "draw.pressure_strength");- ImGui::Checkbox("Pressure > size", &pressureSize_);- ui::HelpAction(*this, "draw.pressure_size");- if (penSeen_) ImGui::Text("Pen pressure: %.2f", uiPrefs_.tablet.curve.apply(penTracker_.raw()));- else ImGui::TextDisabled("No pen detected");+ // Tablet: the same Pressure > Strength / Size toggles as the top shelf (not checkboxes), and the pen state as+ // a hint line.+ sectionLabel(*this, "Tablet");+ drawOptionRow(*this, {"draw.pressure_strength", "draw.pressure_size"});+ if (penSeen_) {+ char pen[48];+ std::snprintf(pen, sizeof pen, "Pen pressure: %.2f", uiPrefs_.tablet.curve.apply(penTracker_.raw()));+ hint(*this, pen);+ } else {+ hint(*this, "No pen detected");+ }}void App::drawPalette_Edit() {diff --git a/src/app/Shell.cpp b/src/app/Shell.cppindex 7fe6729f..fe794a01 100644--- a/src/app/Shell.cpp+++ b/src/app/Shell.cpp@@ -160,6 +160,8 @@ std::string elide(ImFont* font, const std::string& text, float width) {return s + "...";}+constexpr float kPointsReadoutW = 190.0f; // the ActiveTris / TotalTris readout at the right of the top shelf, unscaled+bool segmentPair(const std::string& a, const std::string& b) {auto group = [](const std::string& id) {if (id == "draw.sculpt" || id == "draw.paint") return 1;@@ -209,7 +211,9 @@ bool drawShelfTile(App& app, const Action& a, ImVec2 size) {: held ? theme::buttonPressed : hovered ? theme::buttonHover : theme::frame;dl->AddRectFilled(p0, p1, theme::u32(bg, alpha), 4.0f * s);if (on && !mode) ui::DrawOnMark(dl, p0, p1, true);- const ImU32 fg = theme::u32(on ? (mode ? theme::textOnAccent : theme::textBright) : hovered || !a.checked ? theme::text : theme::textDim, alpha);+ // Two text levels only: actions and hovered items in text, options that are off in textOff (readable, so+ // off doesn't look disabled); disabled items are faded by alpha.+ const ImU32 fg = theme::u32(on ? (mode ? theme::textOnAccent : theme::textBright) : hovered || !a.checked ? theme::text : theme::textOff, alpha);centredText(dl, app.fontIcons_, p0, ImVec2(p1.x, p1.y - capH + 2.0f * s), fg, a.icon ? a.icon : "?");centredText(dl, caption, ImVec2(p0.x, p1.y - capH), ImVec2(p1.x, p1.y - 1.0f * s), fg,elide(caption ? caption : ImGui::GetFont(), a.label, size.x - 2.0f * s).c_str());@@ -735,38 +739,37 @@ void App::drawTitleStrip(const ShellGeometry& g) {ImGui::SetCursorPosX(slotX + fpsSlot);const std::string& msg = layout_.customize ? std::string("Customize: Ctrl+Alt+drag to move or remove items") : status_;if (!msg.empty() && avail - infoW > 60.0f * s) {+ // The status message is what just happened, so it stands out from the readout: the regular font, in+ // the bright text colour (still elided to the space the small-font readout leaves).ImGui::SameLine(0.0f, 20.0f * s);+ if (fontSmall_) ImGui::PopFont();+ ImGui::SetCursorPosY(std::floor((h - ImGui::GetTextLineHeight()) * 0.5f));const bool error = !layout_.customize && !lastCommandOk_ && ImGui::GetTime() - statusSince_ < 6.0;- ImGui::PushStyleColor(ImGuiCol_Text, layout_.customize ? theme::accent : error ? theme::danger : theme::text);+ ImGui::PushStyleColor(ImGuiCol_Text, layout_.customize ? theme::accent : error ? theme::danger : theme::textBright);ImGui::TextUnformatted(elide(ImGui::GetFont(), msg, avail - infoW - 20.0f * s).c_str());ImGui::PopStyleColor();if (ImGui::IsItemHovered() && msg.size() > 40) ImGui::SetTooltip("%s", msg.c_str());+ if (fontSmall_) ImGui::PushFont(fontSmall_);}} else {ImGui::TextDisabled("%s", elide(ImGui::GetFont(), info, std::max(0.0f, avail)).c_str());}if (fontSmall_) ImGui::PopFont();- // QuickSave, the layout presets and Menus are quiet: no fill until hovered, dim labels, so the title strip- // doesn't compete with the shelves (Menus on is an option: raised grey with an underline).+ // QuickSave, the layout presets and Menus are small dark chips with readable labels: buttons, but quieter than+ // the shelves (Menus on is an option: raised grey with an underline). 1 2 3 are segments of one control.ImGui::SetCursorPos(ImVec2(rightX, (h - buttonH) * 0.5f));- ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));- ImGui::PushStyleColor(ImGuiCol_ButtonHovered, theme::headerHover);- ImGui::PushStyleColor(ImGuiCol_Text, theme::textDim);+ ImGui::PushStyleColor(ImGuiCol_Button, theme::toggleOff);+ ImGui::PushStyleColor(ImGuiCol_ButtonHovered, theme::toggleOffHover);+ ImGui::PushStyleColor(ImGuiCol_Text, theme::textOff);if (quickSave) {ui::ActionButton(*this, "file.quicksave", ImVec2(0, buttonH));ImGui::SameLine(0.0f, 8.0f * s);}- {- // 1 2 3 read as one control on a trough.- const ImVec2 p = ImGui::GetCursorScreenPos();- const float segW = buttonH + 2.0f * s;- dl->AddRectFilled(p, ImVec2(p.x + 3.0f * segW + 2.0f * 2.0f * s, p.y + buttonH), theme::u32(theme::trough), 3.0f * s);- }for (int i = 1; i <= 3; ++i) {ui::ActionButton(*this, ("ui.preset." + std::to_string(i)).c_str(), ImVec2(buttonH + 2.0f * s, buttonH));ui::HelpAction(*this, ("ui.preset." + std::to_string(i)).c_str());- ImGui::SameLine(0.0f, 2.0f * s);+ ImGui::SameLine(0.0f, i < 3 ? 1.0f * s : 4.0f * s); // 6 px in all, as rightW counts}ImGui::SameLine(0.0f, 8.0f * s);ui::ActionButton(*this, "ui.menus", ImVec2(0, buttonH), ui::Look::IconLabel);@@ -969,9 +972,12 @@ void App::drawPaletteDropdown() {const float s = uiScale_;const ImGuiViewport* vp = ImGui::GetMainViewport();const float w = 300.0f * s;- ImGui::SetNextWindowPos(ImVec2(std::clamp(dropdownX_, 4.0f * s, vp->Size.x - w - 4.0f * s),- shell_.paletteBar.y + shell_.paletteBar.h));- ImGui::SetNextWindowSizeConstraints(ImVec2(w, 0), ImVec2(w, vp->Size.y - 60.0f * s));+ // Below the top shelf, not over it: the palette drops past the tool rows onto the canvas, so Draw | Move |+ // Sculpt and the sliders stay visible and usable while it is open (Tab hides the shelves: then under the bar).+ const CanvasRect& top = shell_.topShelf;+ const float y = top.h > 0.0f ? top.y + top.h + 2.0f * s : shell_.paletteBar.y + shell_.paletteBar.h;+ ImGui::SetNextWindowPos(ImVec2(std::clamp(dropdownX_, 4.0f * s, vp->Size.x - w - 4.0f * s), y));+ ImGui::SetNextWindowSizeConstraints(ImVec2(w, 0), ImVec2(w, vp->Size.y - y - 8.0f * s));// Whole-pixel padding: auto-fit truncates sizes, and a fraction of a pixel too little shows a scrollbar.ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(std::round(6.0f * s), std::round(6.0f * s)));const bool open = ImGui::BeginPopup("##palettedropdown");@@ -1121,7 +1127,7 @@ void App::drawShelf(int shelf, const CanvasRect& r) {ImGui::SameLine(0.0f, prev == "sep" || item == "sep" ? 0.0f : segmentPair(prev, item) ? 1.0f * s : 4.0f * s);}if (!vertical && item == "widget.points") { // right-aligned readout- const float w = 170.0f * s;+ const float w = kPointsReadoutW * s;ImGui::SameLine(std::max(ImGui::GetCursorPosX(), ImGui::GetWindowContentRegionMax().x - w));}lineStart = false;@@ -1255,18 +1261,26 @@ void App::drawShelfItem(int shelf, int index, const std::string& item, bool vert}}const size_t active = activeTris_;+ // One line on the row's centre line, right-aligned to the shelf edge: "ActiveTris 20.5k TotalTris 20.5k".ImGui::BeginGroup();if (fontSmall_) ImGui::PushFont(fontSmall_);- const float lineH = ImGui::GetTextLineHeight();const ImVec2 p = ImGui::GetCursorScreenPos();- ImGui::Dummy(ImVec2(170.0f * s, rowH));+ ImGui::Dummy(ImVec2(kPointsReadoutW * s, rowH));ImDrawList* dl = ImGui::GetWindowDrawList();- const float y0 = p.y + (rowH - 2.0f * lineH) * 0.5f;- dl->AddText(ImVec2(p.x, y0), theme::u32(theme::textDim), "ActiveTris");- dl->AddText(ImVec2(p.x, y0 + lineH), theme::u32(theme::textDim), "TotalTris");const std::string a = shortCount(active), t = shortCount(total);- dl->AddText(ImVec2(p.x + 70.0f * s, y0), theme::u32(theme::text), a.c_str());- dl->AddText(ImVec2(p.x + 70.0f * s, y0 + lineH), theme::u32(theme::text), t.c_str());+ const float gap = 5.0f * s, groupGap = 14.0f * s;+ const float w = ImGui::CalcTextSize("ActiveTris").x + ImGui::CalcTextSize(a.c_str()).x + ImGui::CalcTextSize("TotalTris").x ++ ImGui::CalcTextSize(t.c_str()).x + 2.0f * gap + groupGap;+ float x = std::floor(p.x + kPointsReadoutW * s - w);+ const float y = std::floor(p.y + (rowH - ImGui::GetTextLineHeight()) * 0.5f);+ auto put = [&](const char* text, const ImVec4& col, float after) {+ dl->AddText(ImVec2(x, y), theme::u32(col), text);+ x += ImGui::CalcTextSize(text).x + after;+ };+ put("ActiveTris", theme::textDim, gap);+ put(a.c_str(), theme::text, groupGap);+ put("TotalTris", theme::textDim, gap);+ put(t.c_str(), theme::text, 0.0f);ImGui::LogText("ActiveTris %s TotalTris %s", a.c_str(), t.c_str());if (fontSmall_) ImGui::PopFont();ImGui::EndGroup();@@ -1343,40 +1357,31 @@ void App::drawShelfItem(int shelf, int index, const std::string& item, bool vert: shelf == kShelfBottom ? ImVec2(bottomTileW_, 54.0f * s): ImVec2(winW - 2.0f * padX, 60.0f * s);centre(size.x);- // Top shelf hierarchy: the mode groups (Draw | Move | Scale | Rotate, Sculpt | Paint) are full-size- // segments on a dark trough with the current one in the accent; options (Zadd, X, Pressure...) are- // smaller, dimmer and in the 12 px font; the rest (LightBox, AI Brush) are plain buttons.- const bool mode = ui::IsModeAction(a->id);- const bool option = !mode && a->checked && a->id.rfind("ui.", 0) != 0;- ImVec2 itemSize = size;+ // Top shelf hierarchy, by meaning (docs/ui-design.md §10). Every item is the full row height in the same+ // font, so both rows share one baseline. Mode groups (Draw | Move | Scale | Rotate, Sculpt | Paint) and+ // choices (Zadd | Zsub) are segments a step above the shelf: the current mode in the accent, the chosen+ // side of a choice a raised grey. Options (X, Rgb, Pressure...) are separate dark chips with a readable+ // label, raised with an accent underline when on. The rest (LightBox, AI Brush) are plain buttons.+ const bool segment = ui::IsModeAction(a->id) || ui::IsChoiceAction(a->id);+ const bool option = !segment && a->checked && a->id.rfind("ui.", 0) != 0;int colors = 0;- bool small = false;if (shelf == kShelfTop) {+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2((option ? 8.0f : 10.0f) * s, (rowH - ImGui::GetFontSize()) * 0.5f));if (option) {- itemSize.y = rowH - 4.0f * s;- ImGui::BeginGroup(); // centred in the row; the group keeps the next item on the row's top line- ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 2.0f * s);- small = fontSmall_ != nullptr;- if (small) ImGui::PushFont(fontSmall_);- ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(8.0f * s, (itemSize.y - ImGui::GetFontSize()) * 0.5f));- ImGui::PushStyleColor(ImGuiCol_Button, theme::frame);- ImGui::PushStyleColor(ImGuiCol_Text, theme::textDim);- colors = 2;- } else {- ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10.0f * s, (rowH - ImGui::GetFontSize()) * 0.5f));- if (mode) {- ImGui::PushStyleColor(ImGuiCol_Button, theme::trough);- colors = 1;- }+ ImGui::PushStyleColor(ImGuiCol_Button, theme::toggleOff);+ ImGui::PushStyleColor(ImGuiCol_ButtonHovered, theme::toggleOffHover);+ ImGui::PushStyleColor(ImGuiCol_Text, theme::textOff);+ colors = 3;+ } else if (segment) {+ ImGui::PushStyleColor(ImGuiCol_Button, theme::trough);+ colors = 1;}}ui::SetNextItemOrigin(shelf, index); // ActionButton is the Ctrl+Alt drag source, from this shelf slot- ui::ActionButton(*this, a->id.c_str(), itemSize, look);+ ui::ActionButton(*this, a->id.c_str(), size, look);if (shelf == kShelfTop) {ImGui::PopStyleColor(colors);ImGui::PopStyleVar();- if (small) ImGui::PopFont();- if (option) ImGui::EndGroup();}} else {ImGui::Dummy(ImVec2(0, 0)); // an id this version doesn't know: keep its place in the listdiff --git a/src/app/Theme.cpp b/src/app/Theme.cppindex 55929723..06a66643 100644--- a/src/app/Theme.cpp+++ b/src/app/Theme.cpp@@ -48,15 +48,15 @@ void applyStyle() {c[ImGuiCol_ScrollbarGrab] = rgb(0x48484e);c[ImGuiCol_ScrollbarGrabHovered] = rgb(0x58585f);c[ImGuiCol_ScrollbarGrabActive] = accent;- c[ImGuiCol_CheckMark] = accent;- c[ImGuiCol_SliderGrab] = accent;- c[ImGuiCol_SliderGrabActive] = accentHover;+ c[ImGuiCol_CheckMark] = checkMark; // neutral: the accent marks the current mode, not every option that is on+ c[ImGuiCol_SliderGrab] = sliderBar;+ c[ImGuiCol_SliderGrabActive] = accent; // the accent only while draggingc[ImGuiCol_Button] = button;c[ImGuiCol_ButtonHovered] = buttonHover;c[ImGuiCol_ButtonActive] = buttonPressed;- c[ImGuiCol_Header] = selection; // selected rows: a tint, not a solid bar (the accent is for the current tool)+ c[ImGuiCol_Header] = selection; // selected rows: a lighter neutral row (the accent is for the current tool)c[ImGuiCol_HeaderHovered] = headerHover;- c[ImGuiCol_HeaderActive] = rgb(0xf0882e, 0.28f);+ c[ImGuiCol_HeaderActive] = selectionActive;c[ImGuiCol_Separator] = rgb(0x3a3a3f);c[ImGuiCol_SeparatorHovered] = accentHover;c[ImGuiCol_SeparatorActive] = accent;diff --git a/src/app/Theme.h b/src/app/Theme.hindex 167ef9a9..2574fa69 100644--- a/src/app/Theme.h+++ b/src/app/Theme.h@@ -25,15 +25,26 @@ constexpr ImVec4 buttonPressed = rgb(0x4e4e55);// The accent marks one thing per group: the current tool or mode (Draw, Sculpt, the brush), plus grabs and checks.constexpr ImVec4 accent = rgb(0xf0882e);constexpr ImVec4 accentHover = rgb(0xff9a45);-// Options that are on (Zadd, X, Pressure > Strength, Mask...): a raised grey with a thin accent underline.-constexpr ImVec4 toggleOn = rgb(0x4a4a50);-constexpr ImVec4 toggleOnHover = rgb(0x56565c);-constexpr ImVec4 trough = rgb(0x242428); // the unselected segments of a mode group (Draw | Move | Scale | Rotate)-constexpr ImVec4 selection = rgb(0xf0882e, 0.18f); // selected list rows, with a 2 px accent bar on the left-constexpr ImVec4 sliderFill = rgb(0xffffff, 0.07f); // the filled part of a SliderInside, above its accent bar+// Options (X, Rgb, Pressure > Strength, Mask, Menus...): off is a dark chip with a readable label (not dim, so it+// doesn't look disabled); on is a raised grey with a bright label and a thin accent underline.+constexpr ImVec4 toggleOff = rgb(0x29292e);+constexpr ImVec4 toggleOffHover = rgb(0x36363c);+constexpr ImVec4 toggleOn = rgb(0x4c4c53);+constexpr ImVec4 toggleOnHover = rgb(0x58585f);+// The unselected segments of a mode or choice group (Draw | Move | Scale | Rotate, Zadd | Zsub): a step above the+// shelf, so the group reads as one control.+constexpr ImVec4 trough = rgb(0x2c2c31);+constexpr ImVec4 selection = rgb(0x3a3a41); // selected list rows: a lighter neutral row, with a 2 px accent bar on the left+constexpr ImVec4 selectionActive = rgb(0x45454c);+constexpr ImVec4 sliderFill = rgb(0xffffff, 0.09f); // the filled part of a SliderInside+constexpr ImVec4 sliderBar = rgb(0x85858c); // the thin bar along its bottom (the accent only while dragging)+constexpr ImVec4 checkMark = rgb(0xe6e6e8); // check marks and plain slider grabs: neutral, the accent is for modes+constexpr ImVec4 checkBorder = rgb(0x55555c); // the outline of an unchecked box, so it stays visible on panelBg+constexpr ImVec4 sectionRule = rgb(0x3a3a3f, 0.63f); // the hairline under a section header in a paletteconstexpr ImVec4 text = rgb(0xd8d8d8);constexpr ImVec4 textBright = rgb(0xf2f2f2); // labels of options that are on-constexpr ImVec4 textDim = rgb(0x8c8c90);+constexpr ImVec4 textOff = rgb(0xb4b4b9); // labels of options that are off: 6.9:1 on toggleOff+constexpr ImVec4 textDim = rgb(0x8c8c90); // secondary text and disabled labelsconstexpr ImVec4 textOnAccent = rgb(0xffffff);constexpr ImVec4 border = rgb(0x111113); // 1 px between regionsconstexpr ImVec4 danger = rgb(0xe5604a); // errorsdiff --git a/src/app/Ui.cpp b/src/app/Ui.cppindex a357117b..fad20b82 100644--- a/src/app/Ui.cpp+++ b/src/app/Ui.cpp@@ -115,6 +115,19 @@ bool IsModeAction(std::string_view id) {return starts("brush.") || starts("mask.") || starts("select.");}+bool IsChoiceAction(std::string_view id) { return id == "draw.zadd" || id == "draw.zsub"; }++bool Checkbox(const char* label, bool* v) {+ const bool changed = ImGui::Checkbox(label, v);+ if (!*v) {+ const ImVec2 a = ImGui::GetItemRectMin();+ const float sz = ImGui::GetFrameHeight();+ ImGui::GetWindowDrawList()->AddRect(a, ImVec2(a.x + sz, a.y + sz), theme::u32(theme::checkBorder),+ ImGui::GetStyle().FrameRounding, 0, std::max(1.0f, std::floor(uiScale())));+ }+ return changed;+}+void DrawOnMark(ImDrawList* dl, ImVec2 a, ImVec2 b, bool side) {const float w = std::max(1.0f, std::floor(theme::markWidth * uiScale() + 0.5f));const float r = ImGui::GetStyle().FrameRounding;@@ -244,8 +257,9 @@ bool ActionButton(App& app, const char* actionId, ImVec2 size, Look look) {if (look == Look::Icon && size.x <= 0.0f) size = ImVec2(ImGui::GetFrameHeight(), ImGui::GetFrameHeight());if (look == Look::Tile && size.x <= 0.0f) size = ImVec2(44.0f * s, 40.0f * s);- // On: the accent fill for the current mode, a raised grey with an accent underline for an option.- const bool mode = IsModeAction(id);+ // On: the accent fill for the current mode, a raised grey for the chosen side of a choice (Zadd | Zsub), a+ // raised grey with an accent underline for an option.+ const bool mode = IsModeAction(id), choice = IsChoiceAction(id);int colors = 0;if (checked) {ImGui::PushStyleColor(ImGuiCol_Button, mode ? theme::accent : theme::toggleOn);@@ -313,7 +327,7 @@ bool ActionButton(App& app, const char* actionId, ImVec2 size, Look look) {}ImGui::EndDisabled();if (colors) ImGui::PopStyleColor(colors);- if (checked && !mode && look != Look::Tile)+ if (checked && !mode && !choice && look != Look::Tile)DrawOnMark(ImGui::GetWindowDrawList(), ImGui::GetItemRectMin(), ImGui::GetItemRectMax());const bool customize = app.layout().customize;@@ -360,10 +374,18 @@ bool SliderInside(const char* id, float* v, float lo, float hi, const char* formt = std::clamp(t, 0.0f, 1.0f);const float rounding = ImGui::GetStyle().FrameRounding;dl->AddRectFilled(p, ImVec2(p.x + w, p.y + h), ImGui::GetColorU32(ImGuiCol_FrameBg), rounding);- dl->AddRectFilled(p, ImVec2(p.x + w * t, p.y + h), theme::u32(theme::sliderFill, active ? 1.6f : 1.0f), rounding);- const float bar = std::max(2.0f, std::floor(h * 0.1f));- dl->AddRectFilled(ImVec2(p.x, p.y + h - bar), ImVec2(p.x + w * t, p.y + h), active ? color::accentHover : color::accent,- rounding, ImDrawFlags_RoundCornersBottomLeft);+ // The position: a quiet fill and a thin neutral bar along the bottom, the accent only while dragging, so a+ // palette of sliders isn't a stack of orange lines (docs/ui-design.md §10). Nothing at the very start, where a+ // rounded sliver would show as a stray stub.+ const float fillW = std::floor(w * t);+ if (fillW >= 1.0f) {+ const bool full = fillW >= w - 0.5f;+ dl->AddRectFilled(p, ImVec2(p.x + fillW, p.y + h), theme::u32(theme::sliderFill, active ? 1.5f : 1.0f), rounding,+ full ? ImDrawFlags_RoundCornersAll : ImDrawFlags_RoundCornersLeft);+ const float bar = std::max(1.0f, std::floor(2.0f * uiScale()));+ dl->AddRectFilled(ImVec2(p.x, p.y + h - bar), ImVec2(p.x + fillW, p.y + h), active ? color::accent : theme::u32(theme::sliderBar),+ std::min(rounding, bar), full ? ImDrawFlags_RoundCornersBottom : ImDrawFlags_RoundCornersBottomLeft);+ }dl->ChannelsMerge();return changed;}diff --git a/src/app/Ui.h b/src/app/Ui.hindex f6037c0c..360053b0 100644--- a/src/app/Ui.h+++ b/src/app/Ui.h@@ -27,14 +27,20 @@ bool ActionButton(App& app, const char* actionId, ImVec2 size = {}, Look look =// other toggle is an option (Zadd, X, Pressure > Strength, Mask, Menus) and gets a raised grey with an accent// underline, so the accent marks one thing per group.bool IsModeAction(std::string_view actionId);+// One side of a secondary either/or pair (Zadd | Zsub): always drawn as segments, the chosen one a raised grey with a+// bright label and no underline, so it reads as a selector rather than as two on/off options.+bool IsChoiceAction(std::string_view actionId);// The 2 px accent mark of an option that is on: along the bottom of the rect, or down its left side.void DrawOnMark(ImDrawList* drawList, ImVec2 min, ImVec2 max, bool side = false);// Adjacent toggle buttons that read as one control (Zadd | Zsub, X | Y | Z); width -1 fills the line.void Segmented(App& app, std::initializer_list<const char*> actionIds, float width = -1.0f);+// ImGui::Checkbox with an outline round the box while it is unchecked, so an off box doesn't vanish on panelBg.+bool Checkbox(const char* label, bool* v);// Ctrl-hover help for the last item.void HelpText(const char* title, const char* shortcut, const char* description, const char* path = nullptr);void HelpAction(App& app, const char* actionId);-// ZBrush-style slider with its label drawn inside the frame ("Draw Size 60") and a thin accent grab.+// ZBrush-style slider with its label drawn inside the frame ("Draw Size 60"), a quiet fill and a thin neutral bar+// along the bottom (the accent only while dragging).bool SliderInside(const char* id, float* v, float lo, float hi, const char* format, ImGuiSliderFlags flags = 0);// Customize mode: shelves this payload ("SF_UIITEM") is dragged from and dropped on.