Use model name for window title.
PiperOrigin-RevId: 889193934 Change-Id: Ief9ade9e239c14da1d824d9bc8aa95dc0a71b65f
This commit is contained in:
committed by
Copybara-Service
parent
4df2fc2490
commit
c61d239ac6
@@ -166,7 +166,13 @@ void App::LoadModelFromFile(const std::string& filepath) {
|
|||||||
OnModelLoaded(filepath, kModelFromFile);
|
OnModelLoaded(filepath, kModelFromFile);
|
||||||
spec_editor_.Reset(*spec());
|
spec_editor_.Reset(*spec());
|
||||||
UpdateFilePaths(resolved_file);
|
UpdateFilePaths(resolved_file);
|
||||||
window_->SetTitle("MuJoCo Studio : " + filepath);
|
if (model() && model()->names) {
|
||||||
|
// Assumes the first string in the model is the name of the model itself.
|
||||||
|
window_->SetTitle("MuJoCo Studio : " + std::string(model()->names));
|
||||||
|
} else {
|
||||||
|
window_->SetTitle("MuJoCo Studio : " +
|
||||||
|
std::filesystem::path(filepath).stem().string());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
SetLoadError(std::string(model_holder_->error()));
|
SetLoadError(std::string(model_holder_->error()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user