mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:27:35 +00:00
Base+Userland: Apply Human Interface Guidelines to Object text
Corrects a slew of titles, buttons, labels, menu items and status bars for capitalization, ellipses and punctuation. Rewords a few actions and dialogs to use uniform language and punctuation.
This commit is contained in:
parent
024360e604
commit
02d94a303c
77 changed files with 195 additions and 188 deletions
|
@ -42,7 +42,7 @@ private:
|
|||
void set_color_internal(Color, AllowCallback, bool change_text);
|
||||
|
||||
Color m_color;
|
||||
DeprecatedString m_color_picker_title { "Select color" };
|
||||
DeprecatedString m_color_picker_title { "Color Picker" };
|
||||
bool m_color_has_alpha_channel { true };
|
||||
bool m_may_be_color_rect_click { false };
|
||||
};
|
||||
|
|
|
@ -407,7 +407,7 @@ void ColorPicker::build_ui_custom(Widget& root_container)
|
|||
make_spinbox(Blue, m_color.blue());
|
||||
make_spinbox(Alpha, m_color.alpha());
|
||||
|
||||
m_selector_button = vertical_container.add<GUI::Button>("Select on screen"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_selector_button = vertical_container.add<GUI::Button>("Select on Screen"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_selector_button->on_click = [this](auto) {
|
||||
auto selector = ColorSelectOverlay::construct();
|
||||
auto original_color = m_color;
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
Color color() const { return m_color; }
|
||||
|
||||
private:
|
||||
explicit ColorPicker(Color, Window* parent_window = nullptr, DeprecatedString title = "Edit Color");
|
||||
explicit ColorPicker(Color, Window* parent_window = nullptr, DeprecatedString title = "Color Picker");
|
||||
|
||||
void build_ui();
|
||||
void build_ui_custom(Widget& root_container);
|
||||
|
|
|
@ -170,7 +170,7 @@ NonnullRefPtr<Action> make_select_all_action(Function<void(Action&)> callback, C
|
|||
|
||||
NonnullRefPtr<Action> make_rename_action(Function<void(Action&)> callback, Core::Object* parent)
|
||||
{
|
||||
return Action::create("Re&name", Key_F2, Gfx::Bitmap::load_from_file("/res/icons/16x16/rename.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent);
|
||||
return Action::create("Re&name...", Key_F2, Gfx::Bitmap::load_from_file("/res/icons/16x16/rename.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent);
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> make_properties_action(Function<void(Action&)> callback, Core::Object* parent)
|
||||
|
@ -205,7 +205,7 @@ NonnullRefPtr<Action> make_rotate_counterclockwise_action(Function<void(Action&)
|
|||
|
||||
NonnullRefPtr<Action> make_command_palette_action(Window* window)
|
||||
{
|
||||
auto action = Action::create("&Commands...", { Mod_Ctrl | Mod_Shift, Key_A }, MUST(Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv)), [=](auto&) {
|
||||
auto action = Action::create("Find &Command...", { Mod_Ctrl | Mod_Shift, Key_A }, MUST(Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv)), [=](auto&) {
|
||||
auto command_palette = CommandPalette::construct(*window);
|
||||
if (command_palette->exec() != GUI::Dialog::ExecResult::OK)
|
||||
return;
|
||||
|
|
|
@ -104,7 +104,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St
|
|||
set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
break;
|
||||
case Mode::Save:
|
||||
set_title("Save as");
|
||||
set_title("Save As");
|
||||
set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/save-as.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
break;
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St
|
|||
}
|
||||
|
||||
auto open_parent_directory_action = Action::create(
|
||||
"Open parent directory", { Mod_Alt, Key_Up }, Gfx::Bitmap::load_from_file("/res/icons/16x16/open-parent-directory.png"sv).release_value_but_fixme_should_propagate_errors(), [this](Action const&) {
|
||||
"Open Parent Directory", { Mod_Alt, Key_Up }, Gfx::Bitmap::load_from_file("/res/icons/16x16/open-parent-directory.png"sv).release_value_but_fixme_should_propagate_errors(), [this](Action const&) {
|
||||
set_path(DeprecatedString::formatted("{}/..", m_model->root_path()));
|
||||
},
|
||||
this);
|
||||
|
@ -184,13 +184,13 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St
|
|||
toolbar.add_separator();
|
||||
|
||||
auto mkdir_action = Action::create(
|
||||
"New directory...", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/mkdir.png"sv).release_value_but_fixme_should_propagate_errors(), [this](Action const&) {
|
||||
"New Directory...", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/mkdir.png"sv).release_value_but_fixme_should_propagate_errors(), [this](Action const&) {
|
||||
String value;
|
||||
if (InputBox::show(this, value, "Enter name:"sv, "New directory"sv, GUI::InputType::NonemptyText) == InputBox::ExecResult::OK) {
|
||||
if (InputBox::show(this, value, "Enter a name:"sv, "New Directory"sv, GUI::InputType::NonemptyText) == InputBox::ExecResult::OK) {
|
||||
auto new_dir_path = LexicalPath::canonicalized_path(DeprecatedString::formatted("{}/{}", m_model->root_path(), value));
|
||||
int rc = mkdir(new_dir_path.characters(), 0777);
|
||||
if (rc < 0) {
|
||||
MessageBox::show(this, DeprecatedString::formatted("mkdir(\"{}\") failed: {}", new_dir_path, strerror(errno)), "Error"sv, MessageBox::Type::Error);
|
||||
(void)MessageBox::try_show_error(this, DeprecatedString::formatted("Making new directory \"{}\" failed: {}", new_dir_path, Error::from_errno(errno)));
|
||||
} else {
|
||||
m_model->invalidate();
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St
|
|||
m_context_menu->add_separator();
|
||||
|
||||
auto show_dotfiles = GUI::Action::create_checkable(
|
||||
"Show dotfiles", { Mod_Ctrl, Key_H }, [&](auto& action) {
|
||||
"Show Dotfiles", { Mod_Ctrl, Key_H }, [&](auto& action) {
|
||||
m_model->set_should_show_dotfiles(action.is_checked());
|
||||
m_model->invalidate();
|
||||
},
|
||||
|
@ -296,7 +296,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St
|
|||
};
|
||||
|
||||
m_model->on_directory_change_error = [&](int, char const* error_string) {
|
||||
m_error_label->set_text(String::formatted("Could not open {}:\n{}", m_model->root_path(), error_string).release_value_but_fixme_should_propagate_errors());
|
||||
m_error_label->set_text(String::formatted("Opening \"{}\" failed: {}", m_model->root_path(), error_string).release_value_but_fixme_should_propagate_errors());
|
||||
m_view->set_active_widget(m_error_label);
|
||||
|
||||
m_view->view_as_icons_action().set_enabled(false);
|
||||
|
@ -347,12 +347,15 @@ void FilePicker::on_file_return()
|
|||
bool file_exists = FileSystem::exists(path);
|
||||
|
||||
if (!file_exists && (m_mode == Mode::Open || m_mode == Mode::OpenFolder)) {
|
||||
MessageBox::show(this, DeprecatedString::formatted("No such file or directory: {}", m_filename_textbox->text()), "File not found"sv, MessageBox::Type::Error, MessageBox::InputType::OK);
|
||||
(void)MessageBox::try_show_error(this, DeprecatedString::formatted("Opening \"{}\" failed: {}", m_filename_textbox->text(), Error::from_errno(ENOENT)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (file_exists && m_mode == Mode::Save) {
|
||||
auto result = MessageBox::show(this, "File already exists. Overwrite?"sv, "Existing File"sv, MessageBox::Type::Warning, MessageBox::InputType::OKCancel);
|
||||
auto text = String::formatted("Are you sure you want to overwrite \"{}\"?", m_filename_textbox->text());
|
||||
if (text.is_error())
|
||||
return;
|
||||
auto result = MessageBox::show(this, text.release_value(), "Confirm Overwrite"sv, MessageBox::Type::Warning, MessageBox::InputType::OKCancel);
|
||||
if (result == MessageBox::ExecResult::Cancel)
|
||||
return;
|
||||
}
|
||||
|
@ -364,7 +367,7 @@ void FilePicker::on_file_return()
|
|||
void FilePicker::set_path(DeprecatedString const& path)
|
||||
{
|
||||
if (access(path.characters(), R_OK | X_OK) == -1) {
|
||||
GUI::MessageBox::show(this, DeprecatedString::formatted("Could not open '{}':\n{}", path, strerror(errno)), "Error"sv, GUI::MessageBox::Type::Error);
|
||||
(void)GUI::MessageBox::try_show_error(this, DeprecatedString::formatted("Opening \"{}\" failed: {}", path, Error::from_errno(errno)));
|
||||
auto& common_locations_tray = *find_descendant_of_type_named<GUI::Tray>("common_locations_tray");
|
||||
for (auto& location_button : m_common_location_buttons)
|
||||
common_locations_tray.set_item_checked(location_button.tray_item_index, m_model->root_path() == location_button.path);
|
||||
|
|
|
@ -22,7 +22,7 @@ FontPicker::FontPicker(Window* parent_window, Gfx::Font const* current_font, boo
|
|||
: Dialog(parent_window)
|
||||
, m_fixed_width_only(fixed_width_only)
|
||||
{
|
||||
set_title("Font picker");
|
||||
set_title("Font Picker");
|
||||
resize(430, 280);
|
||||
set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-font-editor.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ ErrorOr<Dialog::ExecResult> MessageBox::try_ask_about_unsaved_changes(Window* pa
|
|||
TRY(builder.try_appendff("\nLast saved {} ago.", readable_time));
|
||||
}
|
||||
|
||||
auto box = TRY(MessageBox::create(parent_window, builder.string_view(), "Unsaved changes"sv, Type::Warning, InputType::YesNoCancel));
|
||||
auto box = TRY(MessageBox::create(parent_window, builder.string_view(), "Unsaved Changes"sv, Type::Warning, InputType::YesNoCancel));
|
||||
if (parent_window)
|
||||
box->set_icon(parent_window->icon());
|
||||
|
||||
|
|
|
@ -101,19 +101,19 @@ void MultiView::set_column_visible(int column_index, bool visible)
|
|||
void MultiView::build_actions()
|
||||
{
|
||||
m_view_as_icons_action = Action::create_checkable(
|
||||
"Icon view", { Mod_Ctrl, KeyCode::Key_1 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/icon-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
"Icon View", { Mod_Ctrl, KeyCode::Key_1 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/icon-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
set_view_mode(ViewMode::Icon);
|
||||
},
|
||||
this);
|
||||
|
||||
m_view_as_table_action = Action::create_checkable(
|
||||
"Table view", { Mod_Ctrl, KeyCode::Key_2 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/table-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
"Table View", { Mod_Ctrl, KeyCode::Key_2 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/table-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
set_view_mode(ViewMode::Table);
|
||||
},
|
||||
this);
|
||||
|
||||
m_view_as_columns_action = Action::create_checkable(
|
||||
"Columns view", { Mod_Ctrl, KeyCode::Key_3 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/columns-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
"Columns View", { Mod_Ctrl, KeyCode::Key_3 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/columns-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
set_view_mode(ViewMode::Columns);
|
||||
},
|
||||
this);
|
||||
|
|
|
@ -73,7 +73,7 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(DeprecatedString t
|
|||
if (!window->is_modified())
|
||||
return Window::CloseRequestDecision::Close;
|
||||
|
||||
auto result = MessageBox::show(window, "Apply these settings before closing?"sv, "Unsaved changes"sv, MessageBox::Type::Warning, MessageBox::InputType::YesNoCancel);
|
||||
auto result = MessageBox::show(window, "Apply these settings before closing?"sv, "Unsaved Changes"sv, MessageBox::Type::Warning, MessageBox::InputType::YesNoCancel);
|
||||
switch (result) {
|
||||
case MessageBox::ExecResult::Yes:
|
||||
window->apply_settings();
|
||||
|
|
|
@ -96,9 +96,9 @@ void TextEditor::create_actions()
|
|||
m_paste_action->set_enabled(is_editable() && Clipboard::the().fetch_mime_type().starts_with("text/"sv));
|
||||
if (is_multi_line()) {
|
||||
m_go_to_line_action = Action::create(
|
||||
"Go to line...", { Mod_Ctrl, Key_L }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
"Go to Line...", { Mod_Ctrl, Key_L }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
String value;
|
||||
if (InputBox::show(window(), value, "Line:"sv, "Go to line"sv) == InputBox::ExecResult::OK) {
|
||||
if (InputBox::show(window(), value, "Line:"sv, "Go to Line"sv) == InputBox::ExecResult::OK) {
|
||||
auto line_target = AK::StringUtils::convert_to_uint(value.bytes_as_string_view());
|
||||
if (line_target.has_value()) {
|
||||
set_cursor_and_focus_line(line_target.value() - 1, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue