Merge pull request #422 from weslly/feature/osx-proxy-icon

Add proxy icon to title bar in OSX
This commit is contained in:
Janek Bevendorff 2017-03-22 12:05:53 +01:00 committed by GitHub
commit 99036ec151
3 changed files with 17 additions and 0 deletions

View File

@ -552,6 +552,16 @@ bool DatabaseTabWidget::isModified(int index)
return indexDatabaseManagerStruct(index).modified;
}
QString DatabaseTabWidget::databasePath(int index)
{
if (index == -1) {
index = currentIndex();
}
return indexDatabaseManagerStruct(index).filePath;
}
void DatabaseTabWidget::updateTabName(Database* db)
{
int index = databaseIndex(db);

View File

@ -81,6 +81,7 @@ public slots:
bool isModified(int index = -1);
void performGlobalAutoType();
void lockDatabases();
QString databasePath(int index = -1);
signals:
void tabNameChanged();

View File

@ -530,6 +530,12 @@ void MainWindow::updateWindowTitle()
windowTitle = QString("%1 - %2").arg(customWindowTitlePart, BaseWindowTitle);
}
if (customWindowTitlePart.isEmpty() || stackedWidgetIndex == 1) {
setWindowFilePath("");
} else {
setWindowFilePath(m_ui->tabWidget->databasePath(tabWidgetIndex));
}
setWindowModified(m_ui->tabWidget->isModified(tabWidgetIndex));
setWindowTitle(windowTitle);