Let the button with no label set and only icon be square

This commit is contained in:
Hadi Nategh 2022-08-05 16:25:39 +02:00
parent 7a3d017f10
commit 2593acf303
3 changed files with 4 additions and 4 deletions

View File

@ -101,7 +101,6 @@ export class Et2Button extends Et2InputWidget(SlButton)
/* Only image, no label */ /* Only image, no label */
.button--has-prefix:not(.button--has-label) { .button--has-prefix:not(.button--has-label) {
width: calc(var(--sl-input-height-medium) + var(--sl-input-spacing-small) * 2);
justify-content: center; justify-content: center;
} }
`, `,

View File

@ -638,7 +638,6 @@ export class et2_toolbar extends et2_DOMWidget implements et2_IInput
else else
{ {
widget = <Et2Button>loadWebComponent("et2-button", { widget = <Et2Button>loadWebComponent("et2-button", {
label: action.caption,
id: `${this.id}-${action.id}`, id: `${this.id}-${action.id}`,
image: action.iconUrl || '', image: action.iconUrl || '',
slot: "buttons", slot: "buttons",
@ -659,6 +658,7 @@ export class et2_toolbar extends et2_DOMWidget implements et2_IInput
!(isCheckbox && isToggleSwitch)) // no caption for slideswitch checkboxes !(isCheckbox && isToggleSwitch)) // no caption for slideswitch checkboxes
{ {
widget.classList.add(action.iconUrl?'et2_toolbar_hasCaption':'et2_toolbar_onlyCaption'); widget.classList.add(action.iconUrl?'et2_toolbar_hasCaption':'et2_toolbar_onlyCaption');
widget.label = action.caption;
} }
} }
} }

View File

@ -3125,8 +3125,9 @@ et2-button.transparent-button::part(container) {
width: 1em; width: 1em;
overflow: hidden; overflow: hidden;
} }
.et2_toolbar_actionlist et2-button::part(prefix) { .et2_toolbar_actionlist et2-button::part(prefix),
width: 1.1em; .ui-toolbar-menulist et2-button::part(prefix){
width: 1.2em;
} }
.et2_toolbar_actionlist et2-button.et2_toolbar_hasCaption { .et2_toolbar_actionlist et2-button.et2_toolbar_hasCaption {
width:auto; width:auto;