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

🐞 Bug Report: The shortcut keys in the popup menu item are misaligned. #298

Closed
4 tasks done
phlpsong opened this issue Jan 3, 2024 · 10 comments
Closed
4 tasks done
Assignees
Labels
bug Something isn't working fixed in next release The issue will be closed once next release is available

Comments

@phlpsong
Copy link
Collaborator

phlpsong commented Jan 3, 2024

Please confirm the following:

  • I have carefully read the README
  • I have searched through the issues page but couldn't find a solution.(Including issue that has been closed)
  • Easydict has been upgraded to the latest version

Problem description

The shortcut keys like ⌘Q in the popup menu item are misaligned.

Reproduction steps

Open the status bar icon, and check the menu item.

Screenshot

Screenshot 2024-01-03 at 15 15 18

Expected result

Aligned well

Proposed solution (optional)

No response

Device type and OS version

MacOS 14.2.1, Easydict 2.4.1

Are you willing to submit a PR to fix this issue?

  • I'm willing to submit a PR
@phlpsong phlpsong added the bug Something isn't working label Jan 3, 2024
Copy link

github-actions bot commented Jan 3, 2024

Hello phlpsong, Thank you for your first issue contribution 🎉

@phlpsong phlpsong changed the title 🐞 Bug Report: 🐞 Bug Report: The shortcut keys in the popup menu item are misaligned. Jan 3, 2024
@tisfeng
Copy link
Owner

tisfeng commented Jan 3, 2024

看了,但没看懂,⌘Q 快捷键有问题?

@phlpsong
Copy link
Collaborator Author

phlpsong commented Jan 3, 2024

截屏2024-01-03 20 29 29

As you can see in the screenshot, and Q are not aligned vertically right. Other shortcut keys are the same.

@tisfeng
Copy link
Owner

tisfeng commented Jan 3, 2024

我是真没看懂哪个地方有问题 😓

⌘ 和 Q 也没有要垂直右对齐,最主要的是,这里并没有自定义布局,而是用的系统的 NSMenuItem,快捷键也就设置了一下 keyEquivalent

image

@phlpsong
Copy link
Collaborator Author

phlpsong commented Jan 3, 2024

The menu item in the storyboard is fine. You can check and compare the screenshot in ReadMe with the current appearance.

I believe It's a side effect of the function increaseMenuItemHeight in EZMenuItemManager.

@phlpsong
Copy link
Collaborator Author

phlpsong commented Jan 3, 2024

I tried to use another workaround in increaseMenuItemHeight, which could fix this issue.

After change:

截屏2024-01-03 20 57 28

Viewed in Hierarchy View tool:
截屏2024-01-03 21 00 12

@tisfeng
Copy link
Owner

tisfeng commented Jan 3, 2024

明白了,这里确实有问题,可能我是看习惯了,一下都没注意到快捷键 ⌘ 和 Q 顶部居然没对齐 😢

可以的,那你修复一下吧。

image image

phlpsong added a commit to phlpsong/Easydict that referenced this issue Jan 3, 2024
tisfeng added a commit that referenced this issue Jan 3, 2024
* fix: issue #298 menu item alignment issue

* fix: update format

* Update Easydict/Feature/StatusItem/EZMenuItemManager.m

Co-authored-by: Tisfeng <tisfeng@gmail.com>

---------

Co-authored-by: Tisfeng <tisfeng@gmail.com>
@phlpsong phlpsong closed this as completed Jan 3, 2024
@tisfeng tisfeng added the fixed in next release The issue will be closed once next release is available label Jan 3, 2024
@tisfeng
Copy link
Owner

tisfeng commented Jan 3, 2024

这种只合并了 PR 但还未发布新版本的 issue 一般不用手动关闭, 我会在后面发新版本时统一关闭,不然可能会让其他用户产生误解。

@tisfeng tisfeng reopened this Jan 3, 2024
@phlpsong
Copy link
Collaborator Author

phlpsong commented Jan 3, 2024

OK, got it.

@tisfeng
Copy link
Owner

tisfeng commented Jan 5, 2024

2.5.0 版本已修复该问题。

@tisfeng tisfeng closed this as completed Jan 5, 2024
tisfeng added a commit that referenced this issue Jan 6, 2024
* fix: issue #298 menu item alignment issue

* fix: update format

* Update Easydict/Feature/StatusItem/EZMenuItemManager.m

Co-authored-by: Tisfeng <tisfeng@gmail.com>

---------

Co-authored-by: Tisfeng <tisfeng@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next release The issue will be closed once next release is available
Projects
None yet
Development

No branches or pull requests

2 participants