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
Merge UI polish round 2 (viewport and brush icons, toggles and top bar, trays)
islandmedf386f6fbf6db
diff --cc docs/ui-design.mdindex aeb6ca1d,c5f116a9..939cbb02--- a/docs/ui-design.md+++ b/docs/ui-design.md@@@ -501,12 -498,11 +501,13 @@@ 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.+ - Trays (helpers in `src/app/Palettes.h`): two header levels only. A palette header is a filled bar (icon, bold title, chevron at the right). A sub-palette header is 22 px and quiet: title 8 px in, chevron at the right, no fill until hovered or open, an opaque hairline under it, no accent. The open section's content is indented 8 px (`tray::Section`), so it lines up with the header title. A group inside a section ("Project", "QRemesh", "Tablet") is `tray::GroupLabel`: 12 px `textDim` flush with the content, then a hairline; not `ImGui::SeparatorText`.+ - Tray controls: every slider is a `ui::SliderInside` (ints through `tray::SliderInt`), never a stock grab over its label. Check marks in palettes are the text colour (`tray::Style`), not the accent. A row of controls fills the line in equal halves or thirds; a number beside a button is a drag field of the same size (no tiny - / + buttons). The active row of a list (SubTools) is a lighter neutral (white ~9%) with a 2 px accent bar on its left, in a recessed well with no outline. 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, a 10 px hue strip with a thin bar marker that stays inside its ends, and the main/second swatches as equal halves with a 1 px edge. One 4 px gap between all of them. The default main colour is a mid grey (second: white), so the swatches are neutral until the user picks a colour.---diff --cc src/app/Palettes.cppindex fe8cbb96,ab3f81a2..1b8c552d--- a/src/app/Palettes.cpp+++ b/src/app/Palettes.cpp@@@ -103,27 -112,33 +112,43 @@@ void hint(const App& app, const char* tif (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) {+ } // namespace++ namespace tray {++ Section::Section() { ImGui::Indent(kSectionInset * ImGui::GetFontSize() / 15.0f); }++ Section::~Section() {const float s = ImGui::GetFontSize() / 15.0f;- ImGui::Dummy(ImVec2(0, 3.0f * s));+ ImGui::Unindent(kSectionInset * s);+ ImGui::Dummy(ImVec2(0, 4.0f * s));+ }++ Style::Style() { ImGui::PushStyleColor(ImGuiCol_CheckMark, kCheckMark); }++ Style::~Style() { ImGui::PopStyleColor(); }++ void GroupLabel(const App& app, const char* text) {+ const float s = ImGui::GetFontSize() / 15.0f;+ ImGui::Dummy(ImVec2(0, 2.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));+ ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyleColorVec4(ImGuiCol_TextDisabled));+ ImGui::PushStyleColor(ImGuiCol_Separator, ImGui::ColorConvertU32ToFloat4(kSectionRule));+ ImGui::PushStyleVar(ImGuiStyleVar_SeparatorTextPadding, ImVec2(0.0f, 2.0f * s));+ ImGui::PushStyleVar(ImGuiStyleVar_SeparatorTextAlign, ImVec2(0.0f, 0.5f));+ ImGui::SeparatorText(text);+ ImGui::PopStyleVar(2);+ ImGui::PopStyleColor(2);if (app.smallFont()) ImGui::PopFont();}@@@ -222,17 -257,14 +267,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"});+ drawOptionRow(*this, {"draw.rgb", "draw.front_faces"});- sectionLabel(*this, "Dynamic topology");+ tray::GroupLabel(*this, "Dynamic topology");- actionRow(*this, {"draw.dynamic"});+ 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 "@@@ -241,17 -273,13 +286,17 @@@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.");+ // Tablet: the same Pressure > Strength / Size toggles as the top shelf (not checkboxes), and the pen state as+ // a hint line.- sectionLabel(*this, "Tablet");+ tray::GroupLabel(*this, "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");+ 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() {