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

Widget Customizer Overhaul #1674

Merged
merged 43 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c16cbe8
layout that doesn't suck
EricBAndrews Jan 25, 2025
75426a3
super janky but does technically work
EricBAndrews Jan 25, 2025
695f798
sorta ok
EricBAndrews Jan 25, 2025
cb16a53
more works
EricBAndrews Jan 25, 2025
924533e
remove animation
EricBAndrews Jan 26, 2025
fec9147
animations work
EricBAndrews Jan 26, 2025
81fe5aa
tidy
EricBAndrews Jan 26, 2025
10daba9
fix minor logic errors
EricBAndrews Jan 27, 2025
835fe11
big rewrite to avoid enumerated
EricBAndrews Jan 27, 2025
cf6514b
reasonably stable
EricBAndrews Jan 27, 2025
7b03d18
tidy
EricBAndrews Jan 27, 2025
bd98cdd
haptics and bugfix
EricBAndrews Jan 27, 2025
a79842f
drag and drop haptics
EricBAndrews Jan 27, 2025
5781e9e
fix reset
EricBAndrews Jan 28, 2025
8109a78
clean up
EricBAndrews Jan 28, 2025
3296a04
strict lint
EricBAndrews Jan 28, 2025
d071ba6
fix haptics
EricBAndrews Jan 28, 2025
e4388f6
back to indiices
EricBAndrews Jan 28, 2025
1b8a879
tidy and document
EricBAndrews Jan 28, 2025
9782823
doc
EricBAndrews Jan 28, 2025
7077abe
z index
EricBAndrews Jan 28, 2025
6c374c1
fully fix z indexing issues
EricBAndrews Jan 28, 2025
b536ca2
remove dead code
EricBAndrews Jan 28, 2025
00c1c7f
organize
EricBAndrews Jan 28, 2025
90150a9
rename bottomBarButtons
EricBAndrews Jan 28, 2025
61b06b0
DropLocation
EricBAndrews Jan 28, 2025
ee01e8c
merge dev
EricBAndrews Jan 28, 2025
58c195f
padding
EricBAndrews Jan 28, 2025
bd21d71
padding
EricBAndrews Jan 28, 2025
6c59585
Update Mlem/App/Views/Root/Tabs/Settings/InteractionBarEditor/Interac…
EricBAndrews Jan 28, 2025
6b6b422
remove isTray
EricBAndrews Jan 29, 2025
b27b57f
kill newlines
EricBAndrews Jan 29, 2025
b678191
Update Mlem/App/Views/Root/Tabs/Settings/InteractionBarEditor/Interac…
EricBAndrews Jan 29, 2025
857f064
Update Mlem/App/Models/Action/CounterAppearance.swift
EricBAndrews Jan 29, 2025
925bdff
improve small screen display
EricBAndrews Jan 29, 2025
7223ce2
static CounterAppearance
EricBAndrews Jan 29, 2025
e5ba497
tray items now appear immediately after being removed from bar
EricBAndrews Jan 29, 2025
be32bdd
Update Mlem/App/Views/Root/Tabs/Settings/InteractionBarEditor/Interac…
EricBAndrews Jan 30, 2025
de3f2b9
Update Mlem/App/Models/Action/CounterApperance+StaticValues.swift
EricBAndrews Jan 30, 2025
a06f7c8
Update Mlem/App/Views/Root/Tabs/Settings/InteractionBarEditor/Interac…
EricBAndrews Jan 30, 2025
65bcded
Update Mlem/App/Views/Root/Tabs/Settings/InteractionBarEditor/Interac…
EricBAndrews Jan 30, 2025
669b117
Update Mlem/App/Views/Root/Tabs/Settings/InteractionBarEditor/Interac…
EricBAndrews Jan 30, 2025
aa888a6
dark mode and oled fixes
EricBAndrews Jan 30, 2025
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
12 changes: 12 additions & 0 deletions Mlem.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@
CD332D7E2CA7486000A53988 /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD332D7D2CA7485D00A53988 /* String+Extensions.swift */; };
CD33CA522D3C18BF00106C8C /* ImageViewer+Views.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD33CA512D3C18AE00106C8C /* ImageViewer+Views.swift */; };
CD383BBD2D41B91E00F9F247 /* MlemMiddleware in Frameworks */ = {isa = PBXBuildFile; productRef = CD383BBC2D41B91E00F9F247 /* MlemMiddleware */; };
CD3FC6802D4A75090088E63B /* CounterApperance+StaticValues.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD3FC67F2D4A75050088E63B /* CounterApperance+StaticValues.swift */; };
CD4368C12AE23FD400BD8BD1 /* Semaphore in Frameworks */ = {isa = PBXBuildFile; productRef = CD4368C02AE23FD400BD8BD1 /* Semaphore */; };
CD43E8B32BF2C24E007C3D71 /* ContentLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD43E8B22BF2C24E007C3D71 /* ContentLoader.swift */; };
CD45CB0D2D1880E8008BC729 /* FiltersSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD45CB0C2D1880E3008BC729 /* FiltersSettingsView.swift */; };
Expand Down Expand Up @@ -397,6 +398,8 @@
CD57AFA52D0377EB00AB3956 /* AnimationControlLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD57AFA42D0377E400AB3956 /* AnimationControlLayer.swift */; };
CD5CAA0C2D41AE57008E20F2 /* EmbeddingSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD5CAA0B2D41AE52008E20F2 /* EmbeddingSettingsView.swift */; };
CD635E1B2C94DACD00864F75 /* BypassProxyWarningSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD635E1A2C94DACD00864F75 /* BypassProxyWarningSheet.swift */; };
CD6436502D483C96002668FB /* InteractionBarEditorView+Views.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD64364F2D483C8F002668FB /* InteractionBarEditorView+Views.swift */; };
CD6436522D483F2D002668FB /* MockTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD6436512D483F23002668FB /* MockTextView.swift */; };
CD64A91A2CA37E8D007CA7E6 /* Gifu in Frameworks */ = {isa = PBXBuildFile; productRef = CD64A9192CA37E8D007CA7E6 /* Gifu */; };
CD64A91C2CA38DBA007CA7E6 /* NukeWebpBridgeDecoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD64A91B2CA38DA7007CA7E6 /* NukeWebpBridgeDecoder.swift */; };
CD77437F2C1BA5CE0085BB43 /* MultiplatformView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD77437E2C1BA5CE0085BB43 /* MultiplatformView.swift */; };
Expand Down Expand Up @@ -851,6 +854,7 @@
CD332D7B2CA71E6E00A53988 /* GifView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GifView.swift; sourceTree = "<group>"; };
CD332D7D2CA7485D00A53988 /* String+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extensions.swift"; sourceTree = "<group>"; };
CD33CA512D3C18AE00106C8C /* ImageViewer+Views.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ImageViewer+Views.swift"; sourceTree = "<group>"; };
CD3FC67F2D4A75050088E63B /* CounterApperance+StaticValues.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CounterApperance+StaticValues.swift"; sourceTree = "<group>"; };
CD43E8B22BF2C24E007C3D71 /* ContentLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentLoader.swift; sourceTree = "<group>"; };
CD45CB0C2D1880E3008BC729 /* FiltersSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FiltersSettingsView.swift; sourceTree = "<group>"; };
CD4BAD342B4B2C0B00A1E726 /* FeedsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedsView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -882,6 +886,8 @@
CD57AFA42D0377E400AB3956 /* AnimationControlLayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimationControlLayer.swift; sourceTree = "<group>"; };
CD5CAA0B2D41AE52008E20F2 /* EmbeddingSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmbeddingSettingsView.swift; sourceTree = "<group>"; };
CD635E1A2C94DACD00864F75 /* BypassProxyWarningSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BypassProxyWarningSheet.swift; sourceTree = "<group>"; };
CD64364F2D483C8F002668FB /* InteractionBarEditorView+Views.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "InteractionBarEditorView+Views.swift"; sourceTree = "<group>"; };
CD6436512D483F23002668FB /* MockTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockTextView.swift; sourceTree = "<group>"; };
CD64A91B2CA38DA7007CA7E6 /* NukeWebpBridgeDecoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NukeWebpBridgeDecoder.swift; sourceTree = "<group>"; };
CD77437E2C1BA5CE0085BB43 /* MultiplatformView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiplatformView.swift; sourceTree = "<group>"; };
CD7743882C20EDEE0085BB43 /* VotesModel+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VotesModel+Extensions.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1328,6 +1334,7 @@
0397D4982C6EA68A002C6CDC /* InteractionBarEditor */ = {
isa = PBXGroup;
children = (
CD64364F2D483C8F002668FB /* InteractionBarEditorView+Views.swift */,
0397D4992C6EA6EE002C6CDC /* InteractionBarEditorView.swift */,
03036C822C727D0500C6DA1D /* InteractionBarEditorView+Logic.swift */,
);
Expand Down Expand Up @@ -1406,6 +1413,7 @@
03D3A1EB2BB8CDFB009DE55E /* Action */ = {
isa = PBXGroup;
children = (
CD3FC67F2D4A75050088E63B /* CounterApperance+StaticValues.swift */,
03AF91E92C1CE96600E56644 /* Counter.swift */,
0324FA762C1F0AE100F6247D /* Readout.swift */,
03D3A1D32BB88EF1009DE55E /* Action.swift */,
Expand Down Expand Up @@ -1682,6 +1690,7 @@
CD4D58A82B86BE4C00B82964 /* Shared */ = {
isa = PBXGroup;
children = (
CD6436512D483F23002668FB /* MockTextView.swift */,
CD0374292D1DBFCF001E85FA /* ReadCheck.swift */,
CDAA02E42C82236200D75633 /* Palette Components */,
03B431C32C45BA45001A1EB5 /* AccountPickerMenu.swift */,
Expand Down Expand Up @@ -2624,6 +2633,7 @@
CD4BAD352B4B2C0B00A1E726 /* FeedsView.swift in Sources */,
03049A1E2C6508F400FF6889 /* ApiRegistrationMode+Extensions.swift in Sources */,
037DE0752CE023E3007F7B92 /* BlockListView.swift in Sources */,
CD3FC6802D4A75090088E63B /* CounterApperance+StaticValues.swift in Sources */,
038028D52CAB479D0091A8A2 /* PostEditorView+Views.swift in Sources */,
CDE021AD2BFA43380052FD61 /* FeedPostView.swift in Sources */,
0320B64F2C8A638A00D38548 /* SignUpView.swift in Sources */,
Expand Down Expand Up @@ -2667,6 +2677,7 @@
03500C2B2BF7F1B100CAA076 /* ToastOverlayView.swift in Sources */,
032C32042C3439C600595286 /* ActorIdentifiable+Extensions.swift in Sources */,
CD57AFA52D0377EB00AB3956 /* AnimationControlLayer.swift in Sources */,
CD6436522D483F2D002668FB /* MockTextView.swift in Sources */,
CD4D59182B87B3B000B82964 /* UIViewController+Extensions.swift in Sources */,
034B94812C09306D00039AF4 /* CommunityOrPersonStub+Extensions.swift in Sources */,
0320B6692C93506300D38548 /* SearchView+Logic.swift in Sources */,
Expand Down Expand Up @@ -2703,6 +2714,7 @@
03B62C402CE811CB0077E9C8 /* PersonBanEditorView+Logic.swift in Sources */,
03A82FA32C0D1F2400D01A5C /* View+ExternalApiWarning.swift in Sources */,
033F84C32C2B12AA002E3EDF /* InstanceSummary.swift in Sources */,
CD6436502D483C96002668FB /* InteractionBarEditorView+Views.swift in Sources */,
0369B3532BFA514B001EFEDF /* ToastLocation.swift in Sources */,
036ED6792D0AF3740018E5EA /* PinnedSortTracker.swift in Sources */,
CDC44A362D1CBC280030F01C /* ReadPostIndicator.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extension PlatformConstants {
settingsIconSize: 28,
barIconSize: 15.5,
barIconCornerRadius: 4,
barIconPadding: 4.24,
barIconPadding: 4.25,
barIconHitbox: 44
)
}
8 changes: 4 additions & 4 deletions Mlem/App/Enums/Interaction/CommentBarConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ struct CommentBarConfiguration: InteractionBarConfiguration {

var appearance: CounterAppearance {
switch self {
case .score: .init(value: 7, leading: .upvote(isOn: false), trailing: .downvote(isOn: false))
case .upvote: .init(value: 9, leading: .upvote(isOn: false), trailing: nil)
case .downvote: .init(value: 2, leading: .downvote(isOn: false), trailing: nil)
case .reply: .init(value: 1, leading: .reply(), trailing: nil)
case .score: .score()
case .upvote: .upvote()
case .downvote: .downvote()
case .reply: .reply()
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Mlem/App/Enums/Interaction/PostBarConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ struct PostBarConfiguration: InteractionBarConfiguration {

var appearance: CounterAppearance {
switch self {
case .score: .init(value: 7, leading: .upvote(isOn: false), trailing: .downvote(isOn: false))
case .upvote: .init(value: 9, leading: .upvote(isOn: false), trailing: nil)
case .downvote: .init(value: 2, leading: .downvote(isOn: false), trailing: nil)
case .reply: .init(value: 1, leading: .reply(), trailing: nil)
case .score: .score()
case .upvote: .upvote()
case .downvote: .downvote()
case .reply: .reply()
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Mlem/App/Enums/Interaction/ReplyBarConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ struct ReplyBarConfiguration: InteractionBarConfiguration {

var appearance: CounterAppearance {
switch self {
case .score: .init(value: 7, leading: .upvote(isOn: false), trailing: .downvote(isOn: false))
case .upvote: .init(value: 9, leading: .upvote(isOn: false), trailing: nil)
case .downvote: .init(value: 2, leading: .downvote(isOn: false), trailing: nil)
case .reply: .init(value: 1, leading: .reply(), trailing: nil)
case .score: .score()
case .upvote: .upvote()
case .downvote: .downvote()
case .reply: .reply()
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion Mlem/App/Models/Action/Counter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ struct Counter: Identifiable {
.init(
value: value,
leading: leadingAction?.appearance,
trailing: trailingAction?.appearance
trailing: trailingAction?.appearance,
label: "Unknown"
)
}
}
1 change: 1 addition & 0 deletions Mlem/App/Models/Action/CounterAppearance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ struct CounterAppearance {
let value: Int?
let leading: ActionAppearance?
let trailing: ActionAppearance?
let label: LocalizedStringResource
}
29 changes: 29 additions & 0 deletions Mlem/App/Models/Action/CounterApperance+StaticValues.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// CounterApperance+StaticValues.swift
// Mlem
//
// Created by Eric Andrews on 2025-01-29.
//

extension CounterAppearance {
static func score(value: Int = 7, upvoteOn: Bool = false, downvoteOn: Bool = false) -> CounterAppearance {
.init(
value: value,
leading: .upvote(isOn: upvoteOn),
trailing: .downvote(isOn: downvoteOn),
label: "Score Counter"
)
}

static func upvote(value: Int = 9, isOn: Bool = false) -> CounterAppearance {
.init(value: value, leading: .upvote(isOn: isOn), trailing: nil, label: "Upvote Counter")
}

static func downvote(value: Int = 2, isOn: Bool = false) -> CounterAppearance {
.init(value: value, leading: .downvote(isOn: isOn), trailing: nil, label: "Downvote Counter")
}

static func reply(value: Int = 3) -> CounterAppearance {
.init(value: value, leading: .reply(), trailing: nil, label: "Reply Counter")
}
}
Loading