mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer: call ComponentPeer::setRepresentedFile() and ::setIcon() when loading a project
This commit is contained in:
parent
9027d1e5a1
commit
4410ffc892
2 changed files with 18 additions and 0 deletions
|
|
@ -103,12 +103,29 @@ void MainWindow::createProjectContentCompIfNeeded()
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::setTitleBarIcon()
|
||||
{
|
||||
if (auto* peer = getPeer())
|
||||
{
|
||||
if (currentProject != nullptr)
|
||||
{
|
||||
peer->setRepresentedFile (currentProject->getFile());
|
||||
peer->setIcon (ImageCache::getFromMemory (BinaryData::juce_icon_png, BinaryData::juce_icon_pngSize));
|
||||
}
|
||||
else
|
||||
{
|
||||
peer->setRepresentedFile ({});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::makeVisible()
|
||||
{
|
||||
restoreWindowPosition();
|
||||
setVisible (true);
|
||||
addToDesktop(); // (must add before restoring size so that fullscreen will work)
|
||||
restoreWindowPosition();
|
||||
setTitleBarIcon();
|
||||
|
||||
getContentComponent()->grabKeyboardFocus();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ private:
|
|||
|
||||
static const char* getProjectWindowPosName() { return "projectWindowPos"; }
|
||||
void createProjectContentCompIfNeeded();
|
||||
void setTitleBarIcon();
|
||||
|
||||
void valueChanged (Value&) override;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue