Skip to content

Commit

Permalink
Cleanup titlebar.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 28, 2007
1 parent 0321800 commit b99bdfc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/toby_wxwidgets.cpp
Expand Up @@ -781,6 +781,8 @@ TobyFrame::TobyFrame()
wxConfigBase *cfg = wxConfig::Get();
if ((cfg != NULL) && (cfg->Read(wxT("Maximized"), &mx)) && (mx))
this->Maximize();

this->updateTitleBar();
} // TobyFrame::TobyFrame


Expand Down Expand Up @@ -946,10 +948,13 @@ void TobyFrame::onIdle(wxIdleEvent &evt)

void TobyFrame::updateTitleBar()
{
const wxFileName fn(this->filename);
wxString fnstr(fn.GetFullName());
wxString fnstr;
if (!this->filename.IsEmpty())
fnstr = wxFileName(this->filename).GetFullName();
else
fnstr = wxT("New file");
wxString modstr(this->modified ? wxT("*") : wxT(""));
this->SetTitle(wxString::Format(wxT("%s%s - Toby"),
this->SetTitle(wxString::Format(wxT("Toby - %s%s"),
fnstr.c_str(), modstr.c_str()));
} // TobyFrame::updateTitleBar

Expand Down

0 comments on commit b99bdfc

Please sign in to comment.