[glass] Shorten SmartDashboard window names (#3096)

Instead of "/SmartDashboard/name" they now default to "name (SmartDashboard)".
This allows for smaller windows while preserving the name without requiring
user customization.
This commit is contained in:
Peter Johnson
2021-01-17 20:33:42 -08:00
committed by GitHub
parent cfdb3058ee
commit 4488e25f16
3 changed files with 9 additions and 2 deletions

View File

@@ -153,6 +153,10 @@ void NetworkTablesProvider::Show(ViewEntry* entry, Window* window) {
if (!window) {
return;
}
if (wpi::StringRef{entry->name}.startswith("/SmartDashboard/")) {
window->SetDefaultName(wpi::StringRef{entry->name}.drop_front(16) +
" (SmartDashboard)");
}
entry->window = window;
// create view