PyLeftButton#

class ansys.aedt.toolkits.common.ui.utils.widgets.py_left_column.py_left_button.PyLeftButton(btn_id=None, width=30, height=30, radius=8, bg_color='#343b48', bg_color_hover='#3c4454', bg_color_pressed='#2c313c', icon_color='#c3ccdf', icon_color_hover='#dce1ec', icon_color_pressed='#edf0f5', icon_color_active='#f5f6f9', icon_path='no_icon.svg', dark_one='#1b1e23', context_color='#568af2', text_foreground='#8a95aa', is_active=False)[source]#

Left button widget designed to function as a left-aligned button with various style and interaction options.

Parameters:
btn_idstr, optional

Button identifier.

widthint, optional

Button width.

heightint, optional

Button height.

radiusint, optional

Button corner radius.

bg_colorstr, optional

Button background color.

bg_color_hoverstr, optional

Button background color when hovered.

bg_color_pressedstr, optional

Button background color when pressed.

icon_colorstr, optional

Icon color.

icon_color_hoverstr, optional

Icon color when hovered.

icon_color_pressedstr, optional

Icon color when pressed.

icon_color_activestr, optional

Active icon color.

icon_pathstr, optional

Path to icon file.

dark_onestr, optional

Dark color for theming.

context_colorstr, optional

Context color for theming.

text_foregroundstr, optional

Text foreground color.

is_activebool, optional

Whether the button is active.

change_style(event)[source]#

Change the button style based on the event type.

Parameters:
eventQEvent

Event triggering the style change.

enterEvent(event)[source]#

Handle the enter event.

Parameters:
eventQEvent

Enter event.

icon_paint(qp, image, rect)[source]#

Paint the icon on the button.

Parameters:
qpQPainter

QPainter object.

imagestr

Path to the icon image.

rectQRect

Rectangle to paint the icon within.

is_active()[source]#

Check if the button is active.

Returns:
bool

True if the button is active, False otherwise.

leaveEvent(event)[source]#

Handle the leave event.

Parameters:
eventQEvent

Leave event.

mousePressEvent(event)[source]#

Handle the mouse press event.

Parameters:
eventQEvent

Mouse press event.

mouseReleaseEvent(event)[source]#

Handle the mouse release event.

Parameters:
eventQEvent

Mouse release event.

paintEvent(event)[source]#

Paint the button.

Parameters:
eventQEvent

Paint event.

set_active(is_active)[source]#

Set the active state of the button.

Parameters:
is_activebool

Whether the button is active.

set_icon(icon_path)[source]#

Set the icon for the button.

Parameters:
icon_pathstr

Path to the icon image file.