mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Introjucer: updated window title bar status when current file has unsaved changes.
This commit is contained in:
parent
2c8b5a37af
commit
b0fadda27c
5 changed files with 51 additions and 5 deletions
|
|
@ -368,7 +368,6 @@ bool ProjectContentComponent::showDocument (OpenDocumentManager::Document* doc,
|
|||
contentView->grabKeyboardFocus();
|
||||
|
||||
return opened;
|
||||
|
||||
}
|
||||
|
||||
void ProjectContentComponent::hideEditor()
|
||||
|
|
@ -426,6 +425,8 @@ void ProjectContentComponent::saveDocument()
|
|||
currentDocument->save();
|
||||
else
|
||||
saveProject();
|
||||
|
||||
updateMainWindowTitle();
|
||||
}
|
||||
|
||||
bool ProjectContentComponent::goToPreviousFile()
|
||||
|
|
@ -493,7 +494,23 @@ void ProjectContentComponent::deleteSelectedTreeItems()
|
|||
void ProjectContentComponent::updateMainWindowTitle()
|
||||
{
|
||||
if (MainWindow* mw = findParentComponentOfClass<MainWindow>())
|
||||
mw->updateTitle (currentDocument != nullptr ? currentDocument->getName() : String::empty);
|
||||
{
|
||||
String title;
|
||||
bool edited = false;
|
||||
|
||||
if (currentDocument != nullptr)
|
||||
{
|
||||
title = currentDocument->getName();
|
||||
edited = currentDocument->needsSaving();
|
||||
}
|
||||
|
||||
if (ComponentPeer* peer = mw->getPeer())
|
||||
if (! peer->setDocumentEditedStatus (edited))
|
||||
if (edited)
|
||||
title << "*";
|
||||
|
||||
mw->updateTitle (title);
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectContentComponent::showBubbleMessage (const Rectangle<int>& pos, const String& text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue