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 */
.button--has-prefix:not(.button--has-label) {
width: calc(var(--sl-input-height-medium) + var(--sl-input-spacing-small) * 2);
justify-content: center;
}
`,

View File

@ -638,7 +638,6 @@ export class et2_toolbar extends et2_DOMWidget implements et2_IInput
else
{
widget = <Et2Button>loadWebComponent("et2-button", {
label: action.caption,
id: `${this.id}-${action.id}`,
image: action.iconUrl || '',
slot: "buttons",
@ -659,6 +658,7 @@ export class et2_toolbar extends et2_DOMWidget implements et2_IInput
!(isCheckbox && isToggleSwitch)) // no caption for slideswitch checkboxes
{
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;
overflow: hidden;
}
.et2_toolbar_actionlist et2-button::part(prefix) {
width: 1.1em;
.et2_toolbar_actionlist et2-button::part(prefix),
.ui-toolbar-menulist et2-button::part(prefix){
width: 1.2em;
}
.et2_toolbar_actionlist et2-button.et2_toolbar_hasCaption {
width:auto;