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.

Compact bars: the Sculpt Timeline is one thin row by default, the Library strip resizes by its edge (@factoberplay)

islandmedc9923ba3a927
diff --git a/changes/feat-ui-compact.md b/changes/feat-ui-compact.md
new file mode 100644
index 00000000..b74de904
--- /dev/null
+++ b/changes/feat-ui-compact.md
@@ -0,0 +1,18 @@
+---
+whats_new: **Slimmer Library and timeline**: the Library strip and the Sculpt Timeline under it take about a third
+ less of the viewport's height. The timeline is one thin row (the full strip is one click away, or **Edit >
+ Preferences > Interface > Compact timeline**), and you can drag the Library's edge to size its thumbnails.
+ Thanks @factoberplay (YouTube).
+highlight: Slimmer Library and timeline: more room for the model
+changed: **Compact bars** (@factoberplay, YouTube): the Library strip and the Sculpt Timeline take 158 logical px
+ instead of 228 (31% less). The Library's thumbnails are 64 px by default (were 96) and its tab row 26 px; drag
+ the strip's edge toward the canvas to size them (48-128 px, kept with the layout; also **Edit > Preferences >
+ Library > Thumbnails**). The timeline is one row (step count, track, icon buttons) with thin branch lanes; the
+ full strip with its header row comes back from the unfold icon or **Edit > Preferences > Interface > Compact
+ timeline**.
+testers:
+ - Windows at 150% and 200% scaling, 1080p: open the Library (comma); it and the timeline under it are slimmer, no
+ text clipped. Scrub the timeline track, click its save / film / unfold / arrow icons.
+ - Any OS: drag the Library's bottom edge down and up; thumbnails grow and shrink, the timeline follows. Restart
+ with Save Layout: the size is kept.
+---
diff --git a/docs/guide/interface.md b/docs/guide/interface.md
index bd8f7257..db34e68d 100644
--- a/docs/guide/interface.md
+++ b/docs/guide/interface.md
@@ -373,6 +373,7 @@ Working with the strip:
and forward through tabs and folders, and the breadcrumb shows where you are.
- Type in **Filter** to show only items whose names contain the text.
- Choose **1** to **4** rows of thumbnails.
+- Drag the strip's edge toward the canvas to make the thumbnails bigger or smaller (48 to 128 px; 64 by default).
- **Open folder...** adds a folder of your own to the root of every tab.
- On the Snapshots tab, **Save now** takes a snapshot.
- The **x** at the right end of the header, or <kbd>Esc</kbd>, closes the Library (while you type in Filter,
@@ -608,7 +609,7 @@ charcoal radial gradient (the default), or **Flat Colour**, one solid colour wit
saves itself for the next session, and each project keeps the background it was saved with. From a script:
`set_background mode=flat`, `set_background color=60,70,80` or `set_background mode=gradient`.
-**Edit > Preferences > Library** has **Show at startup** (on by default), the number of **Rows**, **Placement**
+**Edit > Preferences > Library** has **Show at startup** (on by default), the number of **Rows**, the **Thumbnails** size, **Placement**
(along the top of the canvas, or at the bottom above the bottom shelf) and the **Library folder**.
**Edit > Preferences > Autosave** sets how often a recovery copy is saved (see [Projects, autosave and snapshots](projects.md)).
diff --git a/docs/guide/timeline.md b/docs/guide/timeline.md
index d6c02580..64484995 100644
--- a/docs/guide/timeline.md
+++ b/docs/guide/timeline.md
@@ -19,10 +19,12 @@ tick marks a re-tuned stroke.
- **Click** a tick to go to the state after that step.
- **Point** at a tick for what the step was, how many vertices it changed and when.
- **Right-click** a stroke to re-tune it (see below).
-- The header shows the step you are at, the number of branches and the step's name. **Save with project**
- keeps the history with the project, the film icon exports a timelapse, and the arrow folds the strip into a
- small **Timeline** tab (click the tab to open it again; **Sculpt Timeline** in the command palette, F3, does
- the same).
+- The strip is one thin row: the step you are at on the left (point at it for the step's name and the
+ number of branches), the track, then the buttons. The save icon (**Save with project**, lit when on) keeps the
+ history with the project, the film icon exports a timelapse, the unfold icon shows the full strip with a
+ header row (**Edit > Preferences > Interface > Compact timeline** switches it too), and the arrow folds the
+ strip into a small **Timeline** tab (click the tab to open it again; **Sculpt Timeline** in the command
+ palette, F3, does the same).
Undo and Redo (<kbd>Ctrl</kbd>+<kbd>Z</kbd>, <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Z</kbd>) move the scrubber one
step, as before. Each Part keeps its own timeline, like its own undo history.
@@ -72,7 +74,7 @@ about the last 100 strokes of the size above, a 33 million one about 70; small d
## Saving the history
-Tick **Save with project** in the strip's header and saving a project also writes its history beside it, as
+Turn on **Save with project** (the save icon on the strip) and saving a project also writes its history beside it, as
`name.sfhist` next to `name.sfproj`. Opening the project brings the timeline back, branches and re-tuned strengths
included, as long as the project hasn't been changed elsewhere since. Sculpt strokes, masks, vertex paint, visibility
and face groups are saved; a topology change (dynamic topology, remesh, Divide, sculpt layers) cuts the saved
diff --git a/src/app/App.h b/src/app/App.h
index c2d83209..2f2e93ff 100644
--- a/src/app/App.h
+++ b/src/app/App.h
@@ -2634,6 +2634,7 @@ private:
void drawTimelineUi(); // once a frame from drawUi: keeps the timeline attached and draws the strip
float timelineTopInset_ = 0.0f; // how far down the canvas the strip (or its tab) reaches at the top; 0 at the bottom
float timelineStripY_ = -1.0f; // the strip's (or tab's) top edge in window pixels this frame (-1: not shown)
+ float timelineStripH_ = 0.0f; // and its height (UI tests: timeline_height)
void registerTimelineUiActions(); // view.timeline, timeline.timelapse, help.benchmark
void startTimelapse(const std::string& path, int width, int height, float seconds, int fps);
bool timelapseStep(double budgetSeconds); // renders frames for up to the budget; false when finished
diff --git a/src/app/Config.cpp b/src/app/Config.cpp
index 9485595d..86d133fd 100644
--- a/src/app/Config.cpp
+++ b/src/app/Config.cpp
@@ -1611,6 +1611,11 @@ void drawInterfaceSection(App& app) {
// Timeline position (#63): the Sculpt Timeline strip at the top of the viewport (the default) or the bottom.
ImGui::TextDisabled("%s", tr("Timeline position"));
ui::Segmented(app, {"view.timeline_top", "view.timeline_bottom"});
+ if (const Action* a = app.actions().find("view.timeline_compact"); a && a->checked) { // one thin row (@factoberplay)
+ bool compact = a->checked();
+ if (ui::Checkbox("Compact timeline##view.timeline_compact", &compact)) a->run();
+ ui::HelpAction(app, "view.timeline_compact");
+ }
static const char* kScales[] = {"Automatic", "100%", "125%", "150%", "175%", "200%"};
static const float kScaleValues[] = {0.0f, 1.0f, 1.25f, 1.5f, 1.75f, 2.0f};
int current = 0;
diff --git a/src/app/I18nSimplifiedChinese.cpp b/src/app/I18nSimplifiedChinese.cpp
index 239c2c00..b47e562c 100644
--- a/src/app/I18nSimplifiedChinese.cpp
+++ b/src/app/I18nSimplifiedChinese.cpp
@@ -4376,6 +4376,31 @@ constexpr Entry kSimplifiedChinese[] = {
"旋转模板,以逆时针度数表示;Ctrl+点击以输入。"},
{"Centre the Stencil again, upright, 80% of the view's height.",
"将模板重新居中、摆正,高度为视图的 80%。"},
+ // Compact bars (@factoberplay)
+ {"%zu branch",
+ "%zu 个分支"},
+ {"%zu branches",
+ "%zu 个分支"},
+ {"Compact timeline",
+ "精简时间轴"},
+ {"Drag to make the Library's thumbnails bigger or smaller.",
+ "拖动以放大或缩小资源库的缩略图。"},
+ {"Fold the header row into the track's row: a thinner strip.",
+ "将标题行并入轨道行:更细的条带。"},
+ {"Full timeline",
+ "完整时间轴"},
+ {"Library size",
+ "资源库大小"},
+ {"Show the timeline with its header row (Preferences > Interface > Compact timeline).",
+ "显示带有标题行的时间轴(偏好设置 > 界面 > 精简时间轴)。"},
+ {"Size of the Library's thumbnails (64 by default); dragging the strip's edge toward the canvas does the same.",
+ "资源库缩略图的大小(默认 64);向画布拖动条带的边缘效果相同。"},
+ {"The Sculpt Timeline as one thin row: the step count, the track and icon buttons (the default). Off: the full strip, with a header row above the track. Saved automatically.",
+ "雕刻时间轴显示为一条细行:步数、轨道和图标按钮(默认)。关闭:完整条带,轨道上方有标题行。自动保存。"},
+ {"Thumbnail size",
+ "缩略图大小"},
+ {"Thumbnails %.0f px",
+ "缩略图 %.0f px"},
};
} // namespace
diff --git a/src/app/I18nSpanish.cpp b/src/app/I18nSpanish.cpp
index 3dc741f0..01400118 100644
--- a/src/app/I18nSpanish.cpp
+++ b/src/app/I18nSpanish.cpp
@@ -4854,6 +4854,31 @@ constexpr Entry kSpanish[] = {
"Barra superior"},
{"Status bar",
"Barra de estado"},
+ // Compact bars (@factoberplay)
+ {"%zu branch",
+ "%zu rama"},
+ {"%zu branches",
+ "%zu ramas"},
+ {"Compact timeline",
+ "Línea de tiempo compacta"},
+ {"Drag to make the Library's thumbnails bigger or smaller.",
+ "Arrastra para agrandar o achicar las miniaturas de la Biblioteca."},
+ {"Fold the header row into the track's row: a thinner strip.",
+ "Pliega la fila de cabecera en la fila de la pista: una tira más delgada."},
+ {"Full timeline",
+ "Línea de tiempo completa"},
+ {"Library size",
+ "Tamaño de la Biblioteca"},
+ {"Show the timeline with its header row (Preferences > Interface > Compact timeline).",
+ "Muestra la línea de tiempo con su fila de cabecera (Preferencias > Interfaz > Línea de tiempo compacta)."},
+ {"Size of the Library's thumbnails (64 by default); dragging the strip's edge toward the canvas does the same.",
+ "Tamaño de las miniaturas de la Biblioteca (64 por defecto); arrastrar el borde de la tira hacia el lienzo hace lo mismo."},
+ {"The Sculpt Timeline as one thin row: the step count, the track and icon buttons (the default). Off: the full strip, with a header row above the track. Saved automatically.",
+ "La Línea de tiempo de esculpido en una sola fila delgada: el número de pasos, la pista y botones de icono (por defecto). Desactivado: la tira completa, con una fila de cabecera sobre la pista. Se guarda automáticamente."},
+ {"Thumbnail size",
+ "Tamaño de miniatura"},
+ {"Thumbnails %.0f px",
+ "Miniaturas %.0f px"},
};
} // namespace
diff --git a/src/app/I18nTraditionalChinese.cpp b/src/app/I18nTraditionalChinese.cpp
index 9a588b62..772edb72 100644
--- a/src/app/I18nTraditionalChinese.cpp
+++ b/src/app/I18nTraditionalChinese.cpp
@@ -4374,6 +4374,31 @@ constexpr Entry kTraditionalChinese[] = {
"旋轉模板,以逆時針度數表示;Ctrl+點擊以輸入。"},
{"Centre the Stencil again, upright, 80% of the view's height.",
"將模板重新置中、擺正,高度為視圖的 80%。"},
+ // Compact bars (@factoberplay)
+ {"%zu branch",
+ "%zu 個分支"},
+ {"%zu branches",
+ "%zu 個分支"},
+ {"Compact timeline",
+ "精簡時間軸"},
+ {"Drag to make the Library's thumbnails bigger or smaller.",
+ "拖曳以放大或縮小資源庫的縮圖。"},
+ {"Fold the header row into the track's row: a thinner strip.",
+ "將標題列併入軌道列:更細的長條。"},
+ {"Full timeline",
+ "完整時間軸"},
+ {"Library size",
+ "資源庫大小"},
+ {"Show the timeline with its header row (Preferences > Interface > Compact timeline).",
+ "顯示帶有標題列的時間軸(偏好設定 > 界面 > 精簡時間軸)。"},
+ {"Size of the Library's thumbnails (64 by default); dragging the strip's edge toward the canvas does the same.",
+ "資源庫縮圖的大小(預設 64);朝畫布拖曳長條的邊緣效果相同。"},
+ {"The Sculpt Timeline as one thin row: the step count, the track and icon buttons (the default). Off: the full strip, with a header row above the track. Saved automatically.",
+ "雕刻時間軸顯示為一條細列:步數、軌道和圖示按鈕(預設)。關閉:完整長條,軌道上方有標題列。自動儲存。"},
+ {"Thumbnail size",
+ "縮圖大小"},
+ {"Thumbnails %.0f px",
+ "縮圖 %.0f px"},
};
} // namespace
diff --git a/src/app/LibraryBrowser.cpp b/src/app/LibraryBrowser.cpp
index 57f2caa2..eeaf0748 100644
--- a/src/app/LibraryBrowser.cpp
+++ b/src/app/LibraryBrowser.cpp
@@ -39,10 +39,10 @@ std::string materialGroup(const AssetEntry& e) {
namespace fs = std::filesystem;
constexpr const char* kStarterFolder = "Starter meshes"; // the Tool tab's folder of core/StarterMeshes.h
-constexpr float kTile = 96.0f; // thumbnail size (logical px)
constexpr float kLabel = 22.0f; // label under it
constexpr float kGap = 8.0f; // between tiles
-constexpr float kHeader = 28.0f; // tab row
+constexpr float kHeader = 26.0f; // tab row
+constexpr float kBottom = 10.0f; // below the tiles: the scrollbar's room
constexpr ImU32 kAccent = IM_COL32(240, 136, 46, 255);
constexpr ImU32 kStripBg = IM_COL32(20, 20, 22, 250); // #141416 at 98%
constexpr ImU32 kHeaderLine = IM_COL32(46, 46, 50, 255);
@@ -124,8 +124,9 @@ void SDLCALL onFolderChosen(void* userdata, const char* const* files, int) {
} // namespace
-float LibraryBrowser::height(int rows, float scale) {
- return (kHeader + float(std::clamp(rows, 1, 4)) * (kTile + kLabel + 4.0f) + 12.0f) * scale;
+float LibraryBrowser::height(const UiLayout& layout, float scale) {
+ const float tile = std::clamp(layout.libraryTile, kLibraryTileMin, kLibraryTileMax);
+ return (kHeader + float(std::clamp(layout.libraryRows, 1, 4)) * (tile + kLabel + 4.0f) + kBottom) * scale;
}
void LibraryBrowser::show(LibraryTab tab) {
@@ -840,6 +841,7 @@ void LibraryBrowser::draw(App& app, const CanvasRect& canvas) {
layout.libraryOpen = open_;
layout.libraryTab = libraryTabId(place_.tab);
layout.libraryRows = std::clamp(layout.libraryRows, 1, 4);
+ layout.libraryTile = std::round(std::clamp(layout.libraryTile, kLibraryTileMin, kLibraryTileMax));
app.libraryScanner_.poll(ImGui::GetTime());
// Esc closes the Library (#80), unless a picker, a pop-up or a text field has the keys (they take Esc first).
if (open_ && ImGui::IsKeyPressed(ImGuiKey_Escape, false) && !ImGui::GetIO().WantCaptureKeyboard &&
@@ -853,7 +855,8 @@ void LibraryBrowser::draw(App& app, const CanvasRect& canvas) {
const float scale = app.uiScale_;
const int rows = layout.libraryRows;
- const float h = std::min(height(rows, scale), canvas.h);
+ const float tileLogical = layout.libraryTile;
+ const float h = std::min(height(layout, scale), canvas.h);
const float y = layout.libraryBottom ? canvas.y + canvas.h - h : canvas.y;
ImGui::SetNextWindowPos(ImVec2(canvas.x, y));
ImGui::SetNextWindowSize(ImVec2(canvas.w, h));
@@ -882,13 +885,14 @@ void LibraryBrowser::draw(App& app, const CanvasRect& canvas) {
ImGui::SetCursorPosY(std::round((kHeader * scale - ImGui::GetFrameHeight()) * 0.5f));
drawHeader(app, ws.x - 16.0f * scale);
if (place_.tab == LibraryTab::Packs) { // a list, not tiles (PanelPacks.cpp)
- app.drawPacksTab(float(rows) * (kTile + kLabel + 4.0f) * scale + 8.0f * scale);
+ app.drawPacksTab(float(rows) * (tileLogical + kLabel + 4.0f) * scale + 8.0f * scale);
ImGui::End();
+ drawResizeHandle(app, wp, ws);
return;
}
const std::vector<AssetEntry> items = entries(app);
- const float tile = kTile * scale, rowH = (kTile + kLabel + 4.0f) * scale, gap = kGap * scale;
+ const float tile = tileLogical * scale, rowH = (tileLogical + kLabel + 4.0f) * scale, gap = kGap * scale;
// Column-major tiles; a Lit Sphere group (#124) starts a new column after a heading column with its name.
std::vector<ImVec2> at(items.size()); // each tile's place in the strip (x, row)
struct Heading {
@@ -1070,6 +1074,7 @@ void LibraryBrowser::draw(App& app, const CanvasRect& canvas) {
}
}
ImGui::End();
+ drawResizeHandle(app, wp, ws);
// A tile dragged out of the strip follows the cursor; releasing it over the canvas loads it.
if (tileDrag_) {
@@ -1088,6 +1093,49 @@ void LibraryBrowser::draw(App& app, const CanvasRect& canvas) {
}
}
+// The strip's edge toward the canvas: drag it to make the thumbnails (and so the strip) bigger or smaller
+// (@factoberplay). A thin window of its own across the edge, so the canvas never takes the press as a stroke.
+void LibraryBrowser::drawResizeHandle(App& app, ImVec2 pos, ImVec2 size) {
+ UiLayout& layout = app.layout_;
+ const float scale = app.uiScale_, band = 8.0f * scale;
+ const float edge = layout.libraryBottom ? pos.y : pos.y + size.y;
+ ImGui::SetNextWindowPos(ImVec2(pos.x, edge - band * 0.5f));
+ ImGui::SetNextWindowSize(ImVec2(size.x, band));
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(1, 1));
+ const bool visible = ImGui::Begin("##lbresize", nullptr,
+ ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings |
+ ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoBackground |
+ ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoNav);
+ ImGui::PopStyleVar(2);
+ if (visible) {
+ ImGui::SetCursorScreenPos(ImVec2(pos.x, edge - band * 0.5f));
+ ImGui::InvisibleButton("Library size##lbresize", ImVec2(size.x, band));
+ const bool hovered = ImGui::IsItemHovered(), active = ImGui::IsItemActive();
+ const ImGuiIO& io = ImGui::GetIO();
+ if (ImGui::IsItemActivated()) {
+ resizing_ = true;
+ resizeY_ = io.MouseClickedPos[ImGuiMouseButton_Left].y; // where the press was, not where the pointer is now
+ resizeTile_ = layout.libraryTile;
+ }
+ if (resizing_ && (active || ImGui::IsItemDeactivated())) { // (the release frame too: its motion counts)
+ // The strip's edge follows the pointer: the extra height goes to every row's thumbnails.
+ const float dy = (io.MousePos.y - resizeY_) * (layout.libraryBottom ? -1.0f : 1.0f);
+ layout.libraryTile = std::round(std::clamp(resizeTile_ + dy / scale / float(std::max(layout.libraryRows, 1)),
+ kLibraryTileMin, kLibraryTileMax));
+ }
+ if (!active) resizing_ = false;
+ if (hovered || active) {
+ ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeNS);
+ const float w = 36.0f * scale, cx = pos.x + size.x * 0.5f;
+ ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(cx - w * 0.5f, edge - 1.5f * scale), ImVec2(cx + w * 0.5f, edge + 1.5f * scale),
+ active ? kAccent : IM_COL32(120, 120, 128, 255), 2.0f * scale);
+ }
+ ui::HelpText("Library size", nullptr, "Drag to make the Library's thumbnails bigger or smaller.", "Library");
+ }
+ ImGui::End();
+}
+
bool LibraryBrowser::takeDrop(App& app, float x, float y, const std::string& path) {
if (!open_ || place_.tab != LibraryTab::Material || !isLitSphereFile(path)) return false;
if (x < shownMin_.x || y < shownMin_.y || x >= shownMax_.x || y >= shownMax_.y) return false;
@@ -1104,6 +1152,11 @@ void LibraryBrowser::drawPreferences(App& app) {
ImGui::SetNextItemWidth(-1);
ImGui::SliderInt("##lbrowspref", &layout.libraryRows, 1, 4, tr("Rows %d"));
ui::HelpText("Rows", nullptr, "Rows of thumbnails in the Library strip.", "Preferences > Library");
+ ImGui::SetNextItemWidth(-1);
+ ImGui::SliderFloat("##lbtilepref", &layout.libraryTile, kLibraryTileMin, kLibraryTileMax, tr("Thumbnails %.0f px"));
+ ui::HelpText("Thumbnail size", nullptr,
+ "Size of the Library's thumbnails (64 by default); dragging the strip's edge toward the canvas does the same.",
+ "Preferences > Library");
int placement = layout.libraryBottom ? 1 : 0;
ImGui::TextUnformatted(tr("Placement"));
ImGui::SameLine();
diff --git a/src/app/LibraryBrowser.h b/src/app/LibraryBrowser.h
index 95c16de2..a7e02de6 100644
--- a/src/app/LibraryBrowser.h
+++ b/src/app/LibraryBrowser.h
@@ -35,8 +35,8 @@ public:
void showFolder(LibraryTab tab, const std::string& folder);
// Preferences > Library (the shell's Preferences palette calls this).
void drawPreferences(App& app);
- // Height the strip takes over the canvas at `rows` rows (logical px x scale).
- static float height(int rows, float scale);
+ // Height the strip takes over the canvas with the layout's rows and tile size (logical px x scale).
+ static float height(const UiLayout& layout, float scale);
// A file dropped at (x, y) (window coordinates): an image dropped on the Material tab loads as a Lit Sphere (#124).
// False when the Library doesn't take it (the canvas does what it always does).
@@ -78,6 +78,10 @@ private:
bool tileDrag_ = false;
AssetEntry dragEntry_;
float scrollTo_ = -1.0f; // reset scroll after navigating
+ // Dragging the strip's canvas edge: the tile size it started from and where.
+ bool resizing_ = false;
+ float resizeY_ = 0.0f, resizeTile_ = 0.0f;
+ void drawResizeHandle(App& app, ImVec2 pos, ImVec2 size);
std::string imageMenu_; // image tile double-clicked: its action menu
// Folders added with "Open folder..." (shown at every tab's root).
std::vector<std::string> extraRoots_;
diff --git a/src/app/PanelTimeline.cpp b/src/app/PanelTimeline.cpp
index d1b01e6d..186aa872 100644
--- a/src/app/PanelTimeline.cpp
+++ b/src/app/PanelTimeline.cpp
@@ -89,6 +89,7 @@ struct TimelineUiState {
bool visible = true; // the strip is open (else only its tab shows)
bool record = true; // keep a timeline for the history
bool saveHistory = false; // write <name>.sfhist with the project
+ bool compact = true; // one row: the count, the track and icon buttons (Preferences > Interface > Compact timeline)
bool dragging = false;
size_t pendingSeek = SIZE_MAX; // the scrubber's target, applied once a frame
uint32_t retuneNode = Timeline::kNone;
@@ -130,6 +131,7 @@ void loadPrefs(TimelineUiState& s, const std::string& configDir, bool determinis
s.visible = j["visible"].asBool(s.visible);
s.record = j["record"].asBool(s.record);
s.saveHistory = j["save_history"].asBool(s.saveHistory);
+ s.compact = j["compact"].asBool(s.compact);
}
void savePrefs(const TimelineUiState& s, const std::string& configDir, bool deterministic) {
@@ -138,6 +140,7 @@ void savePrefs(const TimelineUiState& s, const std::string& configDir, bool dete
j.set("visible", s.visible);
j.set("record", s.record);
j.set("save_history", s.saveHistory);
+ j.set("compact", s.compact);
std::ofstream f(fsPathOf(prefsFile(configDir)));
f << j.dump(true);
}
@@ -185,6 +188,14 @@ void App::registerTimelineUiActions() {
"Timeline position: the Sculpt Timeline strip runs along the bottom of the viewport, above the brush shelf. "
"Saved automatically.",
[this] { uiPrefs_.timelineTop = false; }, [this] { return !uiPrefs_.timelineTop; });
+ add("view.timeline_compact", "Compact timeline", ICON_LC_FOLD_VERTICAL, "Preferences > Interface",
+ "The Sculpt Timeline as one thin row: the step count, the track and icon buttons (the default). Off: the "
+ "full strip, with a header row above the track. Saved automatically.",
+ [this, ui] {
+ ui().compact = !ui().compact;
+ savePrefs(ui(), configDir_, uiConfigDeterministic_);
+ },
+ [ui] { return ui().compact; });
add("timeline.timelapse", "Export timelapse...", ICON_LC_FILM, "Edit",
"Render the history of the active Part as a turntable timelapse video (1080p or 4K MP4, no captions).",
[ui] { ui().timelapseDialog = true; });
@@ -405,12 +416,13 @@ void App::drawTimelineUi() {
// The open Library takes the canvas's top (or bottom) edge: the strip moves off it, so it never covers the
// Library's tabs and close button (#80, a 720p screen at 150%).
if (libraryBrowser_.open()) {
- const float lib = std::min(LibraryBrowser::height(layout_.libraryRows, sc), c.h);
+ const float lib = std::min(LibraryBrowser::height(layout_, sc), c.h);
if (!layout_.libraryBottom) c.y += lib;
c.h -= lib;
}
timelineTopInset_ = 0.0f;
timelineStripY_ = -1.0f;
+ timelineStripH_ = 0.0f;
if (c.w < 200 || c.h < 150 || hideUi_) return;
const float margin = 10 * sc;
if (!s.visible) {
@@ -428,6 +440,7 @@ void App::drawTimelineUi() {
}
ui::HelpText("Sculpt Timeline", nullptr, "Open the history strip.", "Edit");
timelineStripY_ = ImGui::GetWindowPos().y;
+ timelineStripH_ = ImGui::GetWindowSize().y;
if (top) timelineTopInset_ = ImGui::GetWindowPos().y + ImGui::GetWindowSize().y - canvasRect().y;
}
ImGui::End();
@@ -435,15 +448,22 @@ void App::drawTimelineUi() {
}
const auto branches = t->branches();
const int lanes = std::min<int>(3, int(branches.size()));
- const float laneH = 7 * sc, trackH = 26 * sc;
- const float height = 30 * sc + trackH + float(lanes) * (laneH + 3 * sc);
- const float stripY = top ? c.y + margin : c.y + c.h - margin - height;
+ // Compact (the default, @factoberplay): one row, the step count, the track and icon buttons, with
+ // thin branch lanes over the track; the full strip has a header row above the track (Preferences > Interface).
+ const bool compact = s.compact;
+ const float laneH = (compact ? 4 : 7) * sc, laneGap = (compact ? 2 : 3) * sc, trackH = (compact ? 20 : 26) * sc;
+ const float padY = (compact ? 3 : 5) * sc;
+ const float height = compact ? 2 * padY + trackH + float(lanes) * (laneH + laneGap)
+ : 30 * sc + trackH + float(lanes) * (laneH + laneGap);
+ const float stripMargin = (compact ? 6 : 10) * sc;
+ const float stripY = top ? c.y + stripMargin : c.y + c.h - stripMargin - height;
ImGui::SetNextWindowPos(ImVec2(c.x + margin, stripY), ImGuiCond_Always);
timelineStripY_ = stripY;
+ timelineStripH_ = height;
if (top) timelineTopInset_ = stripY + height - canvasRect().y;
ImGui::SetNextWindowSize(ImVec2(c.w - 2 * margin, height), ImGuiCond_Always);
ImGui::SetNextWindowBgAlpha(0.88f);
- ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(8 * sc, 5 * sc));
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2((compact ? 6 : 8) * sc, padY));
const bool open = ImGui::Begin("##timeline", nullptr, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings |
ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav |
ImGuiWindowFlags_NoScrollWithMouse);
@@ -454,77 +474,160 @@ void App::drawTimelineUi() {
}
const auto& path = t->path();
const size_t n = path.size();
- // Header row: what it is, where the cursor is, the controls. The controls are measured and right-aligned; the
- // text left of them is elided before it reaches them (a 1024 px window at 200 %), the step count last.
- const ImGuiStyle& st = ImGui::GetStyle();
- const float smallW = ImGui::CalcTextSize(ICON_LC_FILM).x + st.FramePadding.x * 2.0f; // SmallButton: same x padding
- const float checkW = ImGui::GetFrameHeight() + st.ItemInnerSpacing.x + ImGui::CalcTextSize(tr("Save with project")).x;
- const float controlsW = checkW + 2.0f * (smallW + st.ItemSpacing.x);
- const float controlsX = std::max(ImGui::GetCursorPosX(), ImGui::GetWindowWidth() - st.WindowPadding.x - controlsW);
- timelineSpans_.clear(); // (UI tests check that nothing overlaps)
- auto room = [&] { return controlsX - st.ItemSpacing.x - 8 * sc - (ImGui::GetItemRectMax().x - ImGui::GetWindowPos().x); };
- auto tail = [&](const std::string& text, const ImVec4* col) { // one more piece of the header, elided to the room left
- if (text.empty()) return;
- const float avail = room() - st.ItemSpacing.x;
- if (avail < ImGui::CalcTextSize("M...").x) return;
- const std::string shown = fitText(text, avail);
- ImGui::SameLine();
- if (col) ImGui::TextColored(*col, "%s", shown.c_str());
- else ImGui::TextDisabled("%s", shown.c_str());
+ timelineSpans_.clear(); // (UI tests check that nothing in the strip's row overlaps)
+ ImDrawList* dl = ImGui::GetWindowDrawList();
+ float x0 = 0.0f, x1 = 0.0f, y = 0.0f;
+ if (compact) {
+ // The track row sits below the lanes; the count on its left, the buttons on its right, all centred on it.
+ const ImVec2 wp = ImGui::GetWindowPos();
+ const float padX = 6 * sc, rowY = wp.y + padY + float(lanes) * (laneH + laneGap), mid = rowY + trackH * 0.5f;
+ const float right = wp.x + ImGui::GetWindowWidth() - padX;
+ ImGui::SetCursorScreenPos(ImVec2(wp.x + padX, std::floor(mid - ImGui::GetTextLineHeight() * 0.5f)));
+ ImGui::Text("%s %zu/%zu", ICON_LC_HISTORY, t->cursor(), n - 1);
timelineSpans_.push_back({ImGui::GetItemRectMin().x, ImGui::GetItemRectMax().x});
- };
- ImGui::AlignTextToFramePadding();
- ImGui::TextUnformatted(ICON_LC_HISTORY);
- timelineSpans_.push_back({ImGui::GetItemRectMin().x, ImGui::GetItemRectMax().x});
- {
- char stepText[64];
- std::snprintf(stepText, sizeof stepText, tr("Step %zu of %zu"), t->cursor(), n - 1);
- const std::string shown = fitText(stepText, std::max(0.0f, room() - st.ItemSpacing.x));
- if (!shown.empty()) {
+ if (ImGui::IsItemHovered()) {
+ std::string tip = std::string(tr("Sculpt Timeline")) + "\n";
+ char buf[96];
+ std::snprintf(buf, sizeof buf, tr("Step %zu of %zu"), t->cursor(), n - 1);
+ tip += buf;
+ if (t->cursor() > 0) tip += ": " + t->node(t->cursorNode()).label;
+ if (!branches.empty()) {
+ std::snprintf(buf, sizeof buf, tr(branches.size() == 1 ? "%zu branch" : "%zu branches"), branches.size());
+ tip += std::string("\n") + buf;
+ }
+ ImGui::SetTooltip("%s", tip.c_str());
+ }
+ float left = ImGui::GetItemRectMax().x + 10 * sc;
+ if (!s.message.empty()) { // what went wrong (or a branch switch): kept short so the track keeps its room
+ const float w = std::min(ImGui::CalcTextSize(s.message.c_str()).x, (right - left) * 0.3f);
+ ImGui::SetCursorScreenPos(ImVec2(left, std::floor(mid - ImGui::GetTextLineHeight() * 0.5f)));
+ ImGui::PushClipRect(ImVec2(left, rowY), ImVec2(left + w, rowY + trackH), true);
+ ImGui::TextColored(theme::textDim, "%s", s.message.c_str());
+ ImGui::PopClipRect();
+ if (ImGui::IsMouseHoveringRect(ImVec2(left, rowY), ImVec2(left + w, rowY + trackH)))
+ ImGui::SetTooltip("%s", s.message.c_str());
+ timelineSpans_.push_back({left, left + w});
+ left += w + 10 * sc;
+ }
+ // Icon buttons, right to left: hide, full strip, timelapse, save with project (lit when on).
+ const float b = trackH, gap = 2 * sc;
+ float bx = right - 4 * b - 3 * gap;
+ auto iconButton = [&](const char* id, const char* glyph, bool on) {
+ ImGui::SetCursorScreenPos(ImVec2(bx, rowY));
+ const bool clicked = ImGui::InvisibleButton(id, ImVec2(b, b));
+ const ImVec2 a = ImGui::GetItemRectMin(), e = ImGui::GetItemRectMax();
+ if (on || ImGui::IsItemHovered())
+ dl->AddRectFilled(a, e, theme::u32(on ? theme::selection : theme::frameHover), theme::rounding(3 * sc));
+ ui::CentredGlyph(dl, nullptr, a, e, theme::u32(on ? theme::accent : theme::text), glyph);
+ bx += b + gap;
+ return clicked;
+ };
+ if (iconButton("Save with project", ICON_LC_SAVE, s.saveHistory)) {
+ s.saveHistory = !s.saveHistory;
+ Timeline::saveWithProject = s.saveHistory;
+ savePrefs(s, configDir_, uiConfigDeterministic_);
+ }
+ ui::HelpText(s.saveHistory ? "Save with project: on" : "Save with project: off", nullptr,
+ "Also save the history beside the project as <name>.sfhist (strokes, masks, vertex paint, visibility; "
+ "a topology change cuts it). Opening the project brings it back.",
+ "Edit > Sculpt Timeline");
+ if (iconButton("##timelapse", ICON_LC_FILM, false)) s.timelapseDialog = true;
+ ui::HelpText("Export timelapse", nullptr, "Render this history as a turntable timelapse video.", "Edit > Sculpt Timeline");
+ if (iconButton("##timeline.full", ICON_LC_UNFOLD_VERTICAL, false)) {
+ s.compact = false;
+ savePrefs(s, configDir_, uiConfigDeterministic_);
+ }
+ ui::HelpText("Full timeline", nullptr,
+ "Show the timeline with its header row (Preferences > Interface > Compact timeline).",
+ "Edit > Sculpt Timeline");
+ if (iconButton("##timeline.hide", top ? ICON_LC_CHEVRON_UP : ICON_LC_CHEVRON_DOWN, false)) {
+ s.visible = false;
+ savePrefs(s, configDir_, uiConfigDeterministic_);
+ }
+ ui::HelpText("Hide", nullptr, "Fold the timeline into a tab.", "Edit > Sculpt Timeline");
+ timelineSpans_.push_back({right - 4 * b - 3 * gap, right});
+ x0 = left + 6 * sc;
+ x1 = right - 4 * b - 3 * gap - 12 * sc;
+ y = wp.y + padY;
+ } else {
+ // Header row: what it is, where the cursor is, the controls. The controls are measured and right-aligned;
+ // the text left of them is elided before it reaches them (a 1024 px window at 200 %), the step count last.
+ const ImGuiStyle& st = ImGui::GetStyle();
+ const float smallW = ImGui::CalcTextSize(ICON_LC_FILM).x + st.FramePadding.x * 2.0f; // SmallButton: same x padding
+ const float checkW = ImGui::GetFrameHeight() + st.ItemInnerSpacing.x + ImGui::CalcTextSize(tr("Save with project")).x;
+ const float controlsW = checkW + 3.0f * (smallW + st.ItemSpacing.x);
+ const float controlsX = std::max(ImGui::GetCursorPosX(), ImGui::GetWindowWidth() - st.WindowPadding.x - controlsW);
+ auto room = [&] { return controlsX - st.ItemSpacing.x - 8 * sc - (ImGui::GetItemRectMax().x - ImGui::GetWindowPos().x); };
+ auto tail = [&](const std::string& text, const ImVec4* col) { // one more piece of the header, elided to the room left
+ if (text.empty()) return;
+ const float avail = room() - st.ItemSpacing.x;
+ if (avail < ImGui::CalcTextSize("M...").x) return;
+ const std::string shown = fitText(text, avail);
ImGui::SameLine();
- ImGui::TextUnformatted(shown.c_str());
+ if (col) ImGui::TextColored(*col, "%s", shown.c_str());
+ else ImGui::TextDisabled("%s", shown.c_str());
timelineSpans_.push_back({ImGui::GetItemRectMin().x, ImGui::GetItemRectMax().x});
+ };
+ ImGui::AlignTextToFramePadding();
+ ImGui::TextUnformatted(ICON_LC_HISTORY);
+ timelineSpans_.push_back({ImGui::GetItemRectMin().x, ImGui::GetItemRectMax().x});
+ {
+ char stepText[64];
+ std::snprintf(stepText, sizeof stepText, tr("Step %zu of %zu"), t->cursor(), n - 1);
+ const std::string shown = fitText(stepText, std::max(0.0f, room() - st.ItemSpacing.x));
+ if (!shown.empty()) {
+ ImGui::SameLine();
+ ImGui::TextUnformatted(shown.c_str());
+ timelineSpans_.push_back({ImGui::GetItemRectMin().x, ImGui::GetItemRectMax().x});
+ }
}
+ if (!branches.empty()) {
+ char branchText[64];
+ std::snprintf(branchText, sizeof branchText, tr(branches.size() == 1 ? "%s %zu branch" : "%s %zu branches"),
+ ICON_LC_GIT_BRANCH, branches.size());
+ tail(branchText, nullptr);
+ }
+ if (const Timeline::Node& cur = t->node(t->cursorNode()); t->cursor() > 0) tail(" " + cur.label, nullptr);
+ if (!s.message.empty()) tail(" " + s.message, &theme::textDim);
+ ImGui::SameLine(controlsX);
+ const float controlsStart = ImGui::GetCursorScreenPos().x;
+ if (ImGui::Checkbox(tr("Save with project"), &s.saveHistory)) {
+ Timeline::saveWithProject = s.saveHistory;
+ savePrefs(s, configDir_, uiConfigDeterministic_);
+ }
+ ui::HelpText("Save with project", nullptr,
+ "Also save the history beside the project as <name>.sfhist (strokes, masks, vertex paint, visibility; "
+ "a topology change cuts it). Opening the project brings it back.",
+ "Edit > Sculpt Timeline");
+ ImGui::SameLine();
+ if (ImGui::SmallButton(ICON_LC_FILM)) s.timelapseDialog = true;
+ ui::HelpText("Export timelapse", nullptr, "Render this history as a turntable timelapse video.", "Edit > Sculpt Timeline");
+ ImGui::SameLine();
+ if (ImGui::SmallButton(ICON_LC_FOLD_VERTICAL "###timeline.compact")) {
+ s.compact = true;
+ savePrefs(s, configDir_, uiConfigDeterministic_);
+ }
+ ui::HelpText("Compact timeline", nullptr, "Fold the header row into the track's row: a thinner strip.",
+ "Edit > Sculpt Timeline");
+ ImGui::SameLine();
+ if (ImGui::SmallButton(top ? ICON_LC_CHEVRON_UP : ICON_LC_CHEVRON_DOWN)) {
+ s.visible = false;
+ savePrefs(s, configDir_, uiConfigDeterministic_);
+ }
+ ui::HelpText("Hide", nullptr, "Fold the timeline into a tab.", "Edit > Sculpt Timeline");
+ timelineSpans_.push_back({controlsStart, ImGui::GetItemRectMax().x});
+ // Branch lanes, then the track.
+ const ImVec2 origin = ImGui::GetCursorScreenPos();
+ x0 = origin.x + 6 * sc;
+ x1 = origin.x + ImGui::GetContentRegionAvail().x - 6 * sc;
+ y = origin.y;
}
- if (!branches.empty()) {
- char branchText[64];
- std::snprintf(branchText, sizeof branchText, tr(branches.size() == 1 ? "%s %zu branch" : "%s %zu branches"), ICON_LC_GIT_BRANCH,
- branches.size());
- tail(branchText, nullptr);
- }
- if (const Timeline::Node& cur = t->node(t->cursorNode()); t->cursor() > 0) tail(" " + cur.label, nullptr);
- if (!s.message.empty()) tail(" " + s.message, &theme::textDim);
- ImGui::SameLine(controlsX);
- const float controlsStart = ImGui::GetCursorScreenPos().x;
- if (ImGui::Checkbox(tr("Save with project"), &s.saveHistory)) {
- Timeline::saveWithProject = s.saveHistory;
- savePrefs(s, configDir_, uiConfigDeterministic_);
- }
- ui::HelpText("Save with project", nullptr,
- "Also save the history beside the project as <name>.sfhist (strokes, masks, vertex paint, visibility; "
- "a topology change cuts it). Opening the project brings it back.",
- "Edit > Sculpt Timeline");
- ImGui::SameLine();
- if (ImGui::SmallButton(ICON_LC_FILM)) s.timelapseDialog = true;
- ui::HelpText("Export timelapse", nullptr, "Render this history as a turntable timelapse video.", "Edit > Sculpt Timeline");
- ImGui::SameLine();
- if (ImGui::SmallButton(top ? ICON_LC_CHEVRON_UP : ICON_LC_CHEVRON_DOWN)) {
- s.visible = false;
- savePrefs(s, configDir_, uiConfigDeterministic_);
- }
- ui::HelpText("Hide", nullptr, "Fold the timeline into a tab.", "Edit > Sculpt Timeline");
- timelineSpans_.push_back({controlsStart, ImGui::GetItemRectMax().x});
-
- // Branch lanes, then the track.
- ImDrawList* dl = ImGui::GetWindowDrawList();
- const ImVec2 origin = ImGui::GetCursorScreenPos();
- const float x0 = origin.x + 6 * sc, x1 = origin.x + ImGui::GetContentRegionAvail().x - 6 * sc;
+ const float laneTop = y;
size_t span = n > 1 ? n - 1 : 1; // steps the track shows: the active branch, or a longer other branch
for (const Timeline::Branch& b : branches) span = std::max(span, b.from + b.length);
const float step = (x1 - x0) / float(span);
auto xOf = [&](double i) { return x0 + float(i) * step; };
const ImVec2 mouse = ImGui::GetIO().MousePos;
- float y = origin.y;
uint32_t hovered = Timeline::kNone;
for (int l = 0; l < lanes; ++l) {
const Timeline::Branch& b = branches[branches.size() - 1 - size_t(l)]; // the newest on top
@@ -535,7 +638,7 @@ void App::drawTimelineUi() {
dl->AddCircleFilled(ImVec2(bx1, ly), 3.0f * sc, theme::u32(theme::textBright, 0.9f));
ImGui::SetCursorScreenPos(ImVec2(bx0, y));
ImGui::PushID(int(b.first));
- if (ImGui::InvisibleButton("##lane", ImVec2(std::max(8 * sc, bx1 - bx0 + 4 * sc), laneH))) {
+ if (ImGui::InvisibleButton("##lane", ImVec2(std::max(8 * sc, bx1 - bx0 + 4 * sc), laneH + (compact ? laneGap : 0.0f)))) {
std::string e;
if (!t->select(doc_, b.tip, &e)) s.message = e;
else s.message = "Switched to the other branch (the one you left is a lane now)";
@@ -545,10 +648,10 @@ void App::drawTimelineUi() {
: "Branch from step %zu: %zu steps, ending with \"%s\"\nClick to make it the active branch"),
b.from, b.length, t->node(b.tip).label.c_str());
ImGui::PopID();
- y += laneH + 3 * sc;
+ y += laneH + laneGap;
}
if (branches.size() > size_t(lanes)) {
- dl->AddText(ImVec2(x1 - 30 * sc, origin.y), theme::u32(theme::textDim), ("+" + std::to_string(branches.size() - size_t(lanes))).c_str());
+ dl->AddText(ImVec2(x1 - 30 * sc, laneTop), theme::u32(theme::textDim), ("+" + std::to_string(branches.size() - size_t(lanes))).c_str());
}
const float ty0 = y, ty1 = y + trackH;
dl->AddRectFilled(ImVec2(x0 - 4 * sc, ty0), ImVec2(x1 + 4 * sc, ty1), theme::u32(theme::frame, 0.5f), 3 * sc);
diff --git a/src/app/Shell.cpp b/src/app/Shell.cpp
index ad87321d..a1d1e54a 100644
--- a/src/app/Shell.cpp
+++ b/src/app/Shell.cpp
@@ -891,6 +891,7 @@ void App::applyPreset(int preset) {
l.consoleHeight = layout_.consoleHeight;
l.libraryOpen = layout_.libraryOpen;
l.libraryRows = layout_.libraryRows;
+ l.libraryTile = layout_.libraryTile;
l.libraryTab = layout_.libraryTab;
l.libraryBottom = layout_.libraryBottom;
l.leftHanded = layout_.leftHanded;
@@ -1329,6 +1330,7 @@ UiLayout relayout(const UiLayout& from, int layoutKind) {
l.consoleHeight = from.consoleHeight;
l.libraryOpen = from.libraryOpen;
l.libraryRows = from.libraryRows;
+ l.libraryTile = from.libraryTile;
l.libraryTab = from.libraryTab;
l.libraryBottom = from.libraryBottom;
l.leftHanded = from.leftHanded;
diff --git a/src/app/UiLayout.cpp b/src/app/UiLayout.cpp
index 6d61b13c..c2d391ac 100644
--- a/src/app/UiLayout.cpp
+++ b/src/app/UiLayout.cpp
@@ -93,6 +93,7 @@ Json toJson(const UiLayout& l) {
j.set("consoleHeight", double(l.consoleHeight));
j.set("libraryOpen", l.libraryOpen);
j.set("libraryRows", double(l.libraryRows));
+ j.set("libraryTile", double(l.libraryTile));
j.set("libraryTab", l.libraryTab);
j.set("libraryBottom", l.libraryBottom);
j.set("shelfTiles", double(l.shelfTiles));
@@ -146,6 +147,7 @@ bool fromJson(const Json& j, UiLayout& l, std::string& error, int shellLayout) {
number("consoleHeight", out.consoleHeight);
flag("libraryOpen", out.libraryOpen);
out.libraryRows = int(j["libraryRows"].asNumber(out.libraryRows));
+ out.libraryTile = std::clamp(float(j["libraryTile"].asNumber(out.libraryTile)), kLibraryTileMin, kLibraryTileMax);
if (j["libraryTab"].isString()) out.libraryTab = j["libraryTab"].asString();
flag("libraryBottom", out.libraryBottom);
out.shelfTiles = std::clamp(int(j["shelfTiles"].asNumber(out.shelfTiles)), 0, 2);
diff --git a/src/app/UiLayout.h b/src/app/UiLayout.h
index 55a82683..80d9d6d5 100644
--- a/src/app/UiLayout.h
+++ b/src/app/UiLayout.h
@@ -19,6 +19,8 @@ struct CanvasRect {
bool contains(float px, float py) const { return px >= x && py >= y && px < x + w && py < y + h; }
};
+constexpr float kLibraryTileMin = 48.0f, kLibraryTileMax = 128.0f;
+
struct UiLayout {
int version = 4; // 2: the top shelf has Dynamic; 3: the right shelf has Undo / Redo; 4: the left shelf has the stroke
// popup (older stored layouts get them on load)
@@ -33,6 +35,9 @@ struct UiLayout {
float consoleHeight = 160;
bool libraryOpen = false;
int libraryRows = 1;
+ // Library thumbnail size, logical px (kLibraryTileMin-Max): drag the strip's edge toward the canvas to change it.
+ // 64 since the strip went compact (was 96, @factoberplay: the strip took too much height).
+ float libraryTile = 64;
std::string libraryTab = "project";
bool libraryBottom = false;
int shelfTiles = 1; // bottom shelf brush tiles: 0 small, 1 medium, 2 large (shell::bottomShelfSize)
diff --git a/src/app/UiTest.cpp b/src/app/UiTest.cpp
index b8b4cea9..a5d7c9d4 100644
--- a/src/app/UiTest.cpp
+++ b/src/app/UiTest.cpp
@@ -112,6 +112,7 @@
// symmetry_copies (copies every stroke makes), cursor_copies (brush cursors drawn),
// symmetry_pivot_x (local symmetry's centre), timeline_top (1: the strip at the top),
// timeline_y / axis_gizmo_y (their tops / centre, fractions of the canvas from its top),
+// timeline_height / library_height (the strips, logical px; 0 not shown), library_tile,
// axis_view (the side view named under the axis gizmo: 0-5 = +x +y +z -x -y -z, -1 none),
// style_window_min (ImGui's minimum window height, unscaled px: 32 in every look),
// tablet_mouse_mode (Preferences > Tablet > Mouse mode),
@@ -1079,6 +1080,12 @@ double Demo::query(const std::string& name, bool& known) const {
// Timeline position (#63): 1 at the top of the viewport; the strip's top edge and the axis gizmo's centre as
// fractions of the canvas height from its top (-1: the strip isn't shown).
if (name == "timeline_top") return app_.uiPrefs_.timelineTop ? 1.0 : 0.0;
+ // The Library strip's and the timeline strip's (or its tab's) heights in logical px (0: not shown), and the
+ // Library's thumbnail size: compact by default (@factoberplay).
+ if (name == "library_height")
+ return app_.libraryBrowser_.open() ? double(LibraryBrowser::height(app_.layout_, 1.0f)) : 0.0;
+ if (name == "library_tile") return double(app_.layout_.libraryTile);
+ if (name == "timeline_height") return std::round(double(app_.timelineStripH_ / std::max(app_.uiScale_, 0.01f)));
// The style's minimum window height in unscaled px (32): switching looks must not scale it again each time.
if (name == "ui_scale") return std::round(double(app_.uiScale_) * 100.0); // percent, as built now (#87)
if (name == "glyphs_missing") return double(glyphs::missingLastFrame()); // drawn as "?" in the last frame
diff --git a/tests/ui/compact_bars.sfui b/tests/ui/compact_bars.sfui
new file mode 100644
index 00000000..11b61db5
--- /dev/null
+++ b/tests/ui/compact_bars.sfui
@@ -0,0 +1,54 @@
+# Compact bars (@factoberplay, YouTube): the Library strip and the Sculpt Timeline under it took too much of the
+# viewport's height. Compact by default: 64 px thumbnails and a 26 px tab row (was 96 and 28), and a one-row
+# timeline (count, track, icon buttons; was a header row over the track). Together they reclaim over 30% of the
+# 228 logical px they took before (162 + 10 gap + 56); dragging the Library's edge sizes its thumbnails.
+run new_sphere subdivisions=4
+stroke 0.35 0.40 0.60 0.45
+stroke 0.35 0.50 0.60 0.55
+key ,
+expect_value library_open == 1
+click "Library/Tool"
+wait_idle 30
+expect_value library_tile == 64
+expect_value library_height == 126
+expect_value timeline_height == 26
+expect_value timeline_steps == 2
+shot compact-100
+
+# Hit targets stay usable: scrubbing the one-row track and its buttons work.
+drag_item "##track" -2000 0
+expect_value timeline_cursor == 0
+drag_item "##track" 2000 0
+expect_value timeline_cursor == 2
+double_click "Library/Sphere"
+expect_status Created sphere
+
+# The full strip is a click away (and back).
+click "##timeline.full"
+expect_value timeline_height == 56
+shot full-100
+click "###timeline.compact"
+expect_value timeline_height == 26
+
+# Drag the Library's edge: bigger thumbnails, then smaller, held within 48-128 (the timeline follows the edge).
+drag_item "Library size##lbresize" 0 40
+expect_value library_tile > 90
+drag_item "Library size##lbresize" 0 400
+expect_value library_tile == 128
+expect_value library_height == 190
+drag_item "Library size##lbresize" 0 -400
+expect_value library_tile == 48
+expect_value library_height == 110
+expect_value timeline_height == 26
+shot library-small
+
+# Larger UI scales keep the same logical sizes (the layout scales, nothing clips).
+ui_scale 150
+wait_idle 10
+expect_value library_height == 110
+expect_value timeline_height == 26
+shot compact-150
+ui_scale 200
+wait_idle 10
+expect_value timeline_height == 26
+shot compact-200
diff --git a/tests/ui/timeline.sfui b/tests/ui/timeline.sfui
index c1e5e696..967b829a 100644
--- a/tests/ui/timeline.sfui
+++ b/tests/ui/timeline.sfui
@@ -13,9 +13,9 @@ expect_value timeline_cursor == 4
shot strokes
# Drag the scrubber to the start of the track, then back to the middle.
-view_drag 0.60 0.177 0.075 0.177
+drag_item "##track" -2000 0
expect_value timeline_cursor == 0
-view_drag 0.09 0.177 0.40 0.177
+drag_item "##track" 10 0
expect_value timeline_cursor < 4
expect_value timeline_cursor > 0
shot scrubbed
diff --git a/tests/ui/timeline_narrow.sfui b/tests/ui/timeline_narrow.sfui
index c2acd0af..3bd25fde 100644
--- a/tests/ui/timeline_narrow.sfui
+++ b/tests/ui/timeline_narrow.sfui
@@ -25,3 +25,16 @@ logical_width 512
wait_idle 30
expect_value timeline_overlaps == 0
shot header_512
+
+# The full strip (header row above the track) elides the same way.
+ui_scale 200
+click "##timeline.full"
+expect_value timeline_height > 26
+expect_value timeline_overlaps == 0
+shot header_200_full
+logical_width 512
+wait_idle 30
+expect_value timeline_overlaps == 0
+shot header_512_full
+click "###timeline.compact"
+expect_value timeline_height == 32 # the thin row and one branch lane (26 + 6)
diff --git a/tests/ui/timeline_position.sfui b/tests/ui/timeline_position.sfui
index 243fcceb..505586d7 100644
--- a/tests/ui/timeline_position.sfui
+++ b/tests/ui/timeline_position.sfui
@@ -11,7 +11,7 @@ expect_value axis_gizmo_y > 0.1
shot top
# Scrubbing works at the top: drag to the start of the track.
-view_drag 0.60 0.177 0.075 0.177
+drag_item "##track" -2000 0
expect_value timeline_cursor == 0
# Preferences > Interface > Timeline position: Bottom.