Skip to content
New issue

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

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

Already on GitHub? # to your account

QToolbar action with menu overlaps button text #251

Closed
stekow opened this issue Dec 17, 2020 · 6 comments
Closed

QToolbar action with menu overlaps button text #251

stekow opened this issue Dec 17, 2020 · 6 comments
Assignees
Milestone

Comments

@stekow
Copy link

stekow commented Dec 17, 2020

If an action with a QMenu is placed inside a QToolbar, then the menu button texts or icon overlaps the menu arrow (see image).
Maybe someone has a solution?

Regards,

Piotr

Describe Your Environment

  • QDarkStyle: 2.8.1
  • OS: Windows 10 64 Bit
  • Python: 2.7.15 32 Bit
  • PySide: 1.1.1

Relevant Code

import sys
import qdarkstyle
from PySide import QtGui

if __name__ == '__main__':
    app = QtGui.QApplication(sys.argv)
    app.setStyleSheet(qdarkstyle.load_stylesheet_pyside())

    mw = QtGui.QMainWindow()
    toolBar = QtGui.QToolBar(mw)
    mw.addToolBar(toolBar)

    menu = QtGui.QMenu(mw)
    menu.addAction(QtGui.QAction(u'1', menu))
    menu.addAction(QtGui.QAction(u'2', menu))
    menu.addAction(QtGui.QAction(u'3', menu))

    ac = QtGui.QAction(u'Menu action', toolBar)
    ac.setMenu(menu)
    toolBar.addAction(ac)

    mw.show()
    app.exec_()

qmenu issue

@stekow
Copy link
Author

stekow commented Dec 17, 2020

I found this quick and dirty solution:

w = toolBar.widgetForAction(ac)
w.setStyleSheet('QToolButton {padding-right:1.5em; }')

However, the problem exists in the style.

@dpizetta
Copy link
Collaborator

Hi @stekow could you check the last development version? May this was fixed. I added a menu inside the toolbar in our example, it seems to be working.

@dpizetta dpizetta self-assigned this Mar 31, 2021
@dpizetta dpizetta added this to the 3.0 milestone Mar 31, 2021
@dpizetta dpizetta added the bug label Mar 31, 2021
@stekow
Copy link
Author

stekow commented Apr 1, 2021

Hi @dpizetta with version 3.0.1 the issue is still there.

@dpizetta
Copy link
Collaborator

dpizetta commented Apr 1, 2021

@stekow have you tested in a more recent version of python/pyside? We are not supporting Python2, pyqt4, pyside1.

@stekow
Copy link
Author

stekow commented Apr 1, 2021

@stekow have you tested in a more recent version of python/pyside?

No.

We are not supporting Python2, pyqt4, pyside1.

"The most complete dark/light style sheet for Qt applications (Qt4, Qt5, PySide, PySide2, PyQt4, PyQt5, QtPy, PyQtGraph, Qt.Py)."

@dpizetta
Copy link
Collaborator

dpizetta commented Apr 1, 2021

I understand. If possible, try to update your environment, it seems fixed with the new version. Python 2 support ended in 2020.

image

We forgot to update the description. Since we have many new versions, we have no condition to support all of them. Tks for noticing.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants