Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix FXIOS-10442 ⁃ [Menu] Fix UI issues for the profile icon on the menu (backport #22930) #22938

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -3895,6 +3895,14 @@ extension String {
// MARK: - Main Menu
extension String {
public struct MainMenu {
public struct AccessibilityLabels {
public static let OptionDisabledHint = MZLocalizedString(
key: "MainMenu.AccessibilityLabels.OptionDisabled.Hint.v133",
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
Loading