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

Fix go-to-layer dialog in gcode preview #4816

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

buzzhuzz
Copy link
Contributor

"Jump to Layer" popup is not shown neither by Shift+G nor by pressing context menu.

This change fixes that bad behavior.

@buzzhuzz
Copy link
Contributor Author

<msgid "Jump to layer"> probably became obsolete as a result of this change since it is no longer found in the sources. However, I've left them in place since I don't know how to properly modify .po files.

@buzzhuzz
Copy link
Contributor Author

buzzhuzz commented Apr 1, 2024

Please hold this PR a little bit as I just found that pressing Ctrl+<NUM> to switch view causes "Jump to layer" dialog to #popup.

That was my local modifications causing this issue. Change present in this PR is good.

Copy link
Owner

@SoftFever SoftFever left a comment

Choose a reason for hiding this comment

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

Shift-G works on my machine. Can you share a bit more info?
It seems only the dialog title is changed in your commit

@buzzhuzz
Copy link
Contributor Author

buzzhuzz commented Apr 1, 2024

"Jump to layer" dialog is not shown on Linux machine and English language selected. Moreover: after pressing "Shift+G" or selecting "Jump to layer" from a context menu of layer slider, new context menu does not shown on right click on the layer slider.

Initial debugging shown that ImGui::BeginPopupModal((_u8L("Jump to layer")).c_str(), NULL, windows_flag) always returns false, even after ImGui::OpenPopup((_u8L("Jump to Layer")).c_str()); being called due to "jump to layer" dialog request.

``ImGui::OpenPopup()``` first checks if there are open modal dialog for a given window ID and fails if there are no one.

In my case, window ID calculated to the next values:

render_go_to_layer_dialog: msg 'Jump to Layer' - wndid 4d8c2558 
render_go_to_layer_dialog: msg 'Jump to layer' - wndid 8c4d0a5c

This might be related related to the current locale set in Orca: most of the languages has the same strings for "Jump to layer" and "Jump to Layer".

Locales most likely affected:

  • default (single letter case differs)
  • ES (single letter case differs)
  • TR (single letter case differs)
  • NL (no msgstr for lower case one)
  • CA (single letter case differs)
  • CS (completely different msgstr)

I'm not sure why I'm getting default locale strings instead of EN ones: my settings are set to "English" language and "Other" login region.

@buzzhuzz buzzhuzz marked this pull request as draft April 2, 2024 23:01
@buzzhuzz buzzhuzz requested a review from SoftFever April 2, 2024 23:01
@buzzhuzz buzzhuzz marked this pull request as ready for review April 4, 2024 07:13
@SoftFever
Copy link
Owner

"Jump to layer" dialog is not shown on Linux machine and English language selected. Moreover: after pressing "Shift+G" or selecting "Jump to layer" from a context menu of layer slider, new context menu does not shown on right click on the layer slider.

Initial debugging shown that ImGui::BeginPopupModal((_u8L("Jump to layer")).c_str(), NULL, windows_flag) always returns false, even after ImGui::OpenPopup((_u8L("Jump to Layer")).c_str()); being called due to "jump to layer" dialog request.

``ImGui::OpenPopup()``` first checks if there are open modal dialog for a given window ID and fails if there are no one.

In my case, window ID calculated to the next values:

render_go_to_layer_dialog: msg 'Jump to Layer' - wndid 4d8c2558 
render_go_to_layer_dialog: msg 'Jump to layer' - wndid 8c4d0a5c

This might be related related to the current locale set in Orca: most of the languages has the same strings for "Jump to layer" and "Jump to Layer".

Locales most likely affected:

  • default (single letter case differs)
  • ES (single letter case differs)
  • TR (single letter case differs)
  • NL (no msgstr for lower case one)
  • CA (single letter case differs)
  • CS (completely different msgstr)

I'm not sure why I'm getting default locale strings instead of EN ones: my settings are set to "English" language and "Other" login region.

Thanks for the explaination.
Interesting.
Seems ImGui is using case sensitive to compare the title.

Looks good
Thanks for the fix!

@SoftFever SoftFever merged commit ff5035f into SoftFever:main Apr 7, 2024
12 checks passed
@buzzhuzz buzzhuzz deleted the dbuzz/fix-go-to-layer branch April 8, 2024 03:01
powpingdone pushed a commit to powpingdone/OrcaSlicer that referenced this pull request Apr 10, 2024
powpingdone pushed a commit to powpingdone/OrcaSlicer that referenced this pull request Apr 11, 2024
SoftFever pushed a commit that referenced this pull request Apr 13, 2024
gcode-preview: fix go-to-layer dialog
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.

2 participants