From bc42d625fc2c5000386d16084632f95eef7f97cd Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 16 Sep 2021 09:17:44 -0400 Subject: [PATCH] Make labels expand by default --- piker/ui/_label.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/piker/ui/_label.py b/piker/ui/_label.py index c9a0b2a0..a0081a48 100644 --- a/piker/ui/_label.py +++ b/piker/ui/_label.py @@ -23,7 +23,7 @@ from typing import Callable, Optional, Any import pyqtgraph as pg from PyQt5 import QtGui, QtWidgets -from PyQt5.QtWidgets import QLabel +from PyQt5.QtWidgets import QLabel, QSizePolicy from PyQt5.QtCore import QPointF, QRectF, Qt from ._style import ( @@ -269,8 +269,11 @@ class FormatLabel(QLabel): self.setTextFormat(Qt.MarkdownText) # markdown self.setMargin(0) - self.setAlignment( - Qt.AlignVCenter + self.setSizePolicy( + QSizePolicy.Expanding, + QSizePolicy.Expanding, + ) + self.setAlignment(Qt.AlignVCenter | Qt.AlignLeft ) self.setText(self.fmt_str)