Show player slots in the overview.

This commit is contained in:
Dan Albert
2020-10-09 18:23:43 -07:00
parent 2d8c8c63c9
commit 1fa18447e1
8 changed files with 177 additions and 23 deletions

View File

@@ -1,4 +1,6 @@
"""A layout containing a widget with an associated label."""
from typing import Optional
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QHBoxLayout, QLabel, QWidget
@@ -10,8 +12,13 @@ class QLabeledWidget(QHBoxLayout):
label is used to name the input.
"""
def __init__(self, text: str, widget: QWidget) -> None:
def __init__(self, text: str, widget: QWidget,
tooltip: Optional[str]) -> None:
super().__init__()
self.addWidget(QLabel(text))
label = QLabel(text)
self.addWidget(label)
self.addStretch()
self.addWidget(widget, alignment=Qt.AlignRight)
if tooltip is not None:
label.setToolTip(tooltip)
widget.setToolTip(tooltip)