Skip to content

Commit

Permalink
FXIOS-10442 #22855 ⁃ [Menu Redesign] Fix UI issues for the profile ic…
Browse files Browse the repository at this point in the history
…on on the menu
  • Loading branch information
dicarobinho committed Nov 6, 2024
1 parent 71d03b3 commit de041ea
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
8 changes: 5 additions & 3 deletions BrowserKit/Sources/ComponentLibrary/Headers/HeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public final class HeaderView: UIView, ThemeApplicable {
static let siteDomainLabelsVerticalSpacing: CGFloat = 12
static let largeFaviconImageSize: CGFloat = 48
static let favIconImageSize: CGFloat = 32
static let smallFaviconImageSize: CGFloat = 20
static let smallFaviconImageSize: CGFloat = 24
static let maskFaviconImageSize: CGFloat = 32
static let horizontalMargin: CGFloat = 16
static let headerLabelDistance: CGFloat = 2
Expand Down Expand Up @@ -90,10 +90,12 @@ public final class HeaderView: UIView, ThemeApplicable {
warningIconView.removeConstraints(warningIconView.constraints)
iconMask.removeConstraints(iconMask.constraints)
viewConstraints.removeAll()
let favIconPadding = (UX.maskFaviconImageSize / 2) - (UX.smallFaviconImageSize / 2)
let favIconLeadingConstant = isWebsiteIcon ? UX.horizontalMargin : UX.horizontalMargin + favIconPadding
viewConstraints.append(contentsOf: [
favicon.leadingAnchor.constraint(
equalTo: self.leadingAnchor,
constant: UX.horizontalMargin
constant: favIconLeadingConstant
),

headerLabelsContainer.topAnchor.constraint(
Expand All @@ -105,7 +107,7 @@ public final class HeaderView: UIView, ThemeApplicable {
constant: -UX.siteDomainLabelsVerticalSpacing
),
headerLabelsContainer.leadingAnchor.constraint(
equalTo: favicon.trailingAnchor,
equalTo: isWebsiteIcon ? favicon.trailingAnchor : iconMask.trailingAnchor,
constant: UX.siteDomainLabelsVerticalSpacing
),
headerLabelsContainer.trailingAnchor.constraint(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ struct MainMenuConfigurationUtility: Equatable {
isEnabled: readerModeState != .unavailable,
isActive: readerModeState == .active,
a11yLabel: a11yLabel,
a11yHint: "",
a11yHint: readerModeState != .unavailable ? "" : .MainMenu.AccessibilityLabels.OptionDisabledHint,
a11yId: AccessibilityIdentifiers.MainMenu.readerView,
action: {
store.dispatch(
Expand Down Expand Up @@ -527,7 +527,7 @@ struct MainMenuConfigurationUtility: Equatable {
isEnabled: tabInfo.readerModeIsAvailable,
isActive: tabInfo.isInReadingList,
a11yLabel: a11yLabel,
a11yHint: "",
a11yHint: tabInfo.readerModeIsAvailable ? "" : .MainMenu.AccessibilityLabels.OptionDisabledHint,
a11yId: AccessibilityIdentifiers.MainMenu.saveToReadingList,
action: {
store.dispatch(
Expand Down
8 changes: 8 additions & 0 deletions firefox-ios/Client/Frontend/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3900,6 +3900,14 @@ extension String {
// MARK: - Main Menu
extension String {
public struct MainMenu {
public struct AccessibilityLabels {
public static let OptionDisabledHint = MZLocalizedString(
key: "MainMenu.AccessibilityLabels.OptionDisabled.Hint.v134",
tableName: "MainMenu",
value: "Dimmed",
comment: "On the main menu, the accessibility label hint for any action/option inside the menu, that is disabled. For example: 'Save to Reading List' option, from Menu, in some cases is disabled and the voice over should indicate that. 'Save To Reading List dimmed'")
}

public struct Account {
public static let SignedOutTitle = MZLocalizedString(
key: "MainMenu.Account.SignedOut.Title.v131",
Expand Down

0 comments on commit de041ea

Please sign in to comment.