GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit 6af46bae authored by Matthew Finkel's avatar Matthew Finkel
Browse files

Bug 40005 - Modify Default toolbar menu

parent bdbd5ccf
......@@ -9,6 +9,8 @@ import android.widget.PopupWindow
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.cancel
import kotlinx.coroutines.flow.collect
import mozilla.components.concept.engine.webextension.WebExtensionBrowserAction
import mozilla.components.concept.engine.webextension.WebExtensionPageAction
import mozilla.components.browser.menu.facts.emitOpenMenuItemFact
import mozilla.components.browser.menu.item.WebExtensionBrowserMenuItem
import mozilla.components.browser.state.selector.selectedTab
......
......@@ -50,20 +50,10 @@ class WebExtensionBrowserMenuBuilder(
iconTintColorResource = webExtIconTintColorResource
)
val addonsManagerMenuItem = BrowserMenuImageText(
label = context.getString(R.string.mozac_browser_menu_addons_manager),
imageResource = R.drawable.mozac_ic_extensions,
iconTintColorResource = webExtIconTintColorResource
) {
onAddonsManagerTapped.invoke()
}
val webExtSubMenuItems = if (appendExtensionSubMenuAtStart) {
listOf(backPressMenuItem) + BrowserMenuDivider() +
extensionMenuItems +
BrowserMenuDivider() + addonsManagerMenuItem
listOf<BrowserMenuItem>(backPressMenuItem) + BrowserMenuDivider() +
extensionMenuItems
} else {
listOf(addonsManagerMenuItem) + BrowserMenuDivider() +
extensionMenuItems +
BrowserMenuDivider() + backPressMenuItem
}
......@@ -79,17 +69,13 @@ class WebExtensionBrowserMenuBuilder(
endOfMenuAlwaysVisible = endOfMenuAlwaysVisible
)
} else {
BrowserMenuImageText(
label = context.getString(R.string.mozac_browser_menu_addons),
imageResource = R.drawable.mozac_ic_extensions,
iconTintColorResource = webExtIconTintColorResource
) {
onAddonsManagerTapped.invoke()
}
null
}
val menuItems =
if (appendExtensionSubMenuAtStart) {
if (webExtMenuItem == null) {
items
} else if (appendExtensionSubMenuAtStart) {
listOf(webExtMenuItem) + items
} else {
items + webExtMenuItem
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment