>From original issue #407 - You can put that in *@button expand-toolbar* 
node in your myLeoSettings.leo under @buttons node.
If it is first child of @buttons then this button will be on left side of 
toolbar and it will be easier to click this button and then to find button 
you need. 

I confirmed it also works for me as a script using Ctrl-B.

I'm not aware of where  w.objectName() == 'qt_toolbar_ext_button'   is 
defined.
On Wednesday, April 3, 2024 at 12:26:44 AM UTC+11 Edward K. Ream wrote:

> On Tue, Apr 2, 2024 at 4:25 AM lewis <[email protected]> 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 [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
>>  
>> <https://groups.google.com/d/msgid/leo-editor/6590e9b3-9ffa-4ed8-ba38-cf403c4ed62fn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> -----------------------------------------------------------------
> Edward K. Ream: [email protected]
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/6592561b-f0e6-4b93-91d5-d5786291d79fn%40googlegroups.com.

Reply via email to