Skip to content

Commit

Permalink
Re-branding app menu's icon (uplift to 1.67.x) (#24011)
Browse files Browse the repository at this point in the history
Uplift of #23976 (squashed) to beta
  • Loading branch information
brave-builds authored Jun 6, 2024
1 parent 669a94b commit eada4c9
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 9 deletions.
41 changes: 32 additions & 9 deletions browser/ui/toolbar/app_menu_icons.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ const std::map<int, const gfx::VectorIcon&>& GetCommandIcons() {
{IDC_SHOW_BRAVE_WALLET, kLeoProductBraveWalletIcon},
{IDC_BRAVE_VPN_MENU, kLeoProductVpnIcon},
{IDC_APP_MENU_IPFS, kLeoProductIpfsOutlineIcon},
{IDC_PASSWORDS_AND_AUTOFILL_MENU, kLeoKeyIcon},
{IDC_RECENT_TABS_MENU, kLeoHistoryIcon},
{IDC_BOOKMARKS_MENU, kLeoProductBookmarksIcon},
{IDC_VIEW_PASSWORDS, kLeoKeyIcon},
{IDC_SHOW_DOWNLOADS, kLeoDownloadIcon},
{IDC_MANAGE_EXTENSIONS, kLeoBrowserExtensionsIcon},
{IDC_EXTENSIONS_SUBMENU_MANAGE_EXTENSIONS, kLeoBrowserExtensionsIcon},
{IDC_ZOOM_MENU, kLeoSearchZoomInIcon},
{IDC_PRINT, kLeoPrintIcon},
{IDC_FIND_AND_EDIT_MENU, kLeoFileSearchIcon},
{IDC_SAVE_AND_SHARE_MENU, kLeoFileDownloadIcon},
{IDC_MORE_TOOLS_MENU, kLeoWindowScrewdriverIcon},
{IDC_EDIT_MENU, kLeoCopyPlainTextIcon},
{IDC_OPTIONS, kLeoSettingsIcon},
{IDC_HELP_MENU, kLeoHelpOutlineIcon},
{IDC_EXIT, kLeoCloseIcon},
Expand All @@ -59,34 +60,56 @@ const std::map<int, const gfx::VectorIcon&>& GetCommandIcons() {
{IDC_BOOKMARK_ALL_TABS, kLeoBrowserBookmarkPluralIcon},
{IDC_BRAVE_BOOKMARK_BAR_SUBMENU, kLeoProductBookmarksIcon},
{IDC_SHOW_BOOKMARK_MANAGER, kLeoWindowBookmarkIcon},
{IDC_SHOW_BOOKMARK_SIDE_PANEL, kLeoProductBookmarksIcon},
{IDC_IMPORT_SETTINGS, kLeoImportArrowIcon},
{IDC_READING_LIST_MENU, kLeoReadingListIcon},

// The `History submenu
{IDC_SHOW_HISTORY, kLeoHistoryIcon},
{IDC_CLEAR_BROWSING_DATA, kLeoShredDataIcon},
{IDC_CLEAR_BROWSING_DATA, kLeoTrashIcon},
{IDC_RECENT_TABS_NO_DEVICE_TABS, kLeoSmartphoneLaptopIcon},

// The `Help` menu
// The `Help` submenu
{IDC_ABOUT, kLeoBraveIconMonochromeIcon},
{IDC_HELP_PAGE_VIA_MENU, kLeoHelpOutlineIcon},
{IDC_SHOW_BRAVE_WEBCOMPAT_REPORTER, kLeoWarningTriangleOutlineIcon},

// The `More tools` menu
{IDC_ADD_NEW_PROFILE, kLeoUserAddIcon},
{IDC_OPEN_GUEST_PROFILE, kLeoUserCircleIcon},
// The `Passwords and autofill` submenu
{IDC_SHOW_PASSWORD_MANAGER, kLeoKeyIcon},
{IDC_SHOW_PAYMENT_METHODS, kLeoCreditCardIcon},
{IDC_SHOW_ADDRESSES, kLeoLocationOnIcon},

// The `Find and edit` submenu
{IDC_FIND, kLeoSearchIcon},
// Use when cut icon is ready.
// {IDC_CUT, kLeoCutIcon},
{IDC_COPY, kLeoCopyIcon},
{IDC_PASTE, kLeoClipboardIcon},

// The `Save and share` submenu
{IDC_SAVE_PAGE, kLeoFileDownloadIcon},
{IDC_INSTALL_PWA, kLeoPwaInstallIcon},
{IDC_OPEN_IN_PWA_WINDOW, kLeoLaunchIcon},
{IDC_CREATE_SHORTCUT, kLeoShareWindowsIcon},
{IDC_COPY_URL, kLeoLinkNormalIcon},
{IDC_SEND_TAB_TO_SELF, kLeoSmartphoneLaptopIcon},
{IDC_QRCODE_GENERATOR, kLeoQrCodeIcon},
{IDC_SHARING_HUB_SCREENSHOT, kLeoScreenshotIcon},

// The `Reading list` submenu
{IDC_READING_LIST_MENU_ADD_TAB, kLeoReadingListAddIcon},
{IDC_READING_LIST_MENU_SHOW_UI, kLeoReadingListIcon},

// The `More tools` submenu
{IDC_ADD_NEW_PROFILE, kLeoUserAddIcon},
{IDC_OPEN_GUEST_PROFILE, kLeoUserCircleIcon},
{IDC_NAME_WINDOW, kLeoEditBoxIcon},
{IDC_COMMANDER, kLeoArrowSmallRightIcon},
{IDC_PERFORMANCE, kLeoNetworkSpeedFastIcon},
{IDC_DEV_TOOLS, kLeoCodeIcon},
{IDC_TASK_MANAGER, kLeoWindowBinaryCodeIcon},
{IDC_SHOW_BRAVE_SYNC, kLeoProductSyncIcon},
{IDC_ROUTE_MEDIA, kLeoChromeCastIcon},
{IDC_INSTALL_PWA, kLeoPwaInstallIcon},
{IDC_OPEN_IN_PWA_WINDOW, kLeoLaunchIcon},
{IDC_SIDEBAR_SHOW_OPTION_MENU, kLeoBrowserSidebarRightIcon},
});
return *kCommandIcons.get();
Expand Down
16 changes: 16 additions & 0 deletions browser/ui/toolbar/brave_app_menu_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,25 @@ void BraveAppMenuModel::Build() {

ApplyLeoIcons(this);
ApplyLeoIcons(bookmark_sub_menu_model());

for (const auto& submenu : sub_menus()) {
ApplyLeoIcons(submenu.get());
}

// TODO(simonhong): apply Nala icons recursively.
// Can be null in tests.
if (!bookmark_sub_menu_model()) {
return;
}

if (const auto reading_list_submenu_index =
bookmark_sub_menu_model()->GetIndexOfCommandId(
IDC_READING_LIST_MENU)) {
auto* reading_list_submenu = bookmark_sub_menu_model()->GetSubmenuModelAt(
*reading_list_submenu_index);
CHECK(reading_list_submenu);
ApplyLeoIcons(static_cast<ui::SimpleMenuModel*>(reading_list_submenu));
}
}

void BraveAppMenuModel::BuildTabsAndWindowsSection() {
Expand Down
9 changes: 9 additions & 0 deletions components/vector_icons/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ aggregate_vector_icons("brave_components_vector_icons") {
"leo_check_circle_filled.icon",
"leo_check_circle_outline.icon",
"leo_chrome_cast.icon",
"leo_clipboard.icon",
"leo_close.icon",
"leo_code.icon",
"leo_copy.icon",
"leo_copy_plain_text.icon",
"leo_credit_card.icon",
"leo_desktop_vpn_error_color.icon",
"leo_desktop_vpn_on_color.icon",
"leo_download.icon",
"leo_edit_box.icon",
"leo_eye_on.icon",
"leo_file_download.icon",
"leo_file_search.icon",
"leo_folder_exchange.icon",
"leo_folder.icon",
"leo_fullscreen_on.icon",
Expand All @@ -47,7 +51,9 @@ aggregate_vector_icons("brave_components_vector_icons") {
"leo_import_arrow.icon",
"leo_info_outline.icon",
"leo_key.icon",
"leo_link_normal.icon",
"leo_launch.icon",
"leo_location_on.icon",
"leo_message_bubble_heart.icon",
"leo_network_speed_fast.icon",
"leo_next_outline.icon",
Expand All @@ -68,9 +74,12 @@ aggregate_vector_icons("brave_components_vector_icons") {
"leo_product_tor.icon",
"leo_product_vpn.icon",
"leo_pwa_install.icon",
"leo_qr_code.icon",
"leo_reading_list.icon",
"leo_reading_list_add.icon",
"leo_reload.icon",
"leo_rss.icon",
"leo_screenshot.icon",
"leo_search_zoom_in.icon",
"leo_search.icon",
"leo_settings.icon",
Expand Down

0 comments on commit eada4c9

Please sign in to comment.