[App] Build title using StringBuffer.

This commit is contained in:
gibbed
2021-05-01 17:15:41 -05:00
committed by Rick Gibbed
parent 38c3db1afb
commit 0419a9f13d
6 changed files with 28 additions and 17 deletions

View File

@@ -199,11 +199,12 @@ void Win32Window::DisableMainMenu() {
}
}
bool Win32Window::set_title(const std::string& title) {
bool Win32Window::set_title(const std::string_view title) {
if (!super::set_title(title)) {
return false;
}
SetWindowTextW(hwnd_, reinterpret_cast<LPCWSTR>(xe::to_utf16(title).c_str()));
auto wide_title = xe::to_utf16(title);
SetWindowTextW(hwnd_, reinterpret_cast<LPCWSTR>(wide_title.c_str()));
return true;
}