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.

WIP hover highlights: ring pass, tile lift, slider hover, Reduce motion (does not compile yet)

islandmede5a42de253f4
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a5607791..cfe1ed1f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,14 @@ All notable changes to SculptForge are listed here. The format follows
- Tablet Mouse mode (Preferences > Tablet): on some Windows tablets the brush stopped following the pen in 0.10.7,
because the system cursor reading stayed put while the pen moved. A reading that doesn't move with the pen is now
ignored and the pen moves the brush relatively, from where it was, with no jump (#72).
+### Changed
+- Hover highlights that pop, in every look: buttons, menu items, shelf buttons and palette headers ease into an
+ accent-tinted fill with a crisp accent border and a brighter label in about 100 ms (Forge Terminal: the accent
+ border; Phosphor: an inverse-video glow; Blueprint: a cyan line glow; Classic: a subtle warm highlight), and
+ pressed is a touch darker. Brush, alpha, material and look tiles (shelves, pickers, Library) lift slightly with a
+ soft shadow and an accent glow ring, without moving anything; the active tile keeps its orange outline. Sliders
+ brighten, grow a knob and show their exact value. The keyboard focus gets the same ring. New **Preferences >
+ Interface > Reduce motion**: colour changes only, no easing or lifting. Animations draw frames only while they run.
## [0.10.7] - 2026-11-01
diff --git a/REPORT.md b/REPORT.md
new file mode 100644
index 00000000..3015905c
--- /dev/null
+++ b/REPORT.md
@@ -0,0 +1,4 @@
+# feat/hover-pop: PAUSED (usage limit). Local WIP commit only: NOT built, NOT pushed
+Done: Ui.h/Ui.cpp hover module (HoverAmount 100 ms ease; DrawHover ring per look fed by Demo.cpp ItemAdd/ItemInfo hooks; TileLift 1.05 scale + shadow + glow; HoverAnimating in App::wantsFrames), ActionButton eased fill + brighter label (Phosphor inverse video), SliderInside hover (bar brightens, knob grows, value tooltip), Theme.cpp tintHovers() (accent-tinted hover tokens, pressed darker, ImGui NavCursor hidden), lifts in tileFrame/drawShelfTile/AssetTile/look cards, UiPrefs.reduceMotion (ui.json, Preferences > Interface checkbox, Spanish), UiTest values hover_rings/hover_lifts/reduce_motion, tests/ui/hover_pop.sfui (shots per look), CHANGELOG + whats-new 0.10.8 + guide row.
+Left: Ui.cpp doesn't compile: -fsyntax-only gives "function-definition is not allowed here" from ~line 78 (brace/namespace mismatch around the block inserted before itemHoveredForHelp). Keyboard nav (NavEnableKeyboard) is off app-wide; the ring shows whenever ImGui's nav cursor is visible.
+Resume: fix the Ui.cpp braces; `nice -n 19 ionice -c3 cmake --build build -j3 --target sculptforge` (build/ already configured, shares ~/Work/Zbrush/build/_deps); `ctest --test-dir build -R "ui_(hover_pop|looks|shell_layout_1080|idle_redraw)"`; then one full ctest (check `pgrep -f ctest` first); copy before (main) / after (build/ui-shots/hover_pop) shots to ~/Work/look-mockups/hover/; squash the WIP commit, push, message the coordinator.
diff --git a/docs/guide/interface.md b/docs/guide/interface.md
index b2d5d8e9..36fd2789 100644
--- a/docs/guide/interface.md
+++ b/docs/guide/interface.md
@@ -476,6 +476,7 @@ Config keeps it.
| **Popup Info (Ctrl+hover help)** | On | Ctrl-hover help boxes |
| **Popup Info opacity** | 0.97 | How solid the help box is |
| **Tooltip delay** | 0.5 s | How long to point at an icon-only button before its name appears |
+| **Reduce motion** | Off | Hover and focus highlights change colour only: no easing, and tiles don't lift |
| **One sub-palette open** | On | Opening a sub-palette closes the others in that palette |
| **Auto collapse left tray** / **right tray** | On / Off | Collapse other palettes in the tray when one wouldn't fit |
| **Palettes strictly A-Z (ZBrush order)** | Off | Strict alphabetical palette bar instead of File and Edit first, Help last |
diff --git a/docs/guide/whats-new.md b/docs/guide/whats-new.md
index d8920df6..71bbc5b1 100644
--- a/docs/guide/whats-new.md
+++ b/docs/guide/whats-new.md
@@ -10,6 +10,9 @@ chapter opens by itself the first time you start a new version; you can always f
- **Tablets in mouse mode work again**: on some Windows tablets with **Mouse mode** on (Preferences > Tablet) the
brush stopped following the pen in 0.10.7. When the system can't say where its cursor is, the pen now moves the
brush by how far it moves, from where it was (#72).
+- **Hover highlights that pop**: buttons, menus and shelves light up in your look's accent as you point at them,
+ tiles lift a little, sliders show their exact value, and the keyboard focus gets the same ring. Prefer less
+ movement? Turn on **Preferences > Interface > Reduce motion** ([Interface](interface.md)).
## Version 0.10.7
diff --git a/src/app/App.cpp b/src/app/App.cpp
index 08c6194c..372a98d7 100644
--- a/src/app/App.cpp
+++ b/src/app/App.cpp
@@ -694,7 +694,8 @@ void App::redrawIn(double seconds) {
}
bool App::wantsFrames(double now) const {
- return now < activeUntil_ || drag_ != Drag::None || doc_.sculptor.strokeActive() ||
+ return now < activeUntil_ || drag_ != Drag::None || ui::HoverAnimating() || // a hover ring easing in or out
+ doc_.sculptor.strokeActive() ||
!dabQueue_.empty() || // a stroke's dabs still waiting (drainStrokeDabs) are placed a few each frame
strokeFinishing_ || solverBusy() || // the solver thread is placing a stroke's dabs (AsyncStroke.cpp)
backgroundBusy() || playingLayer_ >= 0 || faceTakePlaying_ ||
diff --git a/src/app/Config.cpp b/src/app/Config.cpp
index 7174c9cf..ea262e9d 100644
--- a/src/app/Config.cpp
+++ b/src/app/Config.cpp
@@ -68,6 +68,7 @@ Json toJson(const UiPrefs& p) {
j.set("popupInfo", p.popupInfo);
j.set("helpOpacity", double(p.helpOpacity));
j.set("tooltipDelay", double(p.tooltipDelay));
+ j.set("reduceMotion", p.reduceMotion);
j.set("oneSubpalette", p.oneSubpalette);
j.set("autoCollapseLeft", p.autoCollapseLeft);
j.set("autoCollapseRight", p.autoCollapseRight);
@@ -116,6 +117,7 @@ void fromJson(const Json& j, UiPrefs& p) {
p.popupInfo = j["popupInfo"].asBool(p.popupInfo);
p.helpOpacity = std::clamp(float(j["helpOpacity"].asNumber(p.helpOpacity)), 0.3f, 1.0f);
p.tooltipDelay = std::clamp(float(j["tooltipDelay"].asNumber(p.tooltipDelay)), 0.0f, 3.0f);
+ p.reduceMotion = j["reduceMotion"].asBool(p.reduceMotion);
p.oneSubpalette = j["oneSubpalette"].asBool(p.oneSubpalette);
p.autoCollapseLeft = j["autoCollapseLeft"].asBool(p.autoCollapseLeft);
p.autoCollapseRight = j["autoCollapseRight"].asBool(p.autoCollapseRight);
@@ -1001,6 +1003,7 @@ void App::drawHelpConsoleUi() {
ImGui::PopStyleVar(3);
}
watchLayoutChanges();
+ ui::DrawHover(*this); // the hover and keyboard-focus rings, over every window
ui::DrawHelp(*this); // last: on top of everything
}
@@ -1163,6 +1166,10 @@ void drawInterfaceSection(App& app) {
ui::HelpText("Tooltip delay", nullptr,
"How long to point at an icon-only button (or a clipped label) before its name appears.",
"Preferences > Interface");
+ ImGui::Checkbox(tr("Reduce motion"), &p.reduceMotion);
+ ui::HelpText("Reduce motion", nullptr,
+ "Hover and focus highlights change colour only: no easing, and tiles don't lift or grow.",
+ "Preferences > Interface");
ImGui::Checkbox(tr("One sub-palette open"), &p.oneSubpalette);
ui::HelpText("One sub-palette open", nullptr,
"Opening a sub-palette closes the others in that palette. Shift+click opens more than one.",
@@ -1350,6 +1357,7 @@ void App::drawLookSection() {
const bool hovered = ImGui::IsItemHovered(), current = l.look == i;
const ImVec2 a = ImGui::GetItemRectMin(), b = ImGui::GetItemRectMax();
ImDrawList* dl = ImGui::GetWindowDrawList();
+ const ui::TileLift lift = ui::BeginTileLift(a, b, 0.0f);
auto col = [](unsigned hex) { return theme::u32(theme::rgb(hex)); };
// A miniature of the look: its wallpaper, a bar with its accent, two tiles, its name in its text colour.
dl->AddRectFilled(a, b, col(pal.crust));
@@ -1364,6 +1372,7 @@ void App::drawLookSection() {
dl->AddText(f, f->FontSize, ImVec2(a.x + g + 6.0f * s, b.y - g - f->FontSize - 3.0f * s), col(pal.text), looks::lookName(id));
dl->AddRect(a, b, theme::u32(current ? theme::accent : hovered ? theme::textDim : theme::tileBorder), 0.0f, 0,
current ? 2.0f * s : 1.0f * s);
+ ui::EndTileLift(lift, 0.0f);
ImGui::LogText("%s", looks::lookName(id));
ui::HelpText(looks::lookName(id), nullptr,
i == 0 ? "The original dark grey look with the orange accent."
diff --git a/src/app/Config.h b/src/app/Config.h
index 72e0a278..590d1b14 100644
--- a/src/app/Config.h
+++ b/src/app/Config.h
@@ -23,6 +23,7 @@ struct UiPrefs {
bool popupInfo = true; // Ctrl+hover shows an item's description (ZBrush "Popup Info")
float helpOpacity = 0.97f; // Ctrl-help box opacity (ZBrush "Quick Info Opacity")
float tooltipDelay = 0.5f; // plain hover tooltips on icon-only buttons and clipped labels
+ bool reduceMotion = false; // hover highlights change colour only: no easing, no lifting tiles (Ui.h)
bool oneSubpalette = true; // opening a sub-palette closes the others (Shift+click opens more)
bool autoCollapseLeft = true, autoCollapseRight = false; // trays collapse palettes that would overflow
float uiScale = 0.0f; // 0 = follow the display; otherwise applied at the next start
diff --git a/src/app/Demo.cpp b/src/app/Demo.cpp
index f86c6464..7e5092de 100644
--- a/src/app/Demo.cpp
+++ b/src/app/Demo.cpp
@@ -3,6 +3,7 @@
#include "app/Demo.h"
#include "app/App.h"
+#include "app/Ui.h"
#include <imgui_internal.h>
@@ -48,6 +49,7 @@ ItemTable& items() {
} // namespace
void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, ImGuiID id, const ImRect& bb, const ImGuiLastItemData*) {
+ sf::ui::NoteItem(ctx, id, bb.Min, bb.Max); // the hover and focus rings (Ui.cpp)
ImRect clip = bb;
if (ctx && ctx->CurrentWindow) {
clip = ctx->CurrentWindow->ClipRect;
@@ -62,6 +64,7 @@ void ImGuiTestEngineHook_ItemAdd(ImGuiContext* ctx, ImGuiID id, const ImRect& bb
}
void ImGuiTestEngineHook_ItemInfo(ImGuiContext* ctx, ImGuiID id, const char* label, ImGuiItemStatusFlags) {
+ sf::ui::NoteItemLabel(id);
auto it = items().rects.find(id);
if (!label || it == items().rects.end()) return;
std::string text(label);
diff --git a/src/app/I18nSpanish.cpp b/src/app/I18nSpanish.cpp
index 64f74029..4fa3098a 100644
--- a/src/app/I18nSpanish.cpp
+++ b/src/app/I18nSpanish.cpp
@@ -530,6 +530,7 @@ constexpr Entry kSpanish[] = {
{"Popup Info opacity", "Opacidad de Popup Info"},
{"Tooltip delay", "Retardo de las descripciones"},
{"One sub-palette open", "Una subpaleta abierta"},
+ {"Reduce motion", "Reducir movimiento"},
{"Auto collapse left tray", "Plegar sola la bandeja izquierda"},
{"Auto collapse right tray", "Plegar sola la bandeja derecha"},
{"Palettes strictly A-Z (ZBrush order)", "Paletas de la A a la Z (orden de ZBrush)"},
diff --git a/src/app/Pickers.cpp b/src/app/Pickers.cpp
index daeea1c0..c2066205 100644
--- a/src/app/Pickers.cpp
+++ b/src/app/Pickers.cpp
@@ -254,6 +254,7 @@ bool AssetTile(const char* id, ImTextureID texture, const char* glyph, const std
const bool hovered = ImGui::IsItemHovered();
ImDrawList* dl = ImGui::GetWindowDrawList();
const ImVec2 t0 = p, t1(p.x + thumbSize, p.y + thumbSize);
+ const ui::TileLift lift = ui::BeginTileLift(t0, t1); // the thumbnail lifts on hover; its label stays
dl->AddRectFilled(t0, t1, hovered ? kTileHover() : kTileBg(), theme::rounding(4.0f));
if (texture) {
const float pad = 2.0f;
@@ -280,6 +281,7 @@ bool AssetTile(const char* id, ImTextureID texture, const char* glyph, const std
dl->AddText(ImVec2(std::round((b0.x + b1.x - bs.x) * 0.5f), b0.y + 1.0f), lookColor(IM_COL32(20, 20, 22, 255), theme::textOnAccent), badge);
ImGui::LogText(" [%s]", badge);
}
+ ui::EndTileLift(lift);
const std::string shown = elide(label, thumbSize);
const ImVec2 ls = ImGui::CalcTextSize(shown.c_str());
dl->AddText(ImVec2(std::round(p.x + (thumbSize - ls.x) * 0.5f), t1.y + 2.0f),
diff --git a/src/app/Shell.cpp b/src/app/Shell.cpp
index e947616f..c4bddef2 100644
--- a/src/app/Shell.cpp
+++ b/src/app/Shell.cpp
@@ -279,8 +279,12 @@ bool drawShelfTile(App& app, const Action& a, ImVec2 size) {
// 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);
+ // Off: the fill eases into the accent-tinted hover (ui::DrawHover adds the look's ring).
+ const float h = disabled ? 0.0f : ui::HoverAmount(ImGui::GetItemID(), hovered || ui::HoveredOrFocused(ImGui::GetItemID()));
+ const ImVec4 rest = theme::frame, hot = theme::buttonHover;
+ const ImVec4 eased(rest.x + (hot.x - rest.x) * h, rest.y + (hot.y - rest.y) * h, rest.z + (hot.z - rest.z) * h, 1.0f);
const ImVec4 bg = on ? (mode ? (hovered ? theme::accentHover : theme::accent) : hovered ? theme::toggleOnHover : theme::toggleOn)
- : held ? theme::buttonPressed : hovered ? theme::buttonHover : theme::frame;
+ : held ? theme::buttonPressed : eased;
dl->AddRectFilled(p0, p1, theme::u32(bg, alpha), theme::rounding(4.0f * s));
if (on && !mode) ui::DrawOnMark(dl, p0, p1, true);
// Two text levels only: actions and hovered items in text, options that are off in textOff (readable, so
@@ -294,6 +298,8 @@ bool drawShelfTile(App& app, const Action& a, ImVec2 size) {
// Tile: a square picture (brush thumbnail or icon) with the name under it.
const float pic = std::min(size.x, size.y - capH);
const ImVec2 q0(p0.x + (size.x - pic) * 0.5f, p0.y), q1(q0.x + pic, q0.y + pic);
+ ui::TileLiftScope lift; // the tile lifts on hover; the layout stays
+ lift.lift = ui::BeginTileLift(p0, p1);
dl->AddRectFilled(p0, p1, theme::u32(hovered ? theme::buttonHover : theme::tile, hovered ? 0.55f : 0.0f), theme::rounding(4.0f * s));
ImTextureID tex = type >= 0 ? app.thumbnails().brush(type) : ImTextureID(0);
if (a.id == "draw.paint") { // the Paint brush's own preview (Pickers.cpp)
@@ -2272,7 +2278,9 @@ bool App::canvasNavButton(const char* id, const char* icon, const char* englishL
namespace {
// Tile frame: the picture square and the caption under it. Returns true when clicked.
-bool tileFrame(const char* id, ImVec2 size, ImFont* font, const std::string& caption, float s, ImVec2& pic0, ImVec2& pic1) {
+// A left-shelf tile; it lifts on hover (`lift` ends when the caller has drawn the picture).
+bool tileFrame(const char* id, ImVec2 size, ui::TileLift& lift, ImFont* font, const std::string& caption, float s, ImVec2& pic0,
+ ImVec2& pic1) {
const bool clicked = ImGui::InvisibleButton(id, size);
const bool hovered = ImGui::IsItemHovered();
const ImVec2 a = ImGui::GetItemRectMin(), b = ImGui::GetItemRectMax();
@@ -2280,10 +2288,10 @@ bool tileFrame(const char* id, ImVec2 size, ImFont* font, const std::string& cap
const float capH = (font ? font->FontSize : 12.0f) + 4.0f * s;
pic0 = a;
pic1 = ImVec2(b.x, b.y - capH);
- dl->AddRectFilled(pic0, pic1, theme::u32(theme::tile), theme::rounding(4.0f * s));
- if (hovered) dl->AddRect(pic0, pic1, theme::u32(theme::accent, 0.8f), theme::rounding(4.0f * s), 0, 1.5f * s);
- centredText(dl, font, ImVec2(a.x, b.y - capH), b, theme::u32(hovered ? theme::text : theme::textDim),
+ centredText(dl, font, ImVec2(a.x, b.y - capH), b, theme::u32(hovered ? theme::textHover : theme::textDim),
elide(font ? font : ImGui::GetFont(), caption, size.x).c_str());
+ lift = ui::BeginTileLift(pic0, pic1); // the picture lifts, the caption stays
+ dl->AddRectFilled(pic0, pic1, theme::u32(theme::tile), theme::rounding(4.0f * s));
ImGui::LogText("%s", caption.c_str());
return clicked;
}
@@ -2301,7 +2309,8 @@ void App::drawBrushTile(const char* id, ImVec2 size) {
// ZBrush: Ctrl held shows the mask brush, Ctrl+Shift the selection brush; a click picks among those.
if (const HeldBrushItem* held = heldBrushCurrent(heldBrush())) {
ImVec2 a, b;
- const bool clicked = tileFrame(id, size, fontSmall_, held->brush, s, a, b);
+ ui::TileLiftScope lift;
+ const bool clicked = tileFrame(id, size, lift.lift, fontSmall_, held->brush, s, a, b);
drawHeldBrushIcon(ImGui::GetWindowDrawList(), a, b, held->icon, heldBrush() == HeldBrush::Select);
if (clicked) openPicker(Picker::Brush, ImVec2(ImGui::GetItemRectMax().x + 4.0f * s, ImGui::GetItemRectMin().y));
ui::HelpText("Brush", "B", "Ctrl held: the mask brush (Ctrl+Shift: the selection brush). Click, or press B with Ctrl "
@@ -2311,7 +2320,8 @@ void App::drawBrushTile(const char* id, ImVec2 size) {
const BrushRecipe* recipe = activeRecipe();
const std::string name = guidesMode_ ? "Quad Remesh Guides" : paintMode_ ? "Paint" : recipe ? recipe->name : brushLabel(brush_);
ImVec2 a, b;
- const bool clicked = tileFrame(id, size, fontSmall_, name, s, a, b);
+ ui::TileLiftScope lift;
+ const bool clicked = tileFrame(id, size, lift.lift, fontSmall_, name, s, a, b);
ImDrawList* dl = ImGui::GetWindowDrawList();
ImTextureID tex = paintMode_ || guidesMode_ ? ImTextureID(0) : recipe ? thumbs_.recipe(*recipe) : thumbs_.brush(int(brush_));
const ImVec2 c((a.x + b.x) * 0.5f, (a.y + b.y) * 0.5f);
@@ -2339,7 +2349,8 @@ void App::drawStrokeTile(const char* id, ImVec2 size) {
const float s = uiScale_;
if (const HeldBrushItem* held = heldBrushCurrent(heldBrush())) { // Ctrl / Ctrl+Shift: the mask's stroke
ImVec2 a, b;
- const bool clicked = tileFrame(id, size, fontSmall_, held->stroke, s, a, b);
+ ui::TileLiftScope lift;
+ const bool clicked = tileFrame(id, size, lift.lift, fontSmall_, held->stroke, s, a, b);
drawHeldBrushIcon(ImGui::GetWindowDrawList(), a, b, held->icon, heldBrush() == HeldBrush::Select);
if (clicked) openPicker(Picker::Stroke, ImVec2(ImGui::GetItemRectMax().x + 4.0f * s, ImGui::GetItemRectMin().y));
ui::HelpText("Stroke", nullptr, "Ctrl held: the mask's stroke, Dots (Mask Pen), Lasso or Rect (Ctrl+Shift: the "
@@ -2347,7 +2358,8 @@ void App::drawStrokeTile(const char* id, ImVec2 size) {
return;
}
ImVec2 a, b;
- const bool clicked = tileFrame(id, size, fontSmall_, strokeTypeName(strokeType_), s, a, b);
+ ui::TileLiftScope lift;
+ const bool clicked = tileFrame(id, size, lift.lift, fontSmall_, strokeTypeName(strokeType_), s, a, b);
ImDrawList* dl = ImGui::GetWindowDrawList();
const ImU32 col = IM_COL32(235, 235, 235, 230);
const float w = b.x - a.x, h = b.y - a.y;
@@ -2404,7 +2416,8 @@ void App::drawAlphaTile(const char* id, ImVec2 size) {
const float s = uiScale_;
ImVec2 a, b;
if (vdmBrushActive() && doc_.brushVdm) { // the VDM brush's 3D alpha (ZBrush shows VDMs in the alpha slot)
- const bool clicked = tileFrame(id, size, fontSmall_, doc_.brushVdm->name, s, a, b);
+ ui::TileLiftScope lift;
+ const bool clicked = tileFrame(id, size, lift.lift, fontSmall_, doc_.brushVdm->name, s, a, b);
if (ImTextureID tex = thumbs_.vdm(doc_.brushVdm))
ImGui::GetWindowDrawList()->AddImageRounded(tex, ImVec2(a.x + 2 * s, a.y + 2 * s), ImVec2(b.x - 2 * s, b.y - 2 * s),
ImVec2(0, 0), ImVec2(1, 1), IM_COL32_WHITE, theme::rounding(4.0f * s));
@@ -2412,7 +2425,8 @@ void App::drawAlphaTile(const char* id, ImVec2 size) {
ui::HelpText("VDM", nullptr, "The VDM brush's vector displacement map. Click to pick another.", "Left shelf");
return;
}
- const bool clicked = tileFrame(id, size, fontSmall_, doc_.brushAlpha.name, s, a, b);
+ ui::TileLiftScope lift;
+ const bool clicked = tileFrame(id, size, lift.lift, fontSmall_, doc_.brushAlpha.name, s, a, b);
ImDrawList* dl = ImGui::GetWindowDrawList();
ImTextureID tex = thumbs_.alpha(doc_.brushAlpha);
if (tex) {
@@ -2439,7 +2453,8 @@ void App::drawMaterialTile(const char* id, ImVec2 size) {
const float s = uiScale_;
const int m = renderSettings_.matcap;
ImVec2 a, b;
- const bool clicked = tileFrame(id, size, fontSmall_, m < 0 ? std::string("Studio") : std::string(matcapName(m)), s, a, b);
+ ui::TileLiftScope lift;
+ const bool clicked = tileFrame(id, size, lift.lift, fontSmall_, m < 0 ? std::string("Studio") : std::string(matcapName(m)), s, a, b);
ImDrawList* dl = ImGui::GetWindowDrawList();
const ImVec2 c((a.x + b.x) * 0.5f, (a.y + b.y) * 0.5f);
const float r = (b.x - a.x) * 0.4f;
diff --git a/src/app/Theme.cpp b/src/app/Theme.cpp
index 97878afe..2149f883 100644
--- a/src/app/Theme.cpp
+++ b/src/app/Theme.cpp
@@ -84,7 +84,7 @@ void applyStyle() {
c[ImGuiCol_TableRowBgAlt] = rgb(0xffffff, 0.025f);
c[ImGuiCol_TextSelectedBg] = rgb(0xf0882e, 0.30f);
c[ImGuiCol_DragDropTarget] = accentHover;
- c[ImGuiCol_NavCursor] = accent;
+ c[ImGuiCol_NavCursor] = ImVec4(0, 0, 0, 0); // the keyboard focus gets the hover ring instead (ui::DrawHover)
c[ImGuiCol_ModalWindowDimBg] = rgb(0x000000, 0.45f);
}
@@ -110,6 +110,19 @@ ImVec4 mixc(const ImVec4& a, const ImVec4& b, float t, float alpha = 1.0f) {
return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, alpha);
}
+// Hover in every look: the accent tints the hover fills, a little in Classic (a warm highlight), more in the
+// terminal looks; pressed is a touch darker than hover (ui::DrawHover adds the ring).
+void tintHovers(looks::LookId id) {
+ const float k = id == looks::LookId::Classic ? 0.16f : id == looks::LookId::Phosphor ? 0.28f
+ : id == looks::LookId::Blueprint ? 0.24f : 0.22f;
+ buttonHover = mixc(buttonHover, accent, k);
+ buttonPressed = mixc(buttonHover, rgb(0x000000), 0.22f);
+ headerHover = mixc(headerHover, accent, k * 0.9f);
+ frameHover = mixc(frameHover, accent, k * 0.6f);
+ toggleOffHover = mixc(toggleOffHover, accent, k);
+ toggleOnHover = mixc(toggleOnHover, accent, k * 0.7f);
+}
+
ImVec4 g_gradCentre(0.215f, 0.215f, 0.222f, 1.0f), g_gradEdge(0.106f, 0.106f, 0.114f, 1.0f);
void syncUiColors() {
@@ -183,6 +196,7 @@ void applyLook(const LookSettings& settings, std::string* status) {
for (size_t i = 0; i < std::size(kTokens); ++i) *kTokens[i] = classic[i];
g_gradCentre = ImVec4(0.215f, 0.215f, 0.222f, 1.0f);
g_gradEdge = ImVec4(0.106f, 0.106f, 0.114f, 1.0f);
+ tintHovers(id);
applyStyle();
syncUiColors();
return;
@@ -227,6 +241,7 @@ void applyLook(const LookSettings& settings, std::string* status) {
}
for (size_t i = 0; i < std::size(kTokens); ++i) *kTokens[i] = classic[i];
setTokens(palette, id);
+ tintHovers(id);
applyStyle();
ImGuiStyle& s = ImGui::GetStyle();
s.WindowRounding = s.ChildRounding = s.PopupRounding = s.FrameRounding = s.GrabRounding = s.TabRounding = 0.0f;
diff --git a/src/app/Ui.cpp b/src/app/Ui.cpp
index d4948557..2578a544 100644
--- a/src/app/Ui.cpp
+++ b/src/app/Ui.cpp
@@ -14,6 +14,8 @@
#include <cmath>
#include <cstdio>
#include <cstring>
+#include <unordered_map>
+#include <vector>
namespace sf::ui {
@@ -45,7 +47,35 @@ float uiScale() { return ImGui::GetFontSize() / 15.0f; }
// A colour of the Classic look, or the current look's token.
ImU32 lookColor(ImU32 classic, const ImVec4& token) { return theme::look.id == 0 ? classic : theme::u32(token); }
-bool itemHoveredForHelp() {
+// Hover and focus feedback (Ui.h). Items report where they are through the ImGui item hooks; DrawHover rings the
+// hovered and the keyboard-focused one at the end of the frame, in that item's window, on top of what it drew.
+constexpr float kHoverSeconds = 0.10f; // the ease-in (80-120 ms)
+struct Anim {
+ float t = 0.0f; // linear 0-1
+ int frame = 0;
+};
+std::unordered_map<ImGuiID, Anim> g_anims;
+bool g_reduceMotion = false, g_animating = false, g_animatingLast = false;
+struct Seen {
+ ImGuiID id = 0;
+ ImRect bb, clip;
+ ImGuiWindow* window = nullptr;
+ bool labelled = false;
+};
+std::vector<Seen> g_seen; // this frame: the items that are or were hovered or focused
+std::vector<ImGuiID> g_rings; // the ids with a ring showing or fading
+std::vector<ImGuiID> g_noRing;
+int g_seenFrame = -1;
+int g_ringsShown = 0, g_liftsShown = 0, g_liftsCounting = 0;
+
+float easeOut(float t) { return 1.0f - (1.0f - t) * (1.0f - t) * (1.0f - t); }
+
+bool focusedByKeyboard(ImGuiID id) {
+ const ImGuiContext& g = *GImGui;
+ return id && g.NavCursorVisible && g.NavId == id && g.NavWindow;
+}
+
+bool itemHoveredForHelp() {bool itemHoveredForHelp() {
return ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem);
}
@@ -239,7 +269,193 @@ void Keycaps(const std::string& chord) {
if (ImGui::GetCurrentContext()->LogEnabled) ImGui::LogText(" %s", chord.c_str());
}
-void DelayedTooltip(const char* text) {
+float HoverAmount(ImGuiID id, bool on) {
+ auto it = g_anims.find(id);
+ if (it == g_anims.end()) {
+ if (!on) return 0.0f;
+ it = g_anims.emplace(id, Anim{}).first;
+ }
+ Anim& a = it->second;
+ const int frame = ImGui::GetFrameCount();
+ if (a.frame != frame) {
+ a.frame = frame;
+ const float step = g_reduceMotion ? 1.0f : std::clamp(ImGui::GetIO().DeltaTime, 0.0f, 0.05f) / kHoverSeconds;
+ a.t = on ? std::min(1.0f, a.t + step) : std::max(0.0f, a.t - step);
+ }
+ if (a.t > 0.0f && a.t < 1.0f) g_animating = true;
+ const float t = easeOut(a.t);
+ if (!on && a.t <= 0.0f) g_anims.erase(it);
+ return t;
+}
+
+bool HoveredOrFocused(ImGuiID id) { return id && (ImGui::GetHoveredID() == id || focusedByKeyboard(id)); }
+
+void NoHoverRing(ImGuiID id) {
+ if (id) g_noRing.push_back(id);
+}
+
+bool HoverAnimating() { return g_animating || g_animatingLast; }
+bool ReduceMotion() { return g_reduceMotion; }
+int HoverRingsShown() { return g_ringsShown; }
+int HoverLiftsShown() { return g_liftsShown; }
+
+void NoteItem(ImGuiContext* ctx, ImGuiID id, const ImVec2& min, const ImVec2& max) {
+ if (!id || !ctx || !ctx->CurrentWindow) return;
+ if (g_seenFrame != ctx->FrameCount) {
+ g_seenFrame = ctx->FrameCount;
+ g_seen.clear();
+ g_noRing.clear();
+ }
+ bool want = id == ctx->HoveredIdPreviousFrame || id == ctx->HoveredId || id == ctx->NavId || id == ctx->ActiveId;
+ for (size_t i = 0; !want && i < g_rings.size(); ++i) want = g_rings[i] == id;
+ if (!want) return;
+ g_seen.push_back({id, ImRect(min, max), ctx->CurrentWindow->ClipRect, ctx->CurrentWindow, false});
+}
+
+void NoteItemLabel(ImGuiID id) {
+ for (auto it = g_seen.rbegin(); it != g_seen.rend(); ++it)
+ if (it->id == id) {
+ it->labelled = true;
+ return;
+ }
+}
+
+namespace {
+
+// The look's hover ring round `r` at strength t (0-1): a tinted fill and a crisp border in every look, plus its flavour.
+void drawRing(ImDrawList* dl, ImRect r, float t, float rounding, bool fill) {
+ const float s = uiScale(), px = std::max(1.0f, std::floor(s + 0.25f));
+ const ImVec4& ac = theme::accent;
+ auto rect = [&](float grow, const ImVec4& c, float alpha, float w) {
+ dl->AddRect(ImVec2(r.Min.x - grow, r.Min.y - grow), ImVec2(r.Max.x + grow, r.Max.y + grow), theme::u32(c, alpha * t),
+ rounding > 0.0f ? rounding + grow : 0.0f, 0, w);
+ };
+ const int look = theme::look.id;
+ if (fill) dl->AddRectFilled(r.Min, r.Max, theme::u32(ac, (look == 2 ? 0.16f : look == 0 ? 0.07f : 0.10f) * t), rounding);
+ // (Strokes sit half a stroke inside the rect, so the border is crisp and inside the item.)
+ r.Min.x += 0.5f * px, r.Min.y += 0.5f * px, r.Max.x -= 0.5f * px, r.Max.y -= 0.5f * px;
+ switch (look) {
+ case 0: // Classic: a subtle warm highlight
+ rect(0.0f, theme::accentHover, 0.60f, px);
+ break;
+ case 2: // Phosphor: the inverse-video glow, light bleeding out of the item
+ rect(1.0f * px, ac, 0.34f, px);
+ rect(2.0f * px, ac, 0.16f, px);
+ rect(3.0f * px, ac, 0.07f, px);
+ rect(0.0f, ac, 1.0f, px);
+ break;
+ case 3: // Blueprint: a cyan line with a soft outer line, like a highlighted drawing stroke
+ rect(1.5f * px, ac, 0.28f, 2.0f * px);
+ rect(0.0f, ac, 1.0f, px);
+ break;
+ default: // Forge Terminal: the crisp accent border
+ rect(0.0f, ac, 1.0f, std::max(px, std::floor(1.5f * s)));
+ break;
+ }
+}
+
+} // namespace
+
+TileLift BeginTileLift(ImVec2 min, ImVec2 max, float rounding) {
+ TileLift l;
+ const ImGuiID id = ImGui::GetItemID();
+ const bool disabled = (ImGui::GetItemFlags() & ImGuiItemFlags_Disabled) != 0;
+ NoHoverRing(id);
+ l.dl = ImGui::GetWindowDrawList();
+ l.min = min, l.max = max;
+ l.t = disabled ? 0.0f : HoverAmount(id, ImGui::IsItemHovered() || focusedByKeyboard(id));
+ if (l.t > 0.0f && !g_reduceMotion) {
+ // A soft shadow under the lifted tile (drawn at its lifted size), then let the tile's own drawing out of the
+ // clip by the lift.
+ const float s = uiScale(), k = 0.025f * l.t;
+ const ImVec2 c((min.x + max.x) * 0.5f, (min.y + max.y) * 0.5f), h((max.x - min.x) * (0.5f + k), (max.y - min.y) * (0.5f + k));
+ for (int i = 3; i >= 1; --i) {
+ const float g = float(i) * 1.5f * s, dy = 2.5f * s * l.t;
+ l.dl->AddRectFilled(ImVec2(c.x - h.x - g, c.y - h.y - g + dy), ImVec2(c.x + h.x + g, c.y + h.y + g + dy),
+ IM_COL32(0, 0, 0, int(30.0f * l.t)), theme::rounding(rounding * s) + g);
+ }
+ const ImVec4 cr = l.dl->_CmdHeader.ClipRect;
+ const float m = std::max(h.x, h.y) * 0.06f + 1.0f;
+ l.dl->PushClipRect(ImVec2(std::max(cr.x - m, min.x - m), std::max(cr.y - m, min.y - m)),
+ ImVec2(std::min(cr.z + m, max.x + m), std::min(cr.w + m, max.y + m)), false);
+ l.clip = true;
+ }
+ l.vtx = l.dl->VtxBuffer.Size;
+ return l;
+}
+
+void EndTileLift(const TileLift& l, float rounding) {
+ if (!l.dl || l.t <= 0.0f) return;
+ ++g_liftsCounting;
+ const ImVec2 c((l.min.x + l.max.x) * 0.5f, (l.min.y + l.max.y) * 0.5f);
+ const float scale = g_reduceMotion ? 1.0f : 1.0f + 0.05f * l.t;
+ if (scale != 1.0f)
+ for (int i = l.vtx; i < l.dl->VtxBuffer.Size; ++i) {
+ ImVec2& p = l.dl->VtxBuffer[i].pos;
+ p = ImVec2(c.x + (p.x - c.x) * scale, c.y + (p.y - c.y) * scale);
+ }
+ const ImVec2 h((l.max.x - l.min.x) * 0.5f * scale, (l.max.y - l.min.y) * 0.5f * scale);
+ const float s = uiScale(), px = std::max(1.0f, std::floor(s + 0.25f));
+ // The glow ring just outside the tile (the active tile's orange outline stays inside it).
+ const ImRect r(ImVec2(c.x - h.x - px, c.y - h.y - px), ImVec2(c.x + h.x + px, c.y + h.y + px));
+ drawRing(l.dl, r, l.t, theme::rounding(rounding * s), false);
+ if (theme::look.id != 2) // a soft second line: the glow (Phosphor's ring brings its own)
+ l.dl->AddRect(ImVec2(r.Min.x - 1.5f * px, r.Min.y - 1.5f * px), ImVec2(r.Max.x + 1.5f * px, r.Max.y + 1.5f * px),
+ theme::u32(theme::accent, 0.22f * l.t), theme::rounding(rounding * s) + 1.5f * px, 0, 2.0f * px);
+ if (l.clip) l.dl->PopClipRect();
+}
+
+void DrawHover(App& app) {
+ g_reduceMotion = app.uiPrefs().reduceMotion;
+ g_animatingLast = g_animating;
+ g_animating = false;
+ g_liftsShown = g_liftsCounting;
+ g_liftsCounting = 0;
+ g_ringsShown = 0;
+ const ImGuiContext& g = *GImGui;
+ if (g_seenFrame != g.FrameCount) g_seen.clear(), g_noRing.clear(); // no items this frame
+ const ImGuiID hovered = g.HoveredId, focused = g.NavCursorVisible && g.NavWindow ? g.NavId : 0;
+ const float fh = ImGui::GetFrameHeight();
+ auto find = [&](ImGuiID id) -> const Seen* {
+ if (!id || std::find(g_noRing.begin(), g_noRing.end(), id) != g_noRing.end()) return nullptr;
+ for (auto it = g_seen.rbegin(); it != g_seen.rend(); ++it)
+ if (it->id == id) {
+ // Only labelled widgets, and nothing as big as a view (the UV editor, the timeline's track).
+ if (!it->labelled || (it->bb.GetWidth() > 16.0f * fh && it->bb.GetHeight() > 4.0f * fh)) return nullptr;
+ return &*it;
+ }
+ return nullptr;
+ };
+ for (ImGuiID id : {hovered, focused})
+ if (find(id) && std::find(g_rings.begin(), g_rings.end(), id) == g_rings.end()) g_rings.push_back(id);
+ for (size_t i = 0; i < g_rings.size();) {
+ const ImGuiID id = g_rings[i];
+ const Seen* at = find(id);
+ const bool on = at && (id == hovered || id == focused);
+ const float t = HoverAmount(id, on);
+ if (!at || t <= 0.0f) { // gone (its window closed, or it draws its own hover now), or faded out
+ g_anims.erase(id);
+ g_rings.erase(g_rings.begin() + std::ptrdiff_t(i));
+ continue;
+ }
+ ImDrawList* dl = at->window->DrawList;
+ const float m = 4.0f * uiScale();
+ ImRect clip(at->clip.Min.x - m, at->clip.Min.y - m, at->clip.Max.x + m, at->clip.Max.y + m);
+ clip.ClipWith(at->window->OuterRectClipped);
+ clip.ClipWith(ImRect(ImVec2(0, 0), g.IO.DisplaySize));
+ dl->PushClipRect(clip.Min, clip.Max, false);
+ drawRing(dl, at->bb, t, ImGui::GetStyle().FrameRounding, id != g.ActiveId);
+ dl->PopClipRect();
+ ++g_ringsShown;
+ ++i;
+ }
+ // Forget items that stopped animating long ago (a window closed under the pointer).
+ const int frame = ImGui::GetFrameCount();
+ for (auto it = g_anims.begin(); it != g_anims.end();)
+ it = frame - it->second.frame > 120 ? g_anims.erase(it) : std::next(it);
+}
+
+void DelayedTooltip(const char* text) {void DelayedTooltip(const char* text) {
if (!text || !*text || CtrlHeld()) return;
if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay)) ImGui::SetTooltip("%s", tr(text));
}
@@ -269,16 +485,32 @@ bool ActionButton(App& app, const char* actionId, ImVec2 size, Look look) {
// 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);
+ const std::string itemLabel = label + "##" + id;
int colors = 0;
if (checked) {
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;
+ } else if (look != Look::Tile && enabled) {
+ // Hover eases the fill towards the accent-tinted hover and brightens the label (Phosphor: inverse video, the
+ // accent fill with a dark label); pressed is darker. (Hovered as of the last frame: the item isn't drawn yet.)
+ const float h = HoverAmount(ImGui::GetID(itemLabel.c_str()), HoveredOrFocused(ImGui::GetID(itemLabel.c_str())));
+ if (h > 0.0f) {
+ auto mix = [h](const ImVec4& a, const ImVec4& b) {
+ return ImVec4(a.x + (b.x - a.x) * h, a.y + (b.y - a.y) * h, a.z + (b.z - a.z) * h, a.w + (b.w - a.w) * h);
+ };
+ const bool inverse = theme::look.id == 2;
+ const ImVec4 fill = mix(ImGui::GetStyleColorVec4(ImGuiCol_Button), inverse ? theme::accent : theme::buttonHover);
+ const ImVec4 ink = mix(ImGui::GetStyleColorVec4(ImGuiCol_Text), inverse ? theme::textOnAccent : theme::textHover);
+ ImGui::PushStyleColor(ImGuiCol_Button, fill);
+ ImGui::PushStyleColor(ImGuiCol_ButtonHovered, fill);
+ ImGui::PushStyleColor(ImGuiCol_Text, ink);
+ colors = 3;
+ }
}
ImGui::BeginDisabled(!enabled);
bool clicked = false;
- const std::string itemLabel = label + "##" + id;
bool clipped = false;
if (look == Look::Label) {
clicked = ImGui::Button(itemLabel.c_str(), size);
@@ -379,6 +611,8 @@ bool SliderInside(const char* id, float* v, float lo, float hi, const char* form
ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, ImVec4(0, 0, 0, 0));
const bool changed = ImGui::SliderFloat(id, v, lo, hi, format ? tr(format) : format, flags);
const bool active = ImGui::IsItemActive();
+ const bool disabled = (ImGui::GetItemFlags() & ImGuiItemFlags_Disabled) != 0;
+ const float hover = disabled ? 0.0f : HoverAmount(ImGui::GetItemID(), ImGui::IsItemHovered() || active || focusedByKeyboard(ImGui::GetItemID()));
ImGui::PopStyleColor(5);
if (numbers) {
ImGui::PopStyleVar();
@@ -401,13 +635,34 @@ bool SliderInside(const char* id, float* v, float lo, float hi, const char* form
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,
+ dl->AddRectFilled(p, ImVec2(p.x + fillW, p.y + h), theme::u32(theme::sliderFill, active ? 1.5f : 1.0f + 0.35f * hover), rounding,
full ? ImDrawFlags_RoundCornersAll : ImDrawFlags_RoundCornersLeft);
+ // Hover brightens the bar towards the accent and grows a knob at its end (Reduce motion: no growing).
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);
+ const ImVec4& b0 = theme::sliderBar;
+ const ImVec4& b1 = theme::accent;
+ const float k = active ? 1.0f : 0.6f * hover;
+ const ImU32 barCol = theme::u32(ImVec4(b0.x + (b1.x - b0.x) * k, b0.y + (b1.y - b0.y) * k, b0.z + (b1.z - b0.z) * k, 1.0f));
+ dl->AddRectFilled(ImVec2(p.x, p.y + h - bar), ImVec2(p.x + fillW, p.y + h), barCol, std::min(rounding, bar),
+ full ? ImDrawFlags_RoundCornersBottom : ImDrawFlags_RoundCornersBottomLeft);
+ if (hover > 0.0f) {
+ const float kw = bar * (ReduceMotion() ? 1.5f : 1.0f + 0.6f * hover), kh = bar * (ReduceMotion() ? 3.0f : 1.5f + 2.0f * hover);
+ const float x = std::clamp(p.x + fillW, p.x + kw, p.x + w - kw);
+ dl->AddRectFilled(ImVec2(x - kw, p.y + h - kh), ImVec2(x + kw, p.y + h), theme::u32(active ? theme::accent : theme::textBright, hover),
+ std::min(rounding, kw));
+ }
}
dl->ChannelsMerge();
+ // The value, exactly, while pointing at it or dragging (the label inside may round it or be clipped).
+ if (hover > 0.0f && (ImGui::IsItemHovered() || active) && !CtrlHeld() && format) {
+ const char* f = tr(format);
+ const char* spec = ImParseFormatFindStart(f);
+ if (*spec) {
+ char buf[32] = "";
+ const char* one = ImParseFormatTrimDecorations(spec, buf, sizeof(buf));
+ if (active || ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_NoSharedDelay)) ImGui::SetTooltip(one, double(*v));
+ }
+ }
return changed;
}
diff --git a/src/app/Ui.h b/src/app/Ui.h
index 651d72de..641b8345 100644
--- a/src/app/Ui.h
+++ b/src/app/Ui.h
@@ -43,6 +43,43 @@ void HelpAction(App& app, const char* actionId);
// 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);
+// Hover and keyboard focus (docs/ui-design.md §10): every labelled item gets the look's ring (an accent border,
+// Phosphor's glow, Blueprint's cyan line, Classic's warm edge) that eases in over ~100 ms; tiles lift instead.
+// Animations only keep the main loop drawing while they run (HoverAnimating); Reduce motion makes them instant
+// and turns the lift's scaling off.
+// Eased 0-1 for `id` heading to `on` (instant under Reduce motion). Items that were never on cost nothing.
+float HoverAmount(ImGuiID id, bool on);
+// The last item is hovered (or, last frame, was hovered: before the item is drawn) or has the keyboard focus.
+bool HoveredOrFocused(ImGuiID id);
+// The item `id` draws its own hover (tiles, the canvas): no ring for it this frame.
+void NoHoverRing(ImGuiID id);
+bool HoverAnimating();
+// For UI tests: the rings and lifted tiles drawn in the last frame.
+int HoverRingsShown();
+int HoverLiftsShown();
+bool ReduceMotion();
+// A tile that lifts on hover: begin after its InvisibleButton (draws the shadow), draw the tile, then end (scales
+// what was drawn by up to 1.05 about the centre and adds the glow ring). Draw-only: the layout never moves.
+struct TileLift {
+ ImDrawList* dl = nullptr;
+ int vtx = 0;
+ ImVec2 min, max;
+ float t = 0.0f;
+ bool clip = false;
+};
+TileLift BeginTileLift(ImVec2 min, ImVec2 max, float rounding = 4.0f);
+void EndTileLift(const TileLift& lift, float rounding = 4.0f);
+// Ends the lift when it goes out of scope (tiles drawn by several functions, or with early returns).
+struct TileLiftScope {
+ TileLift lift;
+ ~TileLiftScope() { EndTileLift(lift); }
+};
+// Draws this frame's hover and focus rings; call once, after every window and before DrawHelp.
+void DrawHover(App& app);
+// From the ImGui item hooks (Demo.cpp): where this frame's candidates for a ring are.
+void NoteItem(ImGuiContext* ctx, ImGuiID id, const ImVec2& min, const ImVec2& max);
+void NoteItemLabel(ImGuiID id);
+
// Customize mode: shelves this payload ("SF_UIITEM") is dragged from and dropped on.
enum Shelf { ShelfNone = -1, ShelfTop, ShelfLeft, ShelfRight, ShelfBottom };
struct UiItemPayload {
diff --git a/src/app/UiTest.cpp b/src/app/UiTest.cpp
index fcef8be5..306a113d 100644
--- a/src/app/UiTest.cpp
+++ b/src/app/UiTest.cpp
@@ -463,6 +463,9 @@ double Demo::query(const std::string& name, bool& known) const {
if (name == "right_click_menu") return app_.uiPrefs_.rightClickQuickMenu ? 1.0 : 0.0;
if (name == "space_camera") return app_.uiPrefs_.spaceCamera ? 1.0 : 0.0;
if (name == "look") return double(app_.uiPrefs_.look.look); // 0 Classic, 1 Forge Terminal, 2 Phosphor, 3 Blueprint
+ if (name == "hover_rings") return double(ui::HoverRingsShown()); // hover and focus rings drawn last frame
+ if (name == "hover_lifts") return double(ui::HoverLiftsShown()); // tiles lifted last frame
+ if (name == "reduce_motion") return app_.uiPrefs_.reduceMotion ? 1.0 : 0.0;
if (name == "shell_layout") return double(app_.uiPrefs_.shellLayout); // 0 ZBrush-style, 1 SculptForge
if (name == "air_strokes") return app_.uiPrefs_.airStrokes ? 1.0 : 0.0;
if (name == "space_held") return app_.spaceHeld_ ? 1.0 : 0.0;
diff --git a/tests/ui/hover_pop.sfui b/tests/ui/hover_pop.sfui
new file mode 100644
index 00000000..5ba00c76
--- /dev/null
+++ b/tests/ui/hover_pop.sfui
@@ -0,0 +1,65 @@
+# Hover highlights (0.10.8): in every look the hovered button or menu gets the look's ring, a tile lifts and draws
+# its own glow instead, and Preferences > Interface > Reduce motion keeps the highlight (colour only).
+run new_sphere subdivisions=3
+expect_value reduce_motion == 0
+
+run ui_look look=forge scheme=tokyo_night
+wait 0.2
+hover "Clay##brush.clay"
+wait 0.3
+expect_value hover_lifts == 1
+expect_value hover_rings == 0 # the tile's glow, not a second ring
+shot forge_tile
+hover "File##menu.file"
+wait 0.3
+expect_value hover_rings == 1
+expect_value hover_lifts == 0
+shot forge_menu
+
+run ui_look look=phosphor
+wait 0.2
+hover "Clay##brush.clay"
+wait 0.3
+expect_value hover_lifts == 1
+shot phosphor_tile
+hover "File##menu.file"
+wait 0.3
+expect_value hover_rings == 1
+shot phosphor_menu
+
+run ui_look look=blueprint
+wait 0.2
+hover "Clay##brush.clay"
+wait 0.3
+expect_value hover_lifts == 1
+shot blueprint_tile
+hover "File##menu.file"
+wait 0.3
+expect_value hover_rings == 1
+shot blueprint_menu
+
+run ui_look look=classic
+wait 0.2
+hover "Clay##brush.clay"
+wait 0.3
+expect_value hover_lifts == 1
+shot classic_tile
+hover "File##menu.file"
+wait 0.3
+expect_value hover_rings == 1
+shot classic_menu
+
+# Reduce motion: the ring and the tile's glow stay, only the motion goes.
+click "Edit##menu.edit"
+click "Preferences##section.preferences"
+click "Interface##preferences.interface"
+click "Reduce motion"
+expect_value reduce_motion == 1
+key escape
+hover "Clay##brush.clay"
+wait 0.2
+expect_value hover_lifts == 1
+shot classic_tile_reduce_motion
+hover "File##menu.file"
+wait 0.2
+expect_value hover_rings == 1