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 ExListView group header collapse-expand button #5428

Merged
merged 1 commit into from
Sep 16, 2018
Merged

fix ExListView group header collapse-expand button #5428

merged 1 commit into from
Sep 16, 2018

Conversation

NikolayXHD
Copy link
Member

@NikolayXHD NikolayXHD commented Sep 14, 2018

Fixes #5427
Fixes #5332 (not clickable part)
Fixes #4886

image

Has been tested on

  • Windows 7

@codecov
Copy link

codecov bot commented Sep 15, 2018

Codecov Report

Merging #5428 into master will decrease coverage by 0.01%.
The diff coverage is 11.76%.

@@            Coverage Diff             @@
##           master    #5428      +/-   ##
==========================================
- Coverage   35.35%   35.33%   -0.02%     
==========================================
  Files         604      605       +1     
  Lines       45977    45996      +19     
  Branches     6273     6279       +6     
==========================================
- Hits        16256    16254       -2     
- Misses      28973    28994      +21     
  Partials      748      748

@gerhardol
Copy link
Member

No regression, but not expected:
The button is not visible if width is smaller than the listview size.

image

bool IsCustomDraw(Message msg)
{
var nmhdr = (NativeMethods.NMHDR)msg.GetLParam(typeof(NativeMethods.NMHDR));
bool isCustomDraw = nmhdr.code == -12;
Copy link
Member

Choose a reason for hiding this comment

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

what is this magic "-12" number?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, I was wandering it myself, when I saw it :) Some 15 minutes of googling did not help me find any page with numeric values for nmhrd.code constants.

I will try again, maybe this time I'll have more luck.

-12 was there before the PR, I only moved it to a separate method to make switch-case more compact.

Copy link
Member Author

Choose a reason for hiding this comment

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

https://www.pinvoke.net/default.aspx/Constants.NM_

public const int NM_CUSTOMDRAW = NM_FIRST - 12;

Copy link
Member

Choose a reason for hiding this comment

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

Great, thank you

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

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

[EDIT] retracting the review

@NikolayXHD
Copy link
Member Author

NikolayXHD commented Sep 16, 2018

@RussKie I successfully reproduced both issues on current master build.
Just replace click on expand / collapse button by dobule click on group header.

To be more specific:

  1. Set truncate long filename setting to None
  2. resize file status panel to the size when horizontal scroll appears
  3. move scroll to the right (not necessarily rightmost) position
  4. [optional] double-click group header twice to collapse and re-expand the group
  5. resize the panel in 1 large movement, larger than the missing width created on step 2.

Result: both issues 1, 2 reproduced

Note: step 4 is optional. collapse / expand does not have to do with the issues at all.
The problem is caused by resizing the panel while the scroll is not in leftmost position

image

@RussKie
Copy link
Member

RussKie commented Sep 16, 2018

Hmm, I stand corrected, thank you for checking it.
I'll raise new issues.

@RussKie
Copy link
Member

RussKie commented Sep 16, 2018

Please rebase and I'll get it merged. Thank you

previously only double-click could collapse-expand group
@NikolayXHD
Copy link
Member Author

rebase done

@RussKie RussKie merged commit 5566d78 into gitextensions:master Sep 16, 2018
@NikolayXHD NikolayXHD deleted the fix_group_collapse branch September 16, 2018 13:00
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.

None yet

3 participants