MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / start_hyperlink_placement

Method start_hyperlink_placement

SLiCAP/schematic/canvas.py:573–594  ·  view source on GitHub ↗
(self, url: str, label: str)

Source from the content-addressed store, hash-verified

571 self.placing_started.emit()
572
573 def start_hyperlink_placement(self, url: str, label: str):
574 from .config import (
575 HYPERLINK_FONT_FAMILY, HYPERLINK_FONT_SIZE,
576 HYPERLINK_COLOR, HYPERLINK_UNDERLINE,
577 )
578 from PySide6.QtGui import QFont, QBrush
579 self._end_wire(commit=False)
580 self._cancel_placement()
581 self._hyperlink_pending = (url, label)
582 display = label or url or "hyperlink"
583 ghost = QGraphicsSimpleTextItem(display[:50])
584 font = QFont(HYPERLINK_FONT_FAMILY, HYPERLINK_FONT_SIZE)
585 font.setUnderline(HYPERLINK_UNDERLINE)
586 ghost.setFont(font)
587 ghost.setBrush(QBrush(HYPERLINK_COLOR))
588 ghost.setOpacity(0.5)
589 ghost.setAcceptedMouseButtons(Qt.NoButton)
590 self._ghost = ghost
591 self._ghost.setPos(QPointF(-9999, -9999))
592 self.addItem(self._ghost)
593 self._mode = _Mode.PLACING_HYPERLINK
594 self.placing_started.emit()
595
596 def start_command_placement(self):
597 self._end_wire(commit=False)

Callers 1

_on_place_hyperlinkMethod · 0.80

Calls 2

_end_wireMethod · 0.95
_cancel_placementMethod · 0.95

Tested by

no test coverage detected