-
Notifications
You must be signed in to change notification settings - Fork 431
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
[#212] Remove extra white-space in PersonListCard #213
Conversation
Click here to submit a new iteration when this PR is ready for review. See this repository's contribution guide for more information. |
v1@baskargopinath submitted v1 for review.
Checkout this PR version locallygit fetch https://github.com/se-edu/addressbook-level3.git refs/pr/213/1/head:BRANCHNAME where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, @baskargopinath
Can you update the commit message to be more detailed, as per the convention given in https://se-education.org/guides/conventions/git.html ?
You can also check a few previous commits to see the level of details AB3 commits usually have.
The commit message can also explain how 5
-> 0.5
results in a UI change of double-space to single-space (as that is not immediately obvious).
okay prof @damithc i have updated the commit msg based on the specification |
|
v2@baskargopinath submitted v2 for review.
(📚 Archive) (📈 Interdiff between v1 and v2) (📈 Range-Diff between v1 and v2) Checkout this PR version locallygit fetch https://github.com/se-edu/addressbook-level3.git refs/pr/213/2/head:BRANCHNAME where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good progress @baskargopinath
The commit message is better now. The subject can be more informative though.
Also, added a query about the change.
@@ -18,7 +18,7 @@ | |||
<padding> | |||
<Insets top="5" right="5" bottom="5" left="15" /> | |||
</padding> | |||
<HBox spacing="5" alignment="CENTER_LEFT"> | |||
<HBox spacing="0.5" alignment="CENTER_LEFT"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still curious how changing 5 -> 0.5 results in halving of the spacing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spacing
attribute in the HBox only affects the horizontal space between the direct child elements of the HBox, not the spacing within the content of those child elements. In your case, the HBox contains two Label elements: one for the ID and one for the name. The spacing
attribute adjusts the space between these two Label elements, not the space between characters within the text of each Label.
-
HBox Spacing: The
spacing="0.5"
in the HBox affects the space between its direct children, which are the Label elements withfx:id="id"
andfx:id="name"
. This means it reduces the space between the ID and the name labels. -
Text Content: The spacing within the text content of a Label (such as spaces between words or characters) is not affected by the HBox’s
spacing
attribute. This spacing is managed by the text rendering engine and the font metrics, which are not controlled by the HBox. -
Effect on Layout:
- Between Labels: The reduced spacing value (
0.5
) decreases the space between the two Label elements, making them appear closer together. - Within Labels: The spacing between words or characters within the text of each Label remains unchanged because it’s controlled by the font and text properties.
- Between Labels: The reduced spacing value (
In summary, the spacing
attribute in the HBox controls the space between its child elements (the Labels), not the space within the text content of those child elements. This is why changing the spacing value only affects the distance between the ID and name labels, not the spacing within the words in the labels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this is why the spacing between words is fine but the issue was only between the index and name
(Index) [SPACE] (name)
Also the changing of the value to 0.5 is not by some exact form of calculation or formula,
it was more through reducing the value and seeing the reflected change in the UI until the reduction resulted in what looked like a halving of the space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was thinking if i should add this to the commit message body but i didnt want it to be too long
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was thinking if i should add this to the commit message body but i didnt want it to be too long
You can mention it briefly i.e., you are adjusting the spacing attribute, which determines the spacing between child elements, and the value 0.5 seems to produce the desired gap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay will do it @damithc
v3@baskargopinath submitted v3 for review. (📚 Archive) (📈 Interdiff between v2 and v3) (📈 Range-Diff between v2 and v3) Checkout this PR version locallygit fetch https://github.com/se-edu/addressbook-level3.git refs/pr/213/3/head:BRANCHNAME where |
@damithc one thing i want to ask, this change will result in the ui change so we need to update ReadMe.md but should that be done in the same PR or we should create a seperate issue and PR for that |
Yes, in the same commit. Otherwise the PR (and the commit) takes the code into an incorrect state. |
The spacing attribute for HBox in PersonListCard.fxml is set to '5', causing it to look like a double-whitespace is present in the Person List Card (e.g. 1. John) Let's reduce the spacing attribute of the HBox in PersonListCard.fxml (which determines the spacing between child elements) to 0.5, which seems to produce the desired gap, so that it looks like a single whitespace is present instead of double (e.g. 1. John).
okay makes sense |
Merged, with some minor tweaks to the commit message. |
Fixes #212
Reduced spacing between the index and name to remove the extra white-space by adjusting spacing of Hbox
Before:
After: