Skip to content

Commit

Permalink
Add search terms in window title
Browse files Browse the repository at this point in the history
  • Loading branch information
leecbaker committed Sep 14, 2018
1 parent 1e25725 commit 0a5d37b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/viewer_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,11 +741,20 @@ class ViewerWindow {
}
updateScroll();

std::string window_title = std::string("DataRef Tool (") + std::to_string(this->refs.size()) + ")";
if(params.invalidRegex()) {
window_title += " (Invalid regex)";
{ //update title
const std::string & search_term_text = params.getSearchField();
std::string window_title;
if(search_term_text.empty()) {
window_title = std::string("DataRefTool (") + std::to_string(this->refs.size()) + ")";
} else {
window_title = std::string("DataRefTool: " + search_term_text + " (") + std::to_string(this->refs.size()) + ")";

}
if(params.invalidRegex()) {
window_title += " (Invalid regex)";
}
XPSetWidgetDescriptor(window, window_title.c_str());
}
XPSetWidgetDescriptor(window, window_title.c_str());
}

void draw() {
Expand Down

0 comments on commit 0a5d37b

Please sign in to comment.