Skip to content

Improved look and feel of menu button#282

Merged
ltshb merged 7 commits intodevelopfrom
feat-menu-button-look
Nov 15, 2022
Merged

Improved look and feel of menu button#282
ltshb merged 7 commits intodevelopfrom
feat-menu-button-look

Conversation

@ltshb
Copy link
Contributor

@ltshb ltshb commented Nov 7, 2022

Removed the top corner of the open/close menu button and increase a bit spaces.

Test link

@ltshb ltshb requested review from davidoesch, jedef and pakb November 7, 2022 07:32
@jedef
Copy link
Contributor

jedef commented Nov 8, 2022

The new visual appearance of the menu button looks good to me.

It looks like the modifications in the "buttonwithmodal" component offcentered the text of the confirmation dialog.
image
The other buttons that are affected by the change still seem to look good, but I don't know if I have seen all buttons affected.

The menu in the drawing mode has also a "close menu" button that should match the style of the main menu button.
image

className = this.iconsBeforeText ? 'mt-2' : 'mb-2'
} else {
className = this.iconsBeforeText ? 'ms-1' : 'me-1'
className = this.iconsBeforeText ? 'ms-2' : 'me-2'
Copy link
Contributor

Choose a reason for hiding this comment

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

I have the impression that this pushes the text a bit off center, we should either compensate on the other side or go back to a smaller margin.
What was your goal by setting a bigger margin here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The goal is to have a margin between icon and label, not have them too close
Before:
image
After:
image

The issue also mentioned by @jedef is that the ButtonWithIcon class can be used without icon ! It is not very user friendly. I'll quickly fix this but we should consider some rework here to have the class either renamed and only used with icon. IMHO a button without icon doesn't require a component as we use bootstrap.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By the way this of center was already present, just less bigger as it used a me-1 instead of me-2.

Copy link
Contributor

Choose a reason for hiding this comment

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

the goal having a single component to manage the button was specifically to encapsulate bootstrap usage in one place, so that if we wanted to switch to something else, or tweak the design of existing buttons, it would only need a change in one place.

@ltshb ltshb force-pushed the feat-menu-button-look branch from 0ea6209 to 6b73d56 Compare November 9, 2022 10:20
@ltshb ltshb requested a review from pakb November 9, 2022 10:20
Copy link
Contributor

@jedef jedef left a comment

Choose a reason for hiding this comment

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

It seems like you have forgotten to change this button:
image

I would also suggest to define a global css class (e.g. "default-button") that includes the needed bootstrap classes "btn" and "btn-light" and use this class instead in the code. This would make the code less tightened to bootstrap, make it easier to know which button class to use when writing new code and make it easier to change the styles of all our buttons in one go if we want to.

@ltshb
Copy link
Contributor Author

ltshb commented Nov 9, 2022

@jedef the time series button is already done or is in progress by @ltkum.
Using custom classes that uses bootstrap class to decouple our code from bootstrap is good idea but require quite some effort as we would need to check the whole code, not only for buttons.

@ltshb ltshb requested a review from jedef November 9, 2022 14:05
@ltshb ltshb force-pushed the feat-menu-button-look branch from 6b73d56 to a941089 Compare November 9, 2022 14:05
@ltshb
Copy link
Contributor Author

ltshb commented Nov 9, 2022

@pakb I corrected as discussed using ps-x and pe-x for the padding.

@jedef
Copy link
Contributor

jedef commented Nov 11, 2022

@jedef the time series button is already done or is in progress by @ltkum. Using custom classes that uses bootstrap class to decouple our code from bootstrap is good idea but require quite some effort as we would need to check the whole code, not only for buttons.

Ok we can do it in another ticket then (or in multiple, among others one for the buttons, as we do not necessarily need to switch all at once). The rest looks good to me now.

@ltshb ltshb force-pushed the feat-menu-button-look branch from a941089 to 9337934 Compare November 14, 2022 09:39
@ltshb ltshb requested a review from pakb November 14, 2022 10:24
@ltshb
Copy link
Contributor Author

ltshb commented Nov 14, 2022

@pakb after rebasing to dev I did some small improvement see latest commits. I also created a ticket https://jira.swisstopo.ch/browse/BGDIINF_SB-2680 to solve the button jungle after MVP ;-)

Removed the top corner of the open/close menu button and increase a bit spaces.
…drawing menu styling

Some button without icons where using the ButtonWithIcon class and therefore
a margin to the label was added putting the text of center. To solve this
I made the icon required in the later class and changed all button that don't
have an icon to use directly bootstrap.

Also align the style of the drawing open/close menu to the one of the regular
menu.
The button had a warning and the selection was not kept.
Add some small margin in the time selector.
This button uses the PopOverButton which uses the ButtonWithIcon which had
a fixed margin for the text. The issue is that the time selector button has
no icon, therefore we don't need any margin.
This has been temporarly fixed but we need to refactor the whole application
button (see BGDIINF_SB-2680)
@ltshb ltshb force-pushed the feat-menu-button-look branch from 7e0a279 to 470039a Compare November 15, 2022 06:54
@ltshb ltshb merged commit 4826f4a into develop Nov 15, 2022
@ltshb ltshb deleted the feat-menu-button-look branch November 15, 2022 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants