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.

UI polish: the accent marks one current mode per group; quieter options and title strip

islandmed1ed03f4764f9
diff --git a/docs/ui-design.md b/docs/ui-design.md
index d352c7f3..2906ec72 100644
--- a/docs/ui-design.md
+++ b/docs/ui-design.md
@@ -476,18 +476,21 @@ Clicking a preset applies it (layout only). Store Config makes it stick.
## 10. Theme
-Keep the existing orange accent. Make it denser and greyer, like ZBrush. Put this in `applyStyle()` (to be moved to `src/app/Theme.cpp`) as named constants:
+Keep the existing orange accent, but only for **one thing per group**: the current tool or mode (`ui::IsModeAction`). Everything else is charcoal grey. Put this in `applyStyle()` (to be moved to `src/app/Theme.cpp`) as named constants:
| Token | Value | Use |
|---|---|---|
-| `shellBg` | `#1e1e20` | shelves, trays, title strip, area around the canvas |
-| `panelBg` | `#252528` | palette drop-downs, tray contents, pop-ups (`WindowBg`, `PopupBg` at 98%) |
-| `header` | `#2e2e32` / hover `#3a3a3f` | palette and sub-palette headers |
-| `frame` | `#2b2b2f` / hover `#36363b` | slider and input frames |
-| `button` | `#38383c` / hover `#47474c` / pressed `#e8812a` | buttons |
-| `accent` | `#f0882e` (hover `#ff9a45`) | toggled-on buttons (bg accent, text `#ffffff`), slider grab, check marks, selected outline, LightBox active tab |
+| `shellBg` | `#1b1b1d` | shelves, trays, title strip, area around the canvas |
+| `panelBg` | `#222225` | palette drop-downs, tray contents, pop-ups (`WindowBg`, `PopupBg` at 98%) |
+| `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` | |
-| `border` | `#121214` | 1 px between regions |
+| `border` | `#111113` | 1 px between regions |
| `danger` | `#e5604a` | errors |
| canvas | the existing gradient; 1 px `#0e0e10` frame | |
@@ -495,6 +498,7 @@ 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.
- 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.
---
diff --git a/src/app/PanelSubTools.cpp b/src/app/PanelSubTools.cpp
index d5476f08..e311201d 100644
--- a/src/app/PanelSubTools.cpp
+++ b/src/app/PanelSubTools.cpp
@@ -6,6 +6,7 @@
// the ZBrush viewport gesture Alt+click to select a SubTool. Every action goes
// through the subtool_* commands (core/SubTools.cpp).
#include "app/App.h"
+#include "app/Ui.h"
#include "core/Multires.h"
#include <algorithm>
@@ -164,6 +165,8 @@ void App::drawSubToolsContents() {
ImGuiSelectableFlags_AllowDoubleClick | ImGuiSelectableFlags_NoAutoClosePopups) &&
!isActive)
selectIndex = i;
+ if (isActive) // the selected row: a tint (ImGuiCol_Header) and a 2 px accent bar
+ ui::DrawOnMark(ImGui::GetWindowDrawList(), ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), true);
if (!s.visible) ImGui::PopStyleColor();
if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
renamingSubtool_ = s.id;
diff --git a/src/app/Shell.cpp b/src/app/Shell.cpp
index 0ba7ec02..78a60c72 100644
--- a/src/app/Shell.cpp
+++ b/src/app/Shell.cpp
@@ -163,6 +163,7 @@ std::string elide(ImFont* font, const std::string& text, float width) {
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;
+ if (id == "tool.draw" || id == "tool.move" || id == "tool.scale" || id == "tool.rotate") return 5;
if (id == "draw.zadd" || id == "draw.zsub") return 2;
if (id.rfind("transform.symmetry_", 0) == 0) return 3;
if (id.rfind("draw.pressure_", 0) == 0) return 4;
@@ -201,10 +202,14 @@ bool drawShelfTile(App& app, const Action& a, ImVec2 size) {
ImFont* caption = look == int(ui::Look::IconLabel) ? app.fontTiny_ : app.fontSmall_;
const float capH = caption ? caption->FontSize + 2.0f * s : 14.0f * s;
if (look == int(ui::Look::IconLabel)) {
- const ImVec4 bg = on ? (hovered ? theme::accentHover : theme::accent)
+ // Right-shelf toggles are options (Mask, Paint, PolyF): on is a raised grey with an accent bar down the
+ // side that faces the canvas, off is quiet; only a mode action gets the accent fill.
+ const bool mode = ui::IsModeAction(a.id);
+ const ImVec4 bg = on ? (mode ? (hovered ? theme::accentHover : theme::accent) : hovered ? theme::toggleOnHover : theme::toggleOn)
: held ? theme::buttonPressed : hovered ? theme::buttonHover : theme::frame;
dl->AddRectFilled(p0, p1, theme::u32(bg, alpha), 4.0f * s);
- const ImU32 fg = theme::u32(on ? theme::textOnAccent : theme::text, alpha);
+ 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);
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());
@@ -691,10 +696,11 @@ void App::drawTitleStrip(const ShellGeometry& g) {
if (quickSave) rightW += buttonW("QuickSave") + 8.0f * s;
const float rightX = g.title.w - 8.0f * s - rightW;
- // Info readout and the status message, elided to fit.
+ // Info readout and the status message, elided to fit: secondary, so in the 12 px font.
ImGui::SameLine(0.0f, 14.0f * s);
const float infoX = ImGui::GetCursorPosX();
- ImGui::SetCursorPosY(textY);
+ if (fontSmall_) ImGui::PushFont(fontSmall_);
+ ImGui::SetCursorPosY(std::floor((h - ImGui::GetTextLineHeight()) * 0.5f));
size_t tris = 0, verts = 0;
for (int i = 0; i < doc_.subtoolCount(); ++i) {
tris += doc_.subtoolMesh(i).triangleCount();
@@ -739,12 +745,24 @@ void App::drawTitleStrip(const ShellGeometry& g) {
} 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).
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);
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());
@@ -752,6 +770,7 @@ void App::drawTitleStrip(const ShellGeometry& g) {
}
ImGui::SameLine(0.0f, 8.0f * s);
ui::ActionButton(*this, "ui.menus", ImVec2(0, buttonH), ui::Look::IconLabel);
+ ImGui::PopStyleColor(3);
ImGui::SameLine(0.0f, 8.0f * s);
// Search: a field-looking button that opens the command palette (F3).
{
@@ -883,7 +902,7 @@ bool App::paletteHeader(const char* id, bool inTray, bool right) {
else
ui::HelpText("Move to the tray", nullptr,
"Keep this palette in the right tray (Shift+click: left tray), or drag the icon onto a tray.", def->name);
- centredText(dl, nullptr, p, ImVec2(p.x + h, p.y + h), theme::u32(iconHovered ? theme::accentHover : theme::accent),
+ centredText(dl, nullptr, p, ImVec2(p.x + h, p.y + h), theme::u32(iconHovered ? theme::accentHover : theme::textDim),
inTray ? (right ? ICON_LC_PANEL_RIGHT : ICON_LC_PANEL_LEFT) : ICON_LC_PANEL_RIGHT);
ImGui::SameLine();
const bool titleClicked = ImGui::InvisibleButton("##title", ImVec2(std::max(1.0f, w - 2.0f * h), h));
@@ -1324,10 +1343,41 @@ 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);
- if (shelf == kShelfTop) ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10.0f * s, (rowH - ImGui::GetFontSize()) * 0.5f));
+ // 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;
+ int colors = 0;
+ bool small = false;
+ if (shelf == kShelfTop) {
+ 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;
+ }
+ }
+ }
ui::SetNextItemOrigin(shelf, index); // ActionButton is the Ctrl+Alt drag source, from this shelf slot
- ui::ActionButton(*this, a->id.c_str(), size, look);
- if (shelf == kShelfTop) ImGui::PopStyleVar();
+ ui::ActionButton(*this, a->id.c_str(), itemSize, 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 list
}
diff --git a/src/app/Theme.cpp b/src/app/Theme.cpp
index 8bc10d35..55929723 100644
--- a/src/app/Theme.cpp
+++ b/src/app/Theme.cpp
@@ -32,9 +32,9 @@ void applyStyle() {
ImVec4* c = s.Colors;
c[ImGuiCol_Text] = text;
c[ImGuiCol_TextDisabled] = textDim;
- c[ImGuiCol_WindowBg] = rgb(0x252528, 0.98f);
+ c[ImGuiCol_WindowBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 0.98f);
c[ImGuiCol_ChildBg] = ImVec4(0, 0, 0, 0);
- c[ImGuiCol_PopupBg] = rgb(0x252528, 0.98f);
+ c[ImGuiCol_PopupBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 0.98f);
c[ImGuiCol_Border] = rgb(0x3a3a3f, 0.9f);
c[ImGuiCol_BorderShadow] = ImVec4(0, 0, 0, 0);
c[ImGuiCol_FrameBg] = frame;
@@ -54,9 +54,9 @@ void applyStyle() {
c[ImGuiCol_Button] = button;
c[ImGuiCol_ButtonHovered] = buttonHover;
c[ImGuiCol_ButtonActive] = buttonPressed;
- c[ImGuiCol_Header] = rgb(0xf0882e, 0.55f);
+ c[ImGuiCol_Header] = selection; // selected rows: a tint, not a solid bar (the accent is for the current tool)
c[ImGuiCol_HeaderHovered] = headerHover;
- c[ImGuiCol_HeaderActive] = rgb(0xf0882e, 0.75f);
+ c[ImGuiCol_HeaderActive] = rgb(0xf0882e, 0.28f);
c[ImGuiCol_Separator] = rgb(0x3a3a3f);
c[ImGuiCol_SeparatorHovered] = accentHover;
c[ImGuiCol_SeparatorActive] = accent;
@@ -76,7 +76,7 @@ void applyStyle() {
c[ImGuiCol_TableBorderLight] = rgb(0x323236);
c[ImGuiCol_TableRowBg] = ImVec4(0, 0, 0, 0);
c[ImGuiCol_TableRowBgAlt] = rgb(0xffffff, 0.025f);
- c[ImGuiCol_TextSelectedBg] = rgb(0xf0882e, 0.35f);
+ c[ImGuiCol_TextSelectedBg] = rgb(0xf0882e, 0.30f);
c[ImGuiCol_DragDropTarget] = accentHover;
c[ImGuiCol_NavCursor] = accent;
c[ImGuiCol_ModalWindowDimBg] = rgb(0x000000, 0.45f);
diff --git a/src/app/Theme.h b/src/app/Theme.h
index db2f577d..167ef9a9 100644
--- a/src/app/Theme.h
+++ b/src/app/Theme.h
@@ -1,8 +1,8 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Colours and style of the ZBrush-like shell (docs/ui-design.md §10): dense,
-// grey, with the SculptForge orange as the accent.
+// Colours and style of the shell (docs/ui-design.md §10): dense, charcoal grey,
+// with the SculptForge orange kept for the one current tool or mode in each group.
#pragma once
#include <imgui.h>
@@ -13,24 +13,33 @@ constexpr ImVec4 rgb(unsigned hex, float a = 1.0f) {
return ImVec4(float((hex >> 16) & 0xff) / 255.0f, float((hex >> 8) & 0xff) / 255.0f, float(hex & 0xff) / 255.0f, a);
}
-constexpr ImVec4 shellBg = rgb(0x1e1e20); // shelves, trays, title strip, around the canvas
-constexpr ImVec4 panelBg = rgb(0x252528); // palette drop-downs, tray contents, pop-ups
-constexpr ImVec4 header = rgb(0x2e2e32); // palette and sub-palette headers
-constexpr ImVec4 headerHover = rgb(0x3a3a3f);
-constexpr ImVec4 frame = rgb(0x2b2b2f); // slider and input frames
-constexpr ImVec4 frameHover = rgb(0x36363b);
-constexpr ImVec4 button = rgb(0x38383c);
-constexpr ImVec4 buttonHover = rgb(0x47474c);
-constexpr ImVec4 buttonPressed = rgb(0xe8812a);
-constexpr ImVec4 accent = rgb(0xf0882e); // toggled-on buttons, grabs, checks, selection, active tab
+constexpr ImVec4 shellBg = rgb(0x1b1b1d); // shelves, trays, title strip, around the canvas
+constexpr ImVec4 panelBg = rgb(0x222225); // palette drop-downs, tray contents, pop-ups
+constexpr ImVec4 header = rgb(0x2b2b2f); // palette and sub-palette headers
+constexpr ImVec4 headerHover = rgb(0x37373c);
+constexpr ImVec4 frame = rgb(0x28282c); // slider and input frames
+constexpr ImVec4 frameHover = rgb(0x323237);
+constexpr ImVec4 button = rgb(0x333337);
+constexpr ImVec4 buttonHover = rgb(0x414146);
+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
constexpr ImVec4 text = rgb(0xd8d8d8);
+constexpr ImVec4 textBright = rgb(0xf2f2f2); // labels of options that are on
constexpr ImVec4 textDim = rgb(0x8c8c90);
constexpr ImVec4 textOnAccent = rgb(0xffffff);
-constexpr ImVec4 border = rgb(0x121214); // 1 px between regions
+constexpr ImVec4 border = rgb(0x111113); // 1 px between regions
constexpr ImVec4 danger = rgb(0xe5604a); // errors
-constexpr ImVec4 canvasBorder = rgb(0x0e0e10);
+constexpr ImVec4 canvasBorder = rgb(0x0c0c0e);
constexpr ImVec4 tile = rgb(0x2a2a2e); // thumbnail placeholders
+constexpr float markWidth = 2.0f; // the accent underline / side bar, unscaled pixels
inline ImU32 u32(const ImVec4& c, float alpha = 1.0f) { return ImGui::ColorConvertFloat4ToU32(ImVec4(c.x, c.y, c.z, c.w * alpha)); }
diff --git a/src/app/Ui.cpp b/src/app/Ui.cpp
index 53e3e062..a357117b 100644
--- a/src/app/Ui.cpp
+++ b/src/app/Ui.cpp
@@ -4,6 +4,7 @@
#include "app/App.h"
#include "app/Shell.h"
+#include "app/Theme.h"
#include <imgui_internal.h>
@@ -107,6 +108,20 @@ void HelpText(const char* title, const char* shortcut, const char* description,
g_help.disabled = (ImGui::GetItemFlags() & ImGuiItemFlags_Disabled) != 0;
}
+bool IsModeAction(std::string_view id) {
+ auto starts = [&](std::string_view p) { return id.substr(0, p.size()) == p; };
+ if (id == "tool.draw" || id == "tool.move" || id == "tool.scale" || id == "tool.rotate") return true;
+ if (id == "draw.sculpt" || id == "draw.paint") return true;
+ return starts("brush.") || starts("mask.") || starts("select.");
+}
+
+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;
+ if (side) dl->AddRectFilled(a, ImVec2(a.x + w, b.y), theme::u32(theme::accent), r, ImDrawFlags_RoundCornersLeft);
+ else dl->AddRectFilled(ImVec2(a.x, b.y - w), b, theme::u32(theme::accent), r, ImDrawFlags_RoundCornersBottom);
+}
+
void Segmented(App& app, std::initializer_list<const char*> actionIds, float width) {
const float total = width > 0.0f ? width : ImGui::GetContentRegionAvail().x;
const float w = (total - float(actionIds.size() - 1)) / float(actionIds.size());
@@ -229,11 +244,13 @@ 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);
int colors = 0;
if (checked) {
- ImGui::PushStyleColor(ImGuiCol_Button, rgba(color::accent));
- ImGui::PushStyleColor(ImGuiCol_ButtonHovered, rgba(color::accentHover));
- ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1, 1, 1, 1));
+ ImGui::PushStyleColor(ImGuiCol_Button, mode ? theme::accent : theme::toggleOn);
+ ImGui::PushStyleColor(ImGuiCol_ButtonHovered, mode ? theme::accentHover : theme::toggleOnHover);
+ ImGui::PushStyleColor(ImGuiCol_Text, mode ? theme::textOnAccent : theme::textBright);
colors = 3;
}
ImGui::BeginDisabled(!enabled);
@@ -269,7 +286,8 @@ bool ActionButton(App& app, const char* actionId, ImVec2 size, Look look) {
ImGui::PopStyleColor();
const ImRect r(ImGui::GetItemRectMin(), ImGui::GetItemRectMax());
ImDrawList* dl = ImGui::GetWindowDrawList();
- const ImU32 fg = !enabled ? color::textDim : checked ? IM_COL32_WHITE : color::text;
+ const ImU32 fg = !enabled ? color::textDim : checked ? theme::u32(mode ? theme::textOnAccent : theme::textBright)
+ : ImGui::GetColorU32(ImGuiCol_Text);
if (look == Look::Icon) {
const ImVec2 is = ImGui::CalcTextSize(icon);
dl->AddText(ImVec2(std::floor(r.GetCenter().x - is.x * 0.5f), std::floor(r.GetCenter().y - is.y * 0.5f)), fg, icon);
@@ -295,6 +313,8 @@ bool ActionButton(App& app, const char* actionId, ImVec2 size, Look look) {
}
ImGui::EndDisabled();
if (colors) ImGui::PopStyleColor(colors);
+ if (checked && !mode && look != Look::Tile)
+ DrawOnMark(ImGui::GetWindowDrawList(), ImGui::GetItemRectMin(), ImGui::GetItemRectMax());
const bool customize = app.layout().customize;
dragSource(app, id.c_str(), label.c_str(), shelf, index);
@@ -340,7 +360,7 @@ bool SliderInside(const char* id, float* v, float lo, float hi, const char* form
t = 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), IM_COL32(0xf0, 0x88, 0x2e, active ? 0x48 : 0x30), 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);
diff --git a/src/app/Ui.h b/src/app/Ui.h
index d41a2b66..f6037c0c 100644
--- a/src/app/Ui.h
+++ b/src/app/Ui.h
@@ -8,6 +8,7 @@
#include <initializer_list>
#include <string>
+#include <string_view>
namespace sf {
class App;
@@ -21,6 +22,13 @@ enum class Look { Label, Icon, IconLabel, Tile };
// is a Ctrl+Alt drag source in customize mode. Ctrl+Alt+click (outside customize mode) assigns
// a shortcut, as in ZBrush. Returns true when the action ran.
bool ActionButton(App& app, const char* actionId, ImVec2 size = {}, Look look = Look::Label);
+// How a toggle that is on looks (docs/ui-design.md §10). A mode action picks the current tool or mode of its
+// group (Draw/Move/Scale/Rotate, Sculpt/Paint, a brush, MaskPen/MaskLasso...) and gets the accent fill; every
+// 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);
+// 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);
// Ctrl-hover help for the last item.
@@ -63,10 +71,10 @@ inline constexpr ImU32 accentHover = IM_COL32(0xff, 0x9a, 0x45, 0xff);
inline constexpr ImU32 text = IM_COL32(0xd8, 0xd8, 0xd8, 0xff);
inline constexpr ImU32 textDim = IM_COL32(0x8c, 0x8c, 0x90, 0xff);
inline constexpr ImU32 danger = IM_COL32(0xe5, 0x60, 0x4a, 0xff);
-inline constexpr ImU32 panelBg = IM_COL32(0x25, 0x25, 0x28, 0xff);
-inline constexpr ImU32 shellBg = IM_COL32(0x1e, 0x1e, 0x20, 0xff);
-inline constexpr ImU32 header = IM_COL32(0x2e, 0x2e, 0x32, 0xff);
-inline constexpr ImU32 border = IM_COL32(0x12, 0x12, 0x14, 0xff);
+inline constexpr ImU32 panelBg = IM_COL32(0x22, 0x22, 0x25, 0xff);
+inline constexpr ImU32 shellBg = IM_COL32(0x1b, 0x1b, 0x1d, 0xff);
+inline constexpr ImU32 header = IM_COL32(0x2b, 0x2b, 0x2f, 0xff);
+inline constexpr ImU32 border = IM_COL32(0x11, 0x11, 0x13, 0xff);
} // namespace color
} // namespace sf::ui