morgan pushed to branch tor-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser

Commits:

2 changed files:

Changes:

  • mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt
    ... ... @@ -55,6 +55,7 @@ import org.mozilla.fenix.ext.getRootView
    55 55
     import org.mozilla.fenix.ext.nav
    
    56 56
     import org.mozilla.fenix.ext.requireComponents
    
    57 57
     import org.mozilla.fenix.ext.setTextColor
    
    58
    +import org.mozilla.fenix.ext.settings
    
    58 59
     import org.mozilla.fenix.library.LibraryPageFragment
    
    59 60
     import org.mozilla.fenix.tabstray.Page
    
    60 61
     import org.mozilla.fenix.utils.allowUndo
    
    ... ... @@ -179,6 +180,10 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
    179 180
                     } else {
    
    180 181
                         inflater.inflate(R.menu.bookmarks_select_multi, menu)
    
    181 182
     
    
    183
    +                    menu.findItem(R.id.open_bookmarks_in_new_tabs_multi_select)?.apply {
    
    184
    +                        isVisible = !requireContext().settings().shouldDisableNormalMode
    
    185
    +                    }
    
    186
    +
    
    182 187
                         menu.findItem(R.id.delete_bookmarks_multi_select).title =
    
    183 188
                             SpannableString(getString(R.string.bookmark_menu_delete_button)).apply {
    
    184 189
                                 setTextColor(requireContext(), R.attr.textCritical)
    

  • mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkItemMenu.kt
    ... ... @@ -14,6 +14,7 @@ import mozilla.components.concept.storage.BookmarkNodeType
    14 14
     import mozilla.components.support.ktx.android.content.getColorFromAttr
    
    15 15
     import org.mozilla.fenix.R
    
    16 16
     import org.mozilla.fenix.ext.bookmarkStorage
    
    17
    +import org.mozilla.fenix.ext.settings
    
    17 18
     
    
    18 19
     class BookmarkItemMenu(
    
    19 20
         private val context: Context,
    
    ... ... @@ -37,6 +38,7 @@ class BookmarkItemMenu(
    37 38
         @SuppressWarnings("LongMethod")
    
    38 39
         internal suspend fun menuItems(itemType: BookmarkNodeType, itemId: String): List<TextMenuCandidate> {
    
    39 40
             val hasAtLeastOneChild = !context.bookmarkStorage.getTree(itemId, false)?.children.isNullOrEmpty()
    
    41
    +        val shouldDisableNormalMode = context.settings().shouldDisableNormalMode
    
    40 42
     
    
    41 43
             return listOfNotNull(
    
    42 44
                 if (itemType != BookmarkNodeType.SEPARATOR) {
    
    ... ... @@ -66,7 +68,7 @@ class BookmarkItemMenu(
    66 68
                 } else {
    
    67 69
                     null
    
    68 70
                 },
    
    69
    -            if (itemType == BookmarkNodeType.ITEM) {
    
    71
    +            if (!shouldDisableNormalMode && itemType == BookmarkNodeType.ITEM) {
    
    70 72
                     TextMenuCandidate(
    
    71 73
                         text = context.getString(R.string.bookmark_menu_open_in_new_tab_button),
    
    72 74
                     ) {
    
    ... ... @@ -84,7 +86,7 @@ class BookmarkItemMenu(
    84 86
                 } else {
    
    85 87
                     null
    
    86 88
                 },
    
    87
    -            if (hasAtLeastOneChild && itemType == BookmarkNodeType.FOLDER) {
    
    89
    +            if (!shouldDisableNormalMode && hasAtLeastOneChild && itemType == BookmarkNodeType.FOLDER) {
    
    88 90
                     TextMenuCandidate(
    
    89 91
                         text = context.getString(R.string.bookmark_menu_open_all_in_tabs_button),
    
    90 92
                     ) {