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 text case changing functionality (Fixes #2390) #2426

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

zeuchie
Copy link

@zeuchie zeuchie commented Sep 27, 2024

Improvement to the Edit menu to include ability to change case. Fixes issue #2390 "Change text case".

This pull request introduces the following changes:

  1. Added a new "TextCasingUtils" class to handle text case transformations.
  2. Updated "DocumentEditAndViewFragment.java" to handle the new text case changing actions.
  3. Enhanced "HighlightingEditor.java" to implement text replacement for case changes.
  4. Modified "document__edit__menu.xml" to include a new submenu for text case operations.
  5. Created a new drawable "ic_format_text_case_black_24dp.xml" for the text case menu icon.
  6. Added new strings in "strings.xml" for the UI elements related to case changing.

These changes allow users to perform the following text case operations from the Edit menu:

  • Toggle Case (Toggle all text to Uppercase or Lowercase)
  • Switch Case (Switch the text case of each character)
  • Capitalize Words (Capitalize the first letter of each word)
  • Capitalize Sentences (Capitalize the first letter of each sentence)

The new functionality respects the user's text selection, applying changes only to the selected text if a selection is active, or to the entire document if no text is selected. Please review and let me know if any changes or improvements are needed.

…tor,

addressing issue gsantner#2390. Users can now toggle case, switch case,
capitalize words, and capitalize sentences directly from the Edit menu.
@@ -477,4 +477,9 @@ work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
<string name="wont_save_min_length">Files with fewer than %d characters not saved automatically in order to prevent data loss.</string>
<string name="advanced_filtering_help"><![CDATA[<small><a href="https://www.github.com/gsantner/markor/discussions/1940">Advanced filtering syntax</a></small>]]></string>
<string name="filter">Filter</string>
<string name="text_case">Text Case</string>
<string name="toggle_case">Toggle Case</string>
Copy link
Owner

@gsantner gsantner Sep 28, 2024

Choose a reason for hiding this comment

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

Thanks,

Suggestion, put a example at each like
AbC -> aBc

Abc -> ABC

Copy link
Author

@zeuchie zeuchie Sep 28, 2024

Choose a reason for hiding this comment

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

Hello, in which file should I add the examples? Should I add them into TextCasingUtils.java, DocumentEditAndViewFragment.java, or HighlightingEditor.java?

Copy link
Owner

Choose a reason for hiding this comment

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

Display text (strings.xml)

Copy link
Author

Choose a reason for hiding this comment

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

Oh I see, thank you. I added an example to the display text of each text case now.

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