MCPcopy Create free account
hub / github.com/Syncplay/syncplay / addTopLayout

Method addTopLayout

syncplay/ui/gui.py:1445–1577  ·  view source on GitHub ↗
(self, window)

Source from the content-addressed store, hash-verified

1443 self._syncplayClient.sendChat(chatText)
1444
1445 def addTopLayout(self, window):
1446 window.topSplit = self.topSplitter(Qt.Horizontal, self)
1447
1448 window.outputLayout = QtWidgets.QVBoxLayout()
1449 window.outputbox = QtWidgets.QTextBrowser()
1450 if isDarkMode: window.outputbox.document().setDefaultStyleSheet(constants.STYLE_DARK_LINKS_COLOR);
1451 window.outputbox.setReadOnly(True)
1452 window.outputbox.setTextInteractionFlags(window.outputbox.textInteractionFlags() | Qt.TextSelectableByKeyboard)
1453 window.outputbox.setOpenExternalLinks(True)
1454 window.outputbox.unsetCursor()
1455 window.outputbox.moveCursor(QtGui.QTextCursor.End)
1456 window.outputbox.insertHtml(constants.STYLE_CONTACT_INFO.format(getMessage("contact-label")))
1457 window.outputbox.moveCursor(QtGui.QTextCursor.End)
1458 window.outputbox.setCursorWidth(0)
1459 if not isMacOS(): window.outputbox.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
1460
1461 window.outputlabel = QtWidgets.QLabel(getMessage("notifications-heading-label"))
1462 window.outputlabel.setMinimumHeight(27)
1463 window.chatInput = QtWidgets.QLineEdit()
1464 window.chatInput.setMaxLength(constants.MAX_CHAT_MESSAGE_LENGTH)
1465 window.chatInput.returnPressed.connect(self.sendChatMessage)
1466 window.chatButton = QtWidgets.QPushButton(
1467 QtGui.QPixmap(resourcespath + 'email_go.png'),
1468 getMessage("sendmessage-label"))
1469 window.chatButton.pressed.connect(self.sendChatMessage)
1470 window.chatLayout = QtWidgets.QHBoxLayout()
1471 window.chatFrame = QtWidgets.QFrame()
1472 window.chatFrame.setLayout(self.chatLayout)
1473 window.chatFrame.setContentsMargins(0, 0, 0, 0)
1474 window.chatFrame.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
1475 window.chatLayout.setContentsMargins(0, 0, 0, 0)
1476 self.chatButton.setToolTip(getMessage("sendmessage-tooltip"))
1477 window.chatLayout.addWidget(window.chatInput)
1478 window.chatLayout.addWidget(window.chatButton)
1479 window.chatFrame.setMaximumHeight(window.chatFrame.sizeHint().height())
1480 window.outputFrame = QtWidgets.QFrame()
1481 window.outputFrame.setLineWidth(0)
1482 window.outputFrame.setMidLineWidth(0)
1483 if isMacOS(): window.outputLayout.setSpacing(8)
1484 window.outputLayout.setContentsMargins(0, 0, 0, 0)
1485 window.outputLayout.addWidget(window.outputlabel)
1486 window.outputLayout.addWidget(window.outputbox)
1487 window.outputLayout.addWidget(window.chatFrame)
1488 window.outputFrame.setLayout(window.outputLayout)
1489
1490 window.listLayout = QtWidgets.QVBoxLayout()
1491 window.listTreeModel = QtGui.QStandardItemModel()
1492 window.listTreeView = QtWidgets.QTreeView()
1493 window.listTreeView.setModel(window.listTreeModel)
1494 window.listTreeView.setIndentation(21)
1495 window.listTreeView.doubleClicked.connect(self.roomClicked)
1496 self.listTreeView.setContextMenuPolicy(Qt.CustomContextMenu)
1497 self.listTreeView.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
1498 self.listTreeView.customContextMenuRequested.connect(self.openRoomMenu)
1499 window.listlabel = QtWidgets.QLabel(getMessage("userlist-heading-label"))
1500 if isMacOS():
1501 window.listlabel.setMinimumHeight(21)
1502 window.sslButton = QtWidgets.QPushButton(QtGui.QPixmap(resourcespath + 'lock_green.png').scaled(14, 14),"")

Callers 1

__init__Method · 0.95

Calls 5

getMessageFunction · 0.90
isMacOSFunction · 0.90
sizeHintMethod · 0.80
createMethod · 0.80
connectMethod · 0.45

Tested by

no test coverage detected