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.

Version in the window title and the top bar (support screenshots): "Untitled* — SculptForge 0.11.13", small dim text beside the name in both layouts, beta and dev tags in the accent; a narrow window drops it first

islandmed6dfb760bfe3b
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09f7b670..585460f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -493,6 +493,12 @@ if(SCULPTFORGE_BUILD_APP)
if(SF_GIT_COMMIT)
set_source_files_properties(src/app/ProofMode.cpp src/app/BenchTake.cpp PROPERTIES COMPILE_DEFINITIONS "SF_GIT_COMMIT=\"${SF_GIT_COMMIT}\"")
endif()
+ # A developer's build says so beside the version (window title, top bar): "0.11.13 dev 1a2b3c4". AUTO = a git
+ # checkout built outside CI; release packages build in CI or from a tarball (AUR, brew, Flatpak skip .git).
+ set(SCULPTFORGE_DEV_BUILD AUTO CACHE STRING "Show 'dev <commit>' beside the version: AUTO, ON or OFF")
+ if(SF_GIT_COMMIT AND (SCULPTFORGE_DEV_BUILD STREQUAL "ON" OR (SCULPTFORGE_DEV_BUILD STREQUAL "AUTO" AND NOT DEFINED ENV{CI})))
+ set_property(SOURCE src/app/PanelProject.cpp APPEND PROPERTY COMPILE_DEFINITIONS "SF_DEV_COMMIT=\"${SF_GIT_COMMIT}\"")
+ endif()
if(MSVC)
target_compile_options(sculptforge PRIVATE /W4 /utf-8 /permissive-)
else()
@@ -931,6 +937,8 @@ if(SCULPTFORGE_BUILD_TESTS)
sculptforge_ui_test(studio_mode studio/studio_mode --studio ${CMAKE_CURRENT_SOURCE_DIR}/tests/data/studio/studio.json)
sculptforge_ui_test(shell_layout_1080 shell_layout --size 1920x1080)
sculptforge_ui_test(menu_stable_720 menu_stable --size 1280x720)
+ sculptforge_ui_test(title_version_1440 title_version --size 1440x900)
+ sculptforge_ui_test(title_version_1024 title_version --size 1024x768)
sculptforge_ui_test(help_console_1080 help_console --size 1920x1080)
# The S / U / I / O slider on a UI scaled 1.5x (Windows at 150%, #9): it must still open under the cursor.
sculptforge_ui_test(size_popup_scaled size_popup --size 2400x1350)
diff --git a/changes/feat-title-version.md b/changes/feat-title-version.md
new file mode 100644
index 00000000..fb2d7bec
--- /dev/null
+++ b/changes/feat-title-version.md
@@ -0,0 +1,14 @@
+---
+whats_new: **Version at a glance**: the window title and the top bar show the SculptForge version, so a screenshot
+ says which one you run. A beta's tag shows in the accent colour.
+changed: The window title starts with the project name and a "*" for unsaved changes (taskbars stay readable), then
+ SculptForge and its version, and the top bar shows the version, small and dim, beside the name in both layouts (a narrow window drops it).
+ Betas show their tag ("0.12.0 beta.2") in the accent colour; builds from a git checkout show "dev" and their commit.
+testers:
+ - Any OS: the window title and the taskbar entry start with "Untitled", then SculptForge and the
+ version; sculpt a stroke, a "*" follows the name.
+ - Windows at 150% and 200% scaling, both layouts: the version sits beside "SculptForge" in the top bar and never
+ overlaps the menus or the project name; shrink the window, it disappears before anything crowds.
+---
+Version source: CMake's PROJECT_VERSION + SCULPTFORGE_PRERELEASE; dev commit from SCULPTFORGE_DEV_BUILD (AUTO: git
+checkout, not CI). UI test tests/ui/title_version.sfui (+1440, 1024).
diff --git a/docs/guide/projects.md b/docs/guide/projects.md
index ec53fe4c..7b5b3568 100644
--- a/docs/guide/projects.md
+++ b/docs/guide/projects.md
@@ -28,8 +28,9 @@ them is an export, not a save. See [Exporting](exporting.md).
- **File > Save As...** (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>S</kbd>) saves under a new name.
- In the Classic layout, clicking the document name in the title strip also saves.
-The bar along the top shows the file name with `*` after it while there are unsaved changes, and the window title
-starts with `*`. Any edit in any Part counts, as do splat edits and layer weight changes.
+The bar along the top shows the file name with `*` after it while there are unsaved changes, and so does the window
+title, which starts with the file name. Any edit in any Part counts, as do splat edits and layer weight changes.
+The window title and the top bar also show the SculptForge version, so a screenshot says which one you run.
If you opened a model file (an OBJ, say) rather than a project, **Save** asks where to save a new `.sfproj`; the
original model file is left alone.
diff --git a/src/app/App.cpp b/src/app/App.cpp
index 765f9f38..99e0ad7f 100644
--- a/src/app/App.cpp
+++ b/src/app/App.cpp
@@ -3001,10 +3001,11 @@ void App::updateTitle() {
? std::string("Untitled")
: std::filesystem::path(std::u8string(doc_.path.begin(), doc_.path.end())).filename().string();
updateDiscordPresence(); // the file name, if it's shown (sends only on a change)
- std::string title = (doc_.dirty() ? "* " : "") + name + " - SculptForge";
- if (*appPrerelease()) title += " " + appVersionLabel(); // "- SculptForge 0.11.0 Beta 1": a beta says so
+ // "Head.sfproj* — SculptForge 0.11.13": the document first (taskbars and Alt-Tab cut the end off), the version
+ // last, so support screenshots show it.
+ std::string title = name + (doc_.dirty() ? "*" : "") + " — SculptForge " + appShownVersion().text();
if (const StudioStart& studio = studioMode(); studio.active && !studio.profile.title.empty())
- title += " - " + studio.profile.title; // a studio build's own title
+ title += " — " + studio.profile.title; // a studio build's own title
if (title == windowTitle_) return; // called every frame
windowTitle_ = title;
SDL_SetWindowTitle(window_, title.c_str());
diff --git a/src/app/App.h b/src/app/App.h
index b4c35602..a905bd9a 100644
--- a/src/app/App.h
+++ b/src/app/App.h
@@ -1542,7 +1542,8 @@ private:
void pollUpdateCheck();
static const char* appPrerelease(); // "beta.1" in a beta build, else ""
static std::string appFullVersion(); // "0.11.0-beta.1": what the update check compares
- static std::string appVersionLabel(); // "0.11.0 Beta 1": title bar (betas only) and About
+ static std::string appVersionLabel(); // "0.11.0 Beta 1": About and the update check
+ static ShownVersion appShownVersion(); // "0.11.0" + "beta.1" / "dev 1a2b3c4": window title and top bar
void drawUpdateBanner();
void drawUpdatesSection(); // Preferences > Updates
bool checkUpdates_ = true;
diff --git a/src/app/PanelProject.cpp b/src/app/PanelProject.cpp
index 3e3083d8..8dc77b39 100644
--- a/src/app/PanelProject.cpp
+++ b/src/app/PanelProject.cpp
@@ -770,12 +770,16 @@ void App::drawProjectPopups() {
#ifndef SCULPTFORGE_PRERELEASE
#define SCULPTFORGE_PRERELEASE ""
#endif
+#ifndef SF_DEV_COMMIT // a developer's build: the commit it was configured at (CMakeLists.txt, SCULPTFORGE_DEV_BUILD)
+#define SF_DEV_COMMIT ""
+#endif
const char* App::appPrerelease() { return SCULPTFORGE_PRERELEASE; }
std::string App::appFullVersion() {
return std::string(SCULPTFORGE_VERSION) + (*SCULPTFORGE_PRERELEASE ? std::string("-") + SCULPTFORGE_PRERELEASE : "");
}
std::string App::appVersionLabel() { return versionLabel(SCULPTFORGE_VERSION, SCULPTFORGE_PRERELEASE); }
+ShownVersion App::appShownVersion() { return shownVersion(SCULPTFORGE_VERSION, SCULPTFORGE_PRERELEASE, SF_DEV_COMMIT); }
void App::startUpdateCheck(bool manual) {
if (updateJob_) return; // one at a time
diff --git a/src/app/Shell.cpp b/src/app/Shell.cpp
index 25724dc1..d5ea3cf3 100644
--- a/src/app/Shell.cpp
+++ b/src/app/Shell.cpp
@@ -1011,6 +1011,22 @@ void App::drawTitleStrip(const ShellGeometry& g) {
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6.0f * s, (buttonH - ImGui::GetFontSize()) * 0.5f));
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4.0f * s, 0.0f));
+ // Right-aligned controls: QuickSave, layout presets, Menus, search. Measured first.
+ const ImGuiStyle& st = ImGui::GetStyle();
+ auto buttonW = [&](const char* label) { return ImGui::CalcTextSize(label, nullptr, true).x + st.FramePadding.x * 2.0f; };
+ const bool quickSave = actions_.find("file.quicksave") != nullptr;
+ const bool maya = !uiPrefs_.mayaFolder.empty(); // the Maya bridge is on (#42): one click sends back
+ const float searchW = 150.0f * s;
+ const float windowButtonW = buttonH + 6.0f * s; // minimise and close, at the far right
+ float rightW = searchW + buttonW(tr(ICON_LC_MENU " Menus")) + 3.0f * (buttonH + 2.0f * s) + 18.0f * s +
+ 10.0f * s + 2.0f * windowButtonW + 2.0f * s;
+ if (quickSave) rightW += buttonW(tr("Save Snapshot")) + 8.0f * s;
+ if (maya) rightW += buttonW((std::string(ICON_LC_SEND " ") + tr("Send to Maya")).c_str()) + 8.0f * s;
+ const bool mayaLink = mayaLink_ != nullptr; // the Maya Live link is on: its ember chip turns it off
+ const std::string linkLabel = std::string(ICON_LC_RADIO " ") + tr("Live link on") + "##mayalink.chip";
+ if (mayaLink) rightW += buttonW(linkLabel.c_str()) + 8.0f * s;
+ const float rightX = g.title.w - 8.0f * s - rightW;
+
// App mark and name.
{ // the cube app icon (the same in every look), a little taller than the name
const float m = std::round(std::min(ImGui::GetFontSize() * 1.3f, h - 4.0f * s));
@@ -1023,11 +1039,34 @@ void App::drawTitleStrip(const ShellGeometry& g) {
ImGui::TextUnformatted(tr("SculptForge"));
if (fontBold_) ImGui::PopFont();
- // Document name; click saves.
- ImGui::SameLine(0.0f, 16.0f * s);
std::string name = doc_.path.empty() ? std::string(tr("Untitled"))
: std::filesystem::path(std::u8string(doc_.path.begin(), doc_.path.end())).filename().string();
if (doc_.dirty()) name += " *";
+ // The version, small and dim beside the name (support screenshots); a beta's or a dev build's tag in the accent.
+ // A narrow window drops it first, so it never crowds the document name and the controls on the right.
+ {
+ const ShownVersion v = appShownVersion();
+ if (fontSmall_) ImGui::PushFont(fontSmall_);
+ const float numW = ImGui::CalcTextSize(v.number.c_str()).x;
+ const float tagW = v.tag.empty() ? 0.0f : ImGui::CalcTextSize(v.tag.c_str()).x + 4.0f * s;
+ const float nameW = ImGui::CalcTextSize(name.c_str()).x + 12.0f * s;
+ const float nameEnd = ImGui::GetItemRectMax().x - ImGui::GetWindowPos().x; // (the cursor is on the next line)
+ if (nameEnd + 6.0f * s + numW + tagW + 16.0f * s + nameW + 16.0f * s < rightX) {
+ const float y = std::floor((h - ImGui::GetTextLineHeight()) * 0.5f) + 1.0f * s;
+ ImGui::SameLine(0.0f, 6.0f * s);
+ ImGui::SetCursorPosY(y);
+ ImGui::TextDisabled("%s", v.number.c_str());
+ if (!v.tag.empty()) {
+ ImGui::SameLine(0.0f, 4.0f * s);
+ ImGui::SetCursorPosY(y);
+ ImGui::TextColored(theme::accent, "%s", v.tag.c_str());
+ }
+ }
+ if (fontSmall_) ImGui::PopFont();
+ }
+
+ // Document name; click saves.
+ ImGui::SameLine(0.0f, 16.0f * s);
ImGui::SetCursorPosY((h - buttonH) * 0.5f);
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, theme::headerHover);
@@ -1035,22 +1074,6 @@ void App::drawTitleStrip(const ShellGeometry& g) {
ImGui::PopStyleColor(2);
ui::HelpText("Project", "Ctrl+S", "Click to save the project. * means it has unsaved changes.", "Title");
- // Right-aligned controls: QuickSave, layout presets, Menus, search. Measured first.
- const ImGuiStyle& st = ImGui::GetStyle();
- auto buttonW = [&](const char* label) { return ImGui::CalcTextSize(label, nullptr, true).x + st.FramePadding.x * 2.0f; };
- const bool quickSave = actions_.find("file.quicksave") != nullptr;
- const bool maya = !uiPrefs_.mayaFolder.empty(); // the Maya bridge is on (#42): one click sends back
- const float searchW = 150.0f * s;
- const float windowButtonW = buttonH + 6.0f * s; // minimise and close, at the far right
- float rightW = searchW + buttonW(tr(ICON_LC_MENU " Menus")) + 3.0f * (buttonH + 2.0f * s) + 18.0f * s +
- 10.0f * s + 2.0f * windowButtonW + 2.0f * s;
- if (quickSave) rightW += buttonW(tr("Save Snapshot")) + 8.0f * s;
- if (maya) rightW += buttonW((std::string(ICON_LC_SEND " ") + tr("Send to Maya")).c_str()) + 8.0f * s;
- const bool mayaLink = mayaLink_ != nullptr; // the Maya Live link is on: its ember chip turns it off
- const std::string linkLabel = std::string(ICON_LC_RADIO " ") + tr("Live link on") + "##mayalink.chip";
- if (mayaLink) rightW += buttonW(linkLabel.c_str()) + 8.0f * s;
- const float rightX = g.title.w - 8.0f * s - rightW;
-
// 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();
@@ -1440,6 +1463,28 @@ void App::drawStatusBar(const ShellGeometry& g) {
}
const bool caps = style == Status::Terminal;
x = textAt(bold, x, theme::textBright, caps ? "SCULPTFORGE" : "SculptForge");
+ // The version, small and dim beside the name (support screenshots); a beta's or a dev build's tag in the accent.
+ // Placed once the menus are measured: a narrow window drops it before it crowds them.
+ const float versionX = x + 6.0f * s;
+ const ShownVersion version = appShownVersion();
+ const float versionW = 6.0f * s + textW(monoSmall, version.number) + (version.tag.empty() ? 0.0f : 4.0f * s + textW(monoSmall, version.tag));
+ float menuW = 0.0f;
+ {
+ int count = 0;
+ const TaskMenuDef* defs = taskMenus(count);
+ ImFont* f = style == Status::Modules ? ImGui::GetFont() : monoSmall;
+ for (int i = 0; i < count; ++i)
+ menuW += textW(f, style == Status::Modules ? std::string(tr(defs[i].name)) : upper(tr(defs[i].name))) + 16.0f * s +
+ (style == Status::Modules ? 2.0f : 0.0f) * s;
+ }
+ // The fixed controls on the right (window buttons, search, workspaces: see below) and room for the modules.
+ const float fixedRight = 2.0f * (h - 2.0f * inset) + 150.0f * s + 3.0f * (h - 2.0f * inset) + 60.0f * s + 200.0f * s;
+ if (x + versionW + 18.0f * s + menuW + 12.0f * s + fixedRight < o.x + g.title.w) {
+ float vx = textAt(monoSmall, versionX, theme::textDim, version.number);
+ if (!version.tag.empty()) textAt(monoSmall, vx + 4.0f * s, theme::accent, version.tag);
+ ImGui::LogText("%s", version.text().c_str()); // (UI tests read the bar)
+ x += versionW;
+ }
x += (style == Status::TitleBlock ? 14.0f : 18.0f) * s;
if (style == Status::TitleBlock || style == Status::Terminal) {
dl->AddLine(ImVec2(std::floor(x) + 0.5f, o.y + inset), ImVec2(std::floor(x) + 0.5f, o.y + h - inset), theme::u32(theme::tileBorder));
diff --git a/src/app/UiTest.cpp b/src/app/UiTest.cpp
index 2f7da707..2ca7428f 100644
--- a/src/app/UiTest.cpp
+++ b/src/app/UiTest.cpp
@@ -437,6 +437,12 @@ std::string restOf(const std::string& line, int skip) {
return rest;
}
+// "{version}" in an expected text: the version as the window title and the top bar show it ("0.11.13 dev 1a2b3c4").
+std::string withVersion(std::string text, const std::string& version) {
+ if (const size_t at = text.find("{version}"); at != std::string::npos) text.replace(at, 9, version);
+ return text;
+}
+
SDL_Keymod parseMods(const std::string& text, std::string* key = nullptr) {
SDL_Keymod mods = SDL_KMOD_NONE;
std::stringstream ss(text);
@@ -2378,7 +2384,7 @@ bool Demo::parseStep(int line, const std::vector<std::string>& w, std::string& e
});
} else if (verb == "expect_text" || verb == "expect_no_text") {
if (!need(1)) return false;
- const std::string text = restOf(lineText_, 1);
+ const std::string text = withVersion(restOf(lineText_, 1), App::appShownVersion().text());
const bool want = verb == "expect_text";
steps_.push_back([this, line, text, want](float t) {
if (t == 0.0f) return false;
@@ -2386,6 +2392,16 @@ bool Demo::parseStep(int line, const std::vector<std::string>& w, std::string& e
fail(line, want ? "no text \"" + text + "\" on screen" : "text \"" + text + "\" is on screen");
return true;
});
+ } else if (verb == "expect_title") { // the OS window title contains the text ({version}: the version as shown)
+ if (!need(1)) return false;
+ const std::string text = withVersion(restOf(lineText_, 1), App::appShownVersion().text());
+ steps_.push_back([this, line, text](float t) {
+ if (t == 0.0f) return false; // the title is set while the frame after the previous step draws
+ const char* title = SDL_GetWindowTitle(app_.window_);
+ const std::string have = title ? title : "";
+ if (have.find(text) == std::string::npos) fail(line, "window title is \"" + have + "\", expected \"" + text + "\"");
+ return true;
+ });
} else if (verb == "expect_status") {
if (!need(1)) return false;
const std::string text = restOf(lineText_, 1);
diff --git a/src/core/UpdateCheck.cpp b/src/core/UpdateCheck.cpp
index d03a7995..0f191011 100644
--- a/src/core/UpdateCheck.cpp
+++ b/src/core/UpdateCheck.cpp
@@ -143,4 +143,10 @@ std::string versionLabel(const std::string& version, const std::string& prerelea
return label;
}
+ShownVersion shownVersion(const std::string& version, const std::string& prerelease, const std::string& devCommit) {
+ ShownVersion v{version, prerelease};
+ if (!devCommit.empty()) v.tag += (v.tag.empty() ? "dev " : " dev ") + devCommit.substr(0, 7);
+ return v;
+}
+
} // namespace sf
diff --git a/src/core/UpdateCheck.h b/src/core/UpdateCheck.h
index d0c2511a..324b71ad 100644
--- a/src/core/UpdateCheck.h
+++ b/src/core/UpdateCheck.h
@@ -48,6 +48,14 @@ int compareVersions(const std::string& a, const std::string& b);
// What people read: "0.11.0" and "beta.1" make "0.11.0 Beta 1" (title bar, About); no prerelease, the version.
std::string versionLabel(const std::string& version, const std::string& prerelease);
+// The version as the window title and the top bar show it, for support screenshots: the number, and a tag the top bar
+// draws in the accent colour: "0.11.13"; "0.12.0" + "beta.2"; a developer's build "0.11.13" + "dev 1a2b3c4".
+struct ShownVersion {
+ std::string number, tag;
+ std::string text() const { return tag.empty() ? number : number + " " + tag; }
+};
+ShownVersion shownVersion(const std::string& version, const std::string& prerelease, const std::string& devCommit);
+
// The check runs when the last one is a day old (or in the future: the clock was changed).
inline bool updateCheckDue(int64_t lastCheck, int64_t now) {
return lastCheck <= 0 || now < lastCheck || now - lastCheck >= kUpdateCheckInterval;
diff --git a/tests/test_update_check.cpp b/tests/test_update_check.cpp
index 8375aacf..4892b0ff 100644
--- a/tests/test_update_check.cpp
+++ b/tests/test_update_check.cpp
@@ -48,6 +48,12 @@ TEST(update_versions_order_prereleases) {
CHECK(versionLabel("9.0.0", "beta.1") == "9.0.0 Beta 1");
CHECK(versionLabel("9.0.0", "rc.2") == "9.0.0 RC 2");
CHECK(versionLabel("8.10.11", "") == "8.10.11");
+ CHECK(shownVersion("8.10.11", "", "").text() == "8.10.11");
+ CHECK(shownVersion("8.10.11", "", "").tag.empty());
+ CHECK(shownVersion("9.0.0", "beta.2", "").text() == "9.0.0 beta.2");
+ CHECK(shownVersion("9.0.0", "beta.2", "").tag == "beta.2");
+ CHECK(shownVersion("8.10.11", "", "1a2b3c4d5e").tag == "dev 1a2b3c4");
+ CHECK(shownVersion("9.0.0", "rc.1", "1a2b3c4").text() == "9.0.0 rc.1 dev 1a2b3c4");
}
// latest.json while 9.0.0 Beta 1 is out: old apps and Stable read the top level, Preview the channel's entry.
diff --git a/tests/ui/title_version.sfui b/tests/ui/title_version.sfui
new file mode 100644
index 00000000..aac6e2bb
--- /dev/null
+++ b/tests/ui/title_version.sfui
@@ -0,0 +1,35 @@
+# The version at a glance for support screenshots (Tony 11-07): the OS window title "<document>[*] — SculptForge
+# <version>" (the document first, so taskbars and Alt-Tab stay readable) and small dim text beside the name in the
+# top bar, in both layouts and every bar style. {version} is the version as shown: "0.11.13", "0.12.0 beta.2" or a
+# developer's "0.11.13 dev 1a2b3c4". CMake also runs this at 1440x900 and 1024x768 (the bar drops it when narrow).
+expect_title Untitled — SculptForge {version}
+
+run ui_look look=classic layout=classic
+expect_text {version}
+shot classic
+
+run new_sphere subdivisions=3
+stroke 0.4 0.45 0.6 0.55
+expect_title Untitled* — SculptForge {version}
+
+run ui_look look=classic layout=sculptforge
+expect_text {version}
+shot modules
+
+run ui_look look=forge layout=sculptforge
+expect_text {version}
+expect_title Untitled* — SculptForge {version}
+shot terminal
+
+run ui_look look=blueprint
+expect_text {version}
+shot title_block
+
+# UI scale 200%: still beside the name, the menus not pushed off.
+ui_scale 200
+run ui_look look=classic layout=classic
+shot classic_200
+run ui_look look=forge layout=sculptforge
+expect "Help##menu.help" # the last menu still fits
+shot terminal_200
+ui_scale 100