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 dialog message #465

Merged
merged 2 commits into from
May 5, 2024
Merged

Conversation

ssvine
Copy link
Contributor

@ssvine ssvine commented Apr 30, 2024

This PR fixes this issues:

  • In function UnicodeString WrapText(const UnicodeString & Line, int32_t MaxWidth) the MaxWidth param is not max width, actual max width is always less than that.
  • DialogMessage has edge cases when buttons go out of borders
  • A long text line that should fit the whole client area width of DialogMessage has inconsistent spacing: 1 space on the left (correct) and 2 spaces on the right (should be 1 space):
    || Long text || - before fix
    || Long text || - after fix

An example of buttons going out of borders:
before

An example of fixed dialog, that also shows correct spacing and text wrapping:
after

@michaellukashov, You should also fix test1 function in the file tests/testnetbox_02.cpp in far3-dev-tests branch:

    REQUIRE_EQUAL(3, MessageLines.GetCount());
    REQUIRE_EQUAL(L"long long long long", MessageLines.GetString(0));
    REQUIRE_EQUAL("long long long long", W2MB(MessageLines.GetString(1).c_str()));
    REQUIRE_EQUAL("long text", W2MB(MessageLines.GetString(2).c_str()));

Copy link

sonarcloud bot commented Apr 30, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@michaellukashov michaellukashov merged commit e88d2cc into michaellukashov:main May 5, 2024
2 checks passed
@ssvine ssvine deleted the fix-dialog-message branch May 5, 2024 14:24
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