Right now I use a couple of scripts to move the angle dial widget and the zoom slider on the status bar. If I open a second document, the zoom slider goes back to the original position.
The scripts use an index to position the widgets. I imagine there is a place in the source code where the status bar is configured. Would it be a simple matter to change the layout?
I am not much of a coder, and don’t want to wade into the source with no hope of success. This is probably a RTFM type of question, and I will if someone familiar with Krita encourages me.
When you change the view, it calls removeStatusBarItem on the zoom widget and then addStatusBarItem again, which puts it at the end. The easiest fix would probably to just wrap the zoom widget into another, empty widget that remains a fixture on the status bar. However, that might break the scripts you’re using, depending on how they identify the stuff they move around, so the alternative would be to somehow remember and restore the index when removing and adding that widget.
I read the page you linked in your post. Sort of. I learned programming mid ‘90s, Assembler, Cobol, Basic, C, just a little before OOP became the norm. Could never get my head around OOP, which explains why I went back to construction as a living.
I was hoping the setup of the status bar would be simple, but it appears that simple only applies to my mind. lol
I think a good work around for my “problem” is to open another instance of Krita if I want more than one document open.
Only a little bit, there is the Krita Scripting School but it cannot cover everything and it even says to read example scripts and plugins to learn from. I use copilot for all my python/pyqt questions, and gemini to make scripts/plugins.
I think the proper way to go is to find a signal like one that is emitted every time the view changes, there are some emitted by the Notifier. It’s only got a few signals and doesn’t include the view changing without something being opened/closed. I believe a reliable one comes from a QMdiArea widget, the signal is subWindowActivated(QMdiSubWindow).
You didn’t mention Python Plugin developer Tools in your post, so if you are not using it already it will be very useful.
There is a much simpler alternative, and that’s just to have a timer constantly running to adjust your UI, check for the expected sequences of widget indexes, names, or types, and adjust it to how you want. It’s not ideal but it will get you moving.
I have the Plugin Developers tool installed. I think I might have even had a look at it. Hopefully this winter I will have time to go to scripting school and try to learn some stuff. Just installed a bunch of new windows in my house, gotta do the trim and so forth.
My original idea was to modify the status bar layout in the source and build a “custom” Krita. What I read in Drawpile’s link kind of scared me off. I could not determine how the widgets were being located, it looked like only two index numbers were in the code, assuming they actually were index numbers. The function definition (addStatusBarItem) called them “stretch”, but then the new item was appended at the end of the function.
However, I think I might have to learn to walk before I try to dance on a high wire. Imagine that!