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

Images not aligned properly in Expand Bar #1527

Conversation

ShahzaibIbrahim
Copy link
Contributor

When adding image larger than the header size in expand bar, it was drawn outside of the bar on the top. This was due to wrong calculation and mixing of points and pixels.

HOW TO TEST

  • Go to ExpandBarTab class and set any larger image on item

  • Run the ControlExample with the following VM Arguments

-Dswt.autoScale=quarter
-Dswt.autoScale.updateOnRuntime=true
  • Switch to the tab "Expand Items"
  • See if the image is within the bounds of the bar/header

SCREENSHOTS

Before Fix:
image

After Fix:
image

Copy link
Contributor

github-actions bot commented Oct 10, 2024

Test Results

   483 files  ±0     483 suites  ±0   8m 4s ⏱️ - 1m 29s
 4 095 tests ±0   4 085 ✅ ±0   7 💤 ±0  3 ❌ ±0 
16 173 runs  ±0  16 080 ✅ ±0  90 💤 ±0  3 ❌ ±0 

For more details on these failures, see this check.

Results for commit 377d3eb. ± Comparison against base commit d59358c.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

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

The code looks quite good and it's easy to understand (just one minor nit-pick), but I tested it and found an issue.

How to reproduce

  • Change the second image of org.eclipse.swt.examples.controlexample.ControlExample.imageLocations from openFolder.gif to some other image that is way bigger (e.g. 300 x 300 or more)
  • Run the ControlsExample and go to the ExpandBar
  • Expand the upper section: "What is your favorite button?"

The text of the second section (1) and its image (2) are still in the same place as before but they should be moved a bit lower.

image

I can't reproduce this error on master, I mean the text is still too low but it will be moved accordingly when expanding/collapsing the first section:

image

@ShahzaibIbrahim ShahzaibIbrahim force-pushed the Master127-ExpandBar-NonDpi-Issue branch 2 times, most recently from 8aeba54 to 1668418 Compare November 1, 2024 10:46
Copy link
Contributor

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

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

Thank you for fixing the issue, @ShahzaibIbrahim ! I tested again and I only have 2 comments about changes that need to be reverted.

I would also change the first line of the commit text to Properly align big images in ExpandBar.

Once that is fixed, the PR is good to go on my account.

@fedejeanne fedejeanne dismissed their stale review November 5, 2024 07:57

The bug I discovered has been fixed. The rest is not a show stopper

@ShahzaibIbrahim ShahzaibIbrahim force-pushed the Master127-ExpandBar-NonDpi-Issue branch 2 times, most recently from 4fe7f0c to 18f657f Compare November 5, 2024 09:52
@ShahzaibIbrahim ShahzaibIbrahim force-pushed the Master127-ExpandBar-NonDpi-Issue branch 2 times, most recently from 967e456 to 24debb2 Compare November 5, 2024 14:54
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

The recent changes have properly addressed my comment. In my opinion, the selected margin looks good:
image

And adding this margin does also not change exististing layout (i.e., does not unnecessarily introduce additional margins), at least when taking a look at the ControlExample (left is existing, right is with this PR):
image

I have just one remaining comment.

@ShahzaibIbrahim ShahzaibIbrahim force-pushed the Master127-ExpandBar-NonDpi-Issue branch 2 times, most recently from 6c14f5f to 8f576a1 Compare November 5, 2024 15:47
@HeikoKlare HeikoKlare force-pushed the Master127-ExpandBar-NonDpi-Issue branch from 8f576a1 to 290e677 Compare November 5, 2024 17:04
When adding image larger than the header size in expand bar, it was
drawn outside of the bar on the top. This was due to wrong calculation
and mixing of points and pixels
@HeikoKlare HeikoKlare force-pushed the Master127-ExpandBar-NonDpi-Issue branch from 290e677 to 377d3eb Compare November 5, 2024 17:18
@HeikoKlare
Copy link
Contributor

Test failures unrelated and documented: #1564

@HeikoKlare HeikoKlare merged commit df66a8b into eclipse-platform:master Nov 5, 2024
12 of 14 checks passed
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.

Images not aligned properly in Expand Bar
3 participants