You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just ran across the following file from lukagolibrodo. I'm not sure how useful the above would be.
#@+leo-ver=5-thin#@+node:lukagolibrodo.20210329145317.1: * @file /home/me/leo-environment/MakeIconbarMultirow.py#@@language pythonfromleo.core.leoQtimportQtWidgets, QtCore# This script make iconbar always expanded. Mainly based on this solution:#https://stackoverflow.com/questions/55930004/keep-qtoolbar-showing-always-all-itemsclasseventfilterinst(QtCore.QObject):
defeventFilter(self, obj, event):
ifevent.type() ==QtCore.QEvent.Leave: # and obj is qt_widget:returnTruereturnsuper().eventFilter(obj, event)
#first, do it immediately#@+<<hacks for iconbar>>#@+node:lukagolibrodo.20210329151339.1: ** <<hacks for iconbar>>iconbar=c.frame.iconBar.wlay=iconbar.findChild(QtWidgets.QLayout)
iflayisnotNone:
lay.setExpanded(True)
button=iconbar.findChild(QtWidgets.QToolButton, "qt_toolbar_ext_button")
ifbuttonisnotNone:
button.setFixedSize(0, 0)
ieventfilterinst=eventfilterinst()
c.frame.iconBar.w.installEventFilter(ieventfilterinst)
#@-<<hacks for iconbar>>#maybe there is some elegant solution, but if only to expand iconbar it overlaps with body and tree areas -> so just enlarge itc.frame.iconBar.w.setFixedHeight(100)
#second, register hook (if not, behavoir of iconbar reset when save)#this code may be dirty because every time new objects are createddefexpandiconbar(tag, keywords):
globalieventfilterinst#?#@+<<hacks for iconbar>>#@+node:lukagolibrodo.20210329151339.1: ** <<hacks for iconbar>>iconbar=c.frame.iconBar.wlay=iconbar.findChild(QtWidgets.QLayout)
iflayisnotNone:
lay.setExpanded(True)
button=iconbar.findChild(QtWidgets.QToolButton, "qt_toolbar_ext_button")
ifbuttonisnotNone:
button.setFixedSize(0, 0)
ieventfilterinst=eventfilterinst()
c.frame.iconBar.w.installEventFilter(ieventfilterinst)
#@-<<hacks for iconbar>>g.registerHandler('save2',expandiconbar)
g.es('fin')
#@-leo
Notes
I have never gotten QMainWindow.addToolBarBreak() to work.
The following works, but does not put the two toolbars on separate rows:
toolbar=QToolBar()
c.frame.top.addToolBar(toolbar) # c.frame.top is a `DynamicWindow`, a subclass of `QMainWindow`.
QToolBar shows a "extension" icon for large numbers of icons. Clicking this icon shows all icons on separate rows.
Summary
I have spent too much time on this issue. Somebody else will have to finish it.
The text was updated successfully, but these errors were encountered:
I just ran across the following file from lukagolibrodo. I'm not sure how useful the above would be.
Notes
I have never gotten
QMainWindow.addToolBarBreak()
to work.The following works, but does not put the two toolbars on separate rows:
QToolBar
shows a "extension" icon for large numbers of icons. Clicking this icon shows all icons on separate rows.Summary
I have spent too much time on this issue. Somebody else will have to finish it.
The text was updated successfully, but these errors were encountered: