Skip to content

Commit

Permalink
Fix "about Mlem" theming and Form button hitboxes (#1415)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjmarf authored Nov 1, 2024
1 parent afddd61 commit f86ee0f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Mlem/App/Views/Root/Tabs/Settings/AboutMlemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,22 @@ struct AboutMlemView: View {
Section {
Link(destination: URL(string: "https://mlem.group")!) {
FormChevron { Label("Website", systemImage: Icons.websiteIcon) }
.foregroundStyle(palette.primary)
}
.tint(palette.colorfulAccent(2))
Link(destination: URL(string: "https://lemmy.ml/c/mlemapp")!) {
FormChevron { Label("Lemmy Community", systemImage: Icons.communityFill) }
.foregroundStyle(palette.primary)
}
.tint(palette.colorfulAccent(3))
Link(destination: URL(string: "https://matrix.to/#/#mlemappspace:matrix.org")!) {
FormChevron { Label("Matrix Room", image: "matrix.logo") }
.foregroundStyle(palette.primary)
}
.tint(.black) // non-palette because white tint turns this into white square
Link(destination: URL(string: "https://github.com/mlemgroup/mlem")!) {
FormChevron { Label("GitHub Repository", image: "github.logo") }
.foregroundStyle(palette.primary)
}
.tint(.black) // non-palette because white tint turns this into white square
}
Expand Down
16 changes: 10 additions & 6 deletions Mlem/App/Views/Shared/Palette Components/Button.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ struct PaletteButton: ButtonStyle {
@Environment(\.isEnabled) var isEnabled

func makeBody(configuration: Configuration) -> some View {
if isEnabled {
configuration.label
.foregroundStyle(.tint)
} else {
configuration.label
.foregroundStyle(palette.secondary)
Group {
if isEnabled {
configuration.label
.foregroundStyle(.tint)
} else {
configuration.label
.foregroundStyle(palette.secondary)
}
}
.frame(maxWidth: .infinity, alignment: .leading)
.contentShape(.rect)
}
}

0 comments on commit f86ee0f

Please sign in to comment.