summaryrefslogtreecommitdiff
path: root/Userland/Services/WindowServer
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-04-29 22:23:52 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-29 22:23:52 +0200
commit3d4afe7614bf8ff4c6fe141d1dcd83688a7ac8cd (patch)
treeb27345e76b10d2cd7c4381a70385c21d6310405a /Userland/Services/WindowServer
parent7ae7170d6140f7cad730f05f84b53437058b82f4 (diff)
downloadserenity-3d4afe7614bf8ff4c6fe141d1dcd83688a7ac8cd.zip
Everywhere: "indexes" => "indices"
I've wasted a silly amount of time in the past fretting over which of these words to use. Let's just choose one and use it everywhere. :^)
Diffstat (limited to 'Userland/Services/WindowServer')
-rw-r--r--Userland/Services/WindowServer/Menu.cpp6
-rw-r--r--Userland/Services/WindowServer/Menu.h2
-rw-r--r--Userland/Services/WindowServer/MenuManager.cpp6
3 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Services/WindowServer/Menu.cpp b/Userland/Services/WindowServer/Menu.cpp
index 0ace3f5fd7..01a938fd5f 100644
--- a/Userland/Services/WindowServer/Menu.cpp
+++ b/Userland/Services/WindowServer/Menu.cpp
@@ -618,15 +618,15 @@ void Menu::set_visible(bool visible)
void Menu::add_item(NonnullOwnPtr<MenuItem> item)
{
if (auto alt_shortcut = find_ampersand_shortcut_character(item->text())) {
- m_alt_shortcut_character_to_item_indexes.ensure(tolower(alt_shortcut)).append(m_items.size());
+ m_alt_shortcut_character_to_item_indices.ensure(tolower(alt_shortcut)).append(m_items.size());
}
m_items.append(move(item));
}
const Vector<size_t>* Menu::items_with_alt_shortcut(u32 alt_shortcut) const
{
- auto it = m_alt_shortcut_character_to_item_indexes.find(tolower(alt_shortcut));
- if (it == m_alt_shortcut_character_to_item_indexes.end())
+ auto it = m_alt_shortcut_character_to_item_indices.find(tolower(alt_shortcut));
+ if (it == m_alt_shortcut_character_to_item_indices.end())
return nullptr;
return &it->value;
}
diff --git a/Userland/Services/WindowServer/Menu.h b/Userland/Services/WindowServer/Menu.h
index e3dac4b1b6..dcc72d8a27 100644
--- a/Userland/Services/WindowServer/Menu.h
+++ b/Userland/Services/WindowServer/Menu.h
@@ -154,7 +154,7 @@ private:
int m_scroll_offset { 0 };
int m_max_scroll_offset { 0 };
- HashMap<u32, Vector<size_t>> m_alt_shortcut_character_to_item_indexes;
+ HashMap<u32, Vector<size_t>> m_alt_shortcut_character_to_item_indices;
};
u32 find_ampersand_shortcut_character(const StringView&);
diff --git a/Userland/Services/WindowServer/MenuManager.cpp b/Userland/Services/WindowServer/MenuManager.cpp
index 9152bd2747..9e2e78156f 100644
--- a/Userland/Services/WindowServer/MenuManager.cpp
+++ b/Userland/Services/WindowServer/MenuManager.cpp
@@ -70,11 +70,11 @@ void MenuManager::event(Core::Event& event)
&& ((key_event.key() >= Key_A && key_event.key() <= Key_Z)
|| (key_event.key() >= Key_0 && key_event.key() <= Key_9))) {
- if (auto* shortcut_item_indexes = m_current_menu->items_with_alt_shortcut(key_event.code_point())) {
- VERIFY(!shortcut_item_indexes->is_empty());
+ if (auto* shortcut_item_indices = m_current_menu->items_with_alt_shortcut(key_event.code_point())) {
+ VERIFY(!shortcut_item_indices->is_empty());
// FIXME: If there are multiple items with the same Alt shortcut, we should cycle through them
// with each keypress instead of activating immediately.
- auto index = shortcut_item_indexes->at(0);
+ auto index = shortcut_item_indices->at(0);
auto& item = m_current_menu->item(index);
m_current_menu->set_hovered_index(index);
if (item.is_submenu())