Applications: Use "Document - AppName" window title format

Fixes #1444
This commit is contained in:
Tibor Nagy 2020-03-13 23:21:35 +01:00 committed by Andreas Kling
parent b4381be0ba
commit f347dd5c5e
Notes: sideshowbarker 2024-07-19 08:19:17 +09:00
10 changed files with 10 additions and 10 deletions

View file

@ -159,7 +159,7 @@ PropertiesDialog::~PropertiesDialog() {}
void PropertiesDialog::update()
{
m_icon->set_icon(const_cast<Gfx::Bitmap*>(m_model.icon_for_file(m_mode, m_name).bitmap_for_size(32)));
set_title(String::format("Properties of \"%s\"", m_name.characters()));
set_title(String::format("%s - Properties", m_name.characters()));
}
void PropertiesDialog::permission_changed(mode_t mask, bool set)

View file

@ -493,7 +493,7 @@ int main(int argc, char** argv)
main_toolbar.add_action(*view_as_columns_action);
directory_view.on_path_change = [&](const String& new_path) {
window->set_title(String::format("File Manager: %s", new_path.characters()));
window->set_title(String::format("%s - File Manager", new_path.characters()));
location_textbox.set_text(new_path);
auto new_index = directories_model->index(new_path, GUI::FileSystemModel::Column::Name);
if (new_index.is_valid()) {

View file

@ -134,7 +134,7 @@ int main(int argc, char* argv[])
html_view.set_document(html_document);
String page_and_section = model->page_and_section(tree_view.selection().first());
window->set_title(String::format("Help: %s", page_and_section.characters()));
window->set_title(String::format("%s - Help", page_and_section.characters()));
};
tree_view.on_selection_change = [&] {

View file

@ -227,10 +227,10 @@ void HexEditorWidget::set_path(const FileSystemPath& file)
void HexEditorWidget::update_title()
{
StringBuilder builder;
builder.append("Hex Editor: ");
builder.append(m_path);
if (m_document_dirty)
builder.append(" (*)");
builder.append(" - Hex Editor");
window()->set_title(builder.to_string());
}

View file

@ -72,7 +72,7 @@ IRCAppWindow::~IRCAppWindow()
void IRCAppWindow::update_title()
{
set_title(String::format("IRC Client: %s@%s:%d", m_client->nickname().characters(), m_client->hostname().characters(), m_client->port()));
set_title(String::format("%s@%s:%d - IRC Client", m_client->nickname().characters(), m_client->hostname().characters(), m_client->port()));
}
void IRCAppWindow::setup_client()

View file

@ -92,7 +92,7 @@ int main(int argc, char** argv)
widget.set_bitmap(*bitmap);
auto update_window_title = [&](int scale) {
window->set_title(String::format("QuickShow: %s %s %d%%", widget.path().characters(), widget.bitmap()->size().to_string().characters(), scale));
window->set_title(String::format("%s %s %d%% - QuickShow", widget.path().characters(), widget.bitmap()->size().to_string().characters(), scale));
};
window->set_double_buffering_enabled(true);

View file

@ -142,7 +142,7 @@ void SoundPlayerWidget::open_file(String path)
m_play->set_enabled(true);
m_stop->set_enabled(true);
m_window.set_title(String::format("SoundPlayer - \"%s\"", loader->file()->filename().characters()));
m_window.set_title(String::format("%s - SoundPlayer", loader->file()->filename().characters()));
m_status->set_text(String::format(
"Sample rate %uHz, %u %s, %u bits per sample",
loader->sample_rate(),

View file

@ -467,10 +467,10 @@ void TextEditorWidget::set_path(const FileSystemPath& file)
void TextEditorWidget::update_title()
{
StringBuilder builder;
builder.append("Text Editor: ");
builder.append(m_path);
if (m_document_dirty)
builder.append(" (*)");
builder.append(" - Text Editor");
window()->set_title(builder.to_string());
}

View file

@ -86,7 +86,7 @@ int main(int argc, char** argv)
remote_process.on_update = [&] {
if (!remote_process.process_name().is_null())
window->set_title(String::format("Inspector: %s (%d)", remote_process.process_name().characters(), remote_process.pid()));
window->set_title(String::format("%s (%d) - Inspector", remote_process.process_name().characters(), remote_process.pid()));
};
auto& tree_view = splitter.add<GUI::TreeView>();

View file

@ -48,7 +48,7 @@ int main(int argc, char** argv)
window->set_rect(300, 100, SolitaireWidget::width, SolitaireWidget::height);
auto widget = SolitaireWidget::construct(window, [&](uint32_t score) {
window->set_title(String::format("Solitaire - Score: %u", score));
window->set_title(String::format("Score: %u - Solitaire", score));
});
auto menu_bar = make<GUI::MenuBar>();