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

Add SwiftUI window and list/window style #739

Merged
merged 10 commits into from
Dec 1, 2024
Merged

Conversation

tisfeng
Copy link
Owner

@tisfeng tisfeng commented Nov 30, 2024

@tisfeng tisfeng marked this pull request as draft November 30, 2024 14:07
AkaShark
AkaShark previously approved these changes Dec 1, 2024
Copy link
Collaborator

@AkaShark AkaShark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tisfeng
Copy link
Owner Author

tisfeng commented Dec 1, 2024

I removed StaticWindows, and replaced the AppKit window with SwiftUI window management.

Referring to this #716 (comment), I tried to unify the style of the acknowledgment navigation window, although there are still some differences.

If anyone can further improve it, feel free to modify the code.

image image

@tisfeng tisfeng marked this pull request as ready for review December 1, 2024 10:16

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (9)
  • Easydict.xcodeproj/project.pbxproj: Language not supported
  • Easydict/App/EasydictApp.swift: Language not supported
  • Easydict/App/Localizable.xcstrings: Language not supported
  • Easydict/Swift/Utility/Constants/Constants.swift: Language not supported
  • Easydict/Swift/Utility/Extensions/View/View+Builder.swift: Language not supported
  • Easydict/Swift/View/AcknowListView/AcknowListView.swift: Language not supported
  • Easydict/Swift/View/SettingView/SettingView.swift: Language not supported
  • Easydict/Swift/View/SettingView/Tabs/TabView/AboutTab.swift: Language not supported
  • Easydict/Swift/View/Windows/StaticWindows.swift: Language not supported
@Kyle-Ye
Copy link
Collaborator

Kyle-Ye commented Dec 1, 2024

The AcknowList we are using now is a List under the hood, but it does not give a customizable Item. The only thing we can modify is to add a modifier related to List outside. (Currently we are adding a sidebar style to it.)

    var body: some View {
        NavigationStack {
            AcknowListSwiftUIView(acknowList: acknowList)
                .listStyle(.sidebar)
        }
        .hideWindowToolbarBackground()
        .thickMaterialWindowBackground()
    }

If this is enough for this project's customization, we can stick with it.

But if you want further customization, you can also give my AcknowKit a try (Or just copy and paste the code). (Does not support auto discovery yet.)

Examples:

image image image

Kyle-Ye
Kyle-Ye previously approved these changes Dec 1, 2024
Copy link
Collaborator

@Kyle-Ye Kyle-Ye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the StaticWindows change. And there is a UI issue I think we should fix before the merge. (Hide nav bar cause UI overlap when we scroll the content up in Acknow Window)

@tisfeng
Copy link
Owner Author

tisfeng commented Dec 1, 2024

ok, I have removed hideWindowToolbarBackground(), let's keep current acknowledgements UI.

The UI of AcknowKit looks nice, I will try it later.

@tisfeng tisfeng requested a review from Kyle-Ye December 1, 2024 12:56
Copy link
Collaborator

@Kyle-Ye Kyle-Ye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tisfeng tisfeng merged commit 024016e into dev Dec 1, 2024
5 checks passed
@tisfeng tisfeng deleted the swiftui-windows-style branch December 1, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants