Change orientation of docker panes in workspace layout?

There’s a particular way I’m trying to set up my workspace. I tried adding/removing/dragging dockers to every part of the window, but nothing has let me align them the way I want:

I’m not sure if this is a limitation of krita, or a limitation of qt (I think krita inherits this behaviour from qt), or a limitation of my ability to figure out this feature.

I’m open to non-gui solutions like if there’s an xml-like file I can edit to set up my workspace this way.

krita version: 4.1.7

Hi

That’s not really a “limitation” of Krita, neither from Qt.
It’s more a “choice”, because when you implement dockers, you have to choose how the corners are used (default layout as currently provided by Krita, or the layout as you need for example)

According to Qt documentation:

You can define how corners are used.
I think by default we have something like this:

setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea)

Not sure there’s an option in Krita to change it.

But it’s possible through plugin to do it.

Open a scripter and then execute:

import krita
from PyQt5.Qt import *

wHandle=Krita.instance().activeWindow().qwindow()
wHandle.setCorner(Qt.BottomRightCorner, Qt.RightDockWidgetArea)

You get what you want :slight_smile:

Wooh!
Is there a reason to use a so old version!?

I don’t remember if Krita 4.1.7 provides python API
Anyway, if there’s no real reason to stay in 4.1.7 it’s highly recommended to use 4.4.8 (5.0 is still in beta)

Grum999

2 Likes

We don’t set anything explicitly there, it’s just the defaults. In the future, we want to move to KDDockWidgets (GitHub - KDAB/KDDockWidgets: KDAB's Dock Widget Framework for Qt) which is way more flexible. But it’s not a drop-in replacement, unfortunately.

Grum999, your response had a satisfying level of detail, which met me right at my level of technical understanding, and your solution WORKED! 10/10 thank you so much!

I’m using the one bundled with my OS. Upgrading from debian 10 → 11 is non-trivial for me so I’ve been dragging my feet on it, but when I do, I will get a newer Krita for zero extra effort!

You’re welcome

yes I understand

I’ve a Debian 10 too, and I didn’t yet upgraded my OS to 11 (but more because I don’t have time and current system is working properly so I’ll do it when I’ll have time…)

But you can use appimage
Just go to official Krita download page, select AppImage for download (normally, selected by default if you’re on Linux).

Once downloaded, set appimage as executable, and it’s all, you can execute it.
You’ll have the latest official build without need to install anything or without upgrading system (because even Debian 11 which is officially available from 2021-08-14, the provided version of Krita -4.4.2- is outdated)

Grum999

Thanks to this topic, I was able to do it too!
I’m so glad I could do that too, because I wish I could.
Thank you all ! :star_struck:

I’m not a programmer, but I could copy and paste and run the script with ease!
I wanted to do the same thing on the left side, so I copied and pasted and changed “Right” to “Left” and it worked. :tada:

And I need you to tell me something. :confounded:

I would appreciate your advice. :hatching_chick: :sweat_drops:

( Using the DeepL translation )

Hi

The scripter is a solution to let users (and particularly users who made plugin) to quickly play, test, and do stuff with Krita.
As you might already see, once you’ve closed Krita, what you did on scripter is lost…

Yes :slight_smile:

In synthesis, solutions are:

  1. Most basic: save the code you made in scriper in a file
    You can save it anywhere you want on your computer, there’s no real “best place” for this it’s more a question of how you like to see stuff organized on your drive…)
    When saved, load it and execute it in scripter each time you start Krita
    Very easy for non-developers but really boring if you have to do it each time…

  2. Create a plugin
    Plugin is the best solution for that: once created and installed, plugin is executed automatically when Krita start and then, you’re not bothered to do actions manually
    What you want is “easy” to implement in a plugin (easy for someone who have some basic development skills, but for someone who never coded it could be hard to create a plugin…)
    You can follow lessons about plugin on Krita Scripting School (especially lessons related to plugins)

  3. An alternative is to go here on this topic:
    What plugins would you like to see?
    Some people are asking for ideas to create new plugin, and this one could be interesting as it’s not really difficult to implement (and technical solution was already provided, just need to embed it in a plugin with maybe, a configuration file and a user interface…)

Grum999

1 Like

I see!
Creating a plugin sounds difficult, but I’ve bookmarked " Krita Scripting School "! :notebook_with_decorative_cover:
It’s going to take some time, but I’m willing to learn!

But I thought I’d try requesting it “What plugins would you like to see?” first! :relaxed:

Thank you for your very clear answer! :laughing::sparkles:

Is this a global setting? Is it possible to use it separately for each docker?

That’s not a global settings, that’s a small tweak of current Krita’s main window.

You can’t set it for each “docker”,
It’s more “you can define which docker area (top, left, right, bottom) can use which corner (top-left, top-right, bottom-left, bottom-right)”

Grum999

I understand, I thought they could exist at the same time.
There is another question. If different workspaces use different settings, will they need to be reset when switching?

According to Qt documentation

Saves the current state of this mainwindow’s toolbars and dockwidgets. This includes the corner settings which can be set with setCorner()

Restores the state of this mainwindow’s toolbars and dockwidgets. Also restores the corner settings too.

Corner’s settings are saved/restored with workspace.
I think Krita’s configuration use default Qt saveState/restoreState methods but I can’t confirm all of this without testing.
But in theory you can have different workspace set with different corner’s settings

Grum999

1 Like

Yes I can confirm this. I now have different workspaces saved with different corner orientations. When I switch between those workspaces there is no need to do any more scripting.

However, I bookmarked this thread as a reference, for the next time I create a new workspace.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.