@vitalije first provided a script to expand the toolbar in 
https://github.com/leo-editor/leo-editor/issues/407
Here is an update that works with PyQt6

"""
Expand button bar
"""

from PyQt6.QtCore import QPointF, Qt
from PyQt6.QtGui import QMouseEvent
from PyQt6.QtWidgets import QApplication

pos = QPointF(0, 0)
button = Qt.MouseButton.LeftButton
btns = Qt.MouseButton(0)
mods = Qt.KeyboardModifier(0)

# Define the event types directly without accessing them through Qt
e1 = QMouseEvent(QMouseEvent.Type.MouseButtonPress, pos, button, btns, mods)
e2 = QMouseEvent(QMouseEvent.Type.MouseButtonRelease, pos, button, btns, 
mods)

# Assuming 'c' and 'w' are already defined
for w in c.frame.iconBar.w.children():
    if w.objectName() == 'qt_toolbar_ext_button':
        QApplication.sendEvent(w, e1)
        QApplication.sendEvent(w, e2)
        break

Again thanks to Vitalije for the original script.

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/6590e9b3-9ffa-4ed8-ba38-cf403c4ed62fn%40googlegroups.com.

Reply via email to