Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DockLabel are croped #2849

Open
seb5g opened this issue Oct 18, 2023 · 0 comments · May be fixed by #2850
Open

DockLabel are croped #2849

seb5g opened this issue Oct 18, 2023 · 0 comments · May be fixed by #2850
Labels
Dock Issues/PRs related to the dock

Comments

@seb5g
Copy link

seb5g commented Oct 18, 2023

Short description

I'm using a lot the Docks and it's super nice tools. There is however an issue with their DockLabel. Indeed the Vetical label they are inheriting from is not properly taking into account the size of the label (in particular its font size). The MaximumHeight property of the Vertical label seems always too small. As you can see below

image

when applying a qdarkstyle to it, it's even worse (and the issue come from pyqtgraph as you have hardcoded the style in the VerticalLabel class):

image

Code to reproduce

import sys
from qtpy import QtWidgets, QtCore
from pyqtgraph.dockarea import Dock, DockArea


if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)

    area = DockArea()
    dock1 = Dock('ggg lll jjj')
    dock2 = Dock('ppp, ggg, zzz')
    area.addDock(dock1)
    area.addDock(dock2, position='right')
    area.show()
    sys.exit(app.exec())

and with qdarstyle:

import sys
from qtpy import QtWidgets, QtCore
from pyqtgraph.dockarea import Dock, DockArea


if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    import qdarkstyle
    app.setStyleSheet(qdarkstyle.load_stylesheet(qdarkstyle.DarkPalette))
    area = DockArea()
    dock1 = Dock('ggg lll jjj')
    dock2 = Dock('ppp, ggg, zzz')
    area.addDock(dock1)
    area.addDock(dock2, position='right')
    area.show()
    sys.exit(app.exec())

Expected behavior

I would expect the label area to expand to let people read completely the label text

Real behavior

More or less part of the text is being cropped

Possible Patch

I had to set the MaximumHeight of the VerticalLabel to some value to solve the issue

Tested environment(s)

  • PyQtGraph version: 0.13.3
  • Qt Python binding: qtpy with PyQt5
  • Python version: 3.10.12
  • NumPy version: 1.25.2
  • Operating system: Win10
  • Installation method: pip

Additional context

@seb5g seb5g linked a pull request Oct 18, 2023 that will close this issue
6 tasks
@j9ac9k j9ac9k added the Dock Issues/PRs related to the dock label Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dock Issues/PRs related to the dock
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants