On Tue, Apr 2, 2024 at 4:25 AM lewis <lewisn...@fastmail.com.au> wrote:
> @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 > It doesn't work for me. Where is qt_toolbar_ext_button defined?? Edward > > """ > 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 leo-editor+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/leo-editor/6590e9b3-9ffa-4ed8-ba38-cf403c4ed62fn%40googlegroups.com > <https://groups.google.com/d/msgid/leo-editor/6590e9b3-9ffa-4ed8-ba38-cf403c4ed62fn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- ----------------------------------------------------------------- Edward K. Ream: edream...@gmail.com Leo Editor: https://leo-editor.github.io/leo-editor/ <http://leoeditor.com/> ----------------------------------------------------------------- -- 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 leo-editor+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAMF8tS14thw44_zqp%3DU%2Bkq6NSO0ao1-PL%3DaFnuN%2BfJ6TL8G-jw%40mail.gmail.com.