feat: updated flyout button to set border radius via static variable (#6838)

This commit is contained in:
Blake Thomas Williams
2023-02-10 13:17:29 -06:00
committed by GitHub
parent ddd38a411a
commit 7439a70864

View File

@@ -32,6 +32,10 @@ export class FlyoutButton {
/** The vertical margin around the text in the button. */
static TEXT_MARGIN_Y = 2;
/** The radius of the flyout button's borders. */
static BORDER_RADIUS = 4;
private readonly text_: string;
private readonly position_: Coordinate;
private readonly callbackKey_: string;
@@ -102,8 +106,8 @@ export class FlyoutButton {
shadow = dom.createSvgElement(
Svg.RECT, {
'class': 'blocklyFlyoutButtonShadow',
'rx': 4,
'ry': 4,
'rx': FlyoutButton.BORDER_RADIUS,
'ry': FlyoutButton.BORDER_RADIUS,
'x': 1,
'y': 1,
},
@@ -114,8 +118,8 @@ export class FlyoutButton {
Svg.RECT, {
'class': this.isLabel_ ? 'blocklyFlyoutLabelBackground' :
'blocklyFlyoutButtonBackground',
'rx': 4,
'ry': 4,
'rx': FlyoutButton.BORDER_RADIUS,
'ry': FlyoutButton.BORDER_RADIUS,
},
this.svgGroup_!);