Skip to content

Commit

Permalink
Fix setting window title as modified
Browse files Browse the repository at this point in the history
  • Loading branch information
varjolintu committed Dec 18, 2024
1 parent f2ed4e3 commit b3c4c25
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,8 @@ void MainWindow::updateWindowTitle()
if (stackedWidgetIndex == DatabaseTabScreen && tabWidgetIndex != -1) {
customWindowTitlePart = m_ui->tabWidget->tabName(tabWidgetIndex);
if (isModified) {
// remove asterisk '*' from title
customWindowTitlePart.remove(customWindowTitlePart.size() - 1, 1);
// Remove asterisk '*' from title
customWindowTitlePart.replace("*", "");
}
m_ui->actionDatabaseSave->setEnabled(m_ui->tabWidget->canSave(tabWidgetIndex));
} else if (stackedWidgetIndex == 1) {
Expand All @@ -1055,8 +1055,9 @@ void MainWindow::updateWindowTitle()
setWindowFilePath(m_ui->tabWidget->databaseWidgetFromIndex(tabWidgetIndex)->database()->filePath());
}

setWindowTitle(windowTitle);
setWindowTitle("[*]"); // Reset title to the placeholder first
setWindowModified(isModified);
setWindowTitle(windowTitle);

updateTrayIcon();
}
Expand Down

0 comments on commit b3c4c25

Please sign in to comment.