def _get_clipboard_button_surf():
    """Create and return surface representing clipboard button."""

    ## text
    text_surf = render_text(text='Copy to clipboard', **NORMAL_TEXT_SETTINGS)

    ## icon

    icon_surf = Surface((20, 24)).convert()

    icon_surf.fill(HTSL_CANVAS_BG)

    _smaller_rect = icon_surf.get_rect().inflate(-8, -8)

    draw_rect(icon_surf, HTSL_CANVAS_BG, _smaller_rect)
    draw_rect(icon_surf, HTSL_GENERAL_TEXT_FG, _smaller_rect, 2)

    _smaller_rect.move_ip(4, 4)

    draw_rect(icon_surf, HTSL_CANVAS_BG, _smaller_rect)
    draw_rect(icon_surf, HTSL_GENERAL_TEXT_FG, _smaller_rect, 2)

    ## final combination

    surf = combine_surfaces(
        (text_surf, icon_surf),
        retrieve_pos_from="midright",
        assign_pos_to="midleft",
        offset_pos_by=(4, 0),
        padding=6,
        background_color=HTSL_CANVAS_BG,
    )

    draw_border(surf, color=HTSL_GENERAL_TEXT_FG, thickness=2)

    return surf
Create and return surface representing clipboard button.
nodezator/htsl/codeblock.py