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_id
str
,optional
Button identifier.
- width
int
,optional
Button width.
- height
int
,optional
Button height.
- radius
int
,optional
Button corner radius.
- bg_color
str
,optional
Button background color.
- bg_color_hover
str
,optional
Button background color when hovered.
- bg_color_pressed
str
,optional
Button background color when pressed.
- icon_color
str
,optional
Icon color.
- icon_color_hover
str
,optional
Icon color when hovered.
- icon_color_pressed
str
,optional
Icon color when pressed.
- icon_color_active
str
,optional
Active icon color.
- icon_path
str
,optional
Path to icon file.
- dark_one
str
,optional
Dark color for theming.
- context_color
str
,optional
Context color for theming.
- text_foreground
str
,optional
Text foreground color.
- is_activebool,
optional
Whether the button is active.
- btn_id
- change_style(event)[source]#
Change the button style based on the event type.
- Parameters:
- event
QEvent
Event triggering the style change.
- event
- icon_paint(qp, image, rect)[source]#
Paint the icon on the button.
- Parameters:
- qp
QPainter
QPainter object.
- image
str
Path to the icon image.
- rect
QRect
Rectangle to paint the icon within.
- qp
- is_active()[source]#
Check if the button is active.
- Returns:
- bool
True if the button is active, False otherwise.
- mousePressEvent(event)[source]#
Handle the mouse press event.
- Parameters:
- event
QEvent
Mouse press event.
- event
- mouseReleaseEvent(event)[source]#
Handle the mouse release event.
- Parameters:
- event
QEvent
Mouse release event.
- event