Waitman Gobble

irc://irc.y0m4m4.com/ Radio Puke.World Wiki OOO

2020-10-09 2:06 am

"Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks."


This page documents my mods to Krita. You can download the modified version of Krita on my GitLab resource.


note, build on FreeBSD:


Here's a to-do list of changes I'm working on.

  • [ ] When opening a document, the tool selection should not change. It currently goes to "erase" tool when opening a new document. If you are doing the same process to a dozen images, for example, it's crazy to have to go click the tool you want to use again, each time you open a file.
  • [ ] Open Image dialog to have image previews. Trying to remember a filename you want to open can be a pain if there's hundreds of files in the directory.

Initial File Preview Dialog checked in. Here's a shot of the original file dialog:


Instead of modifying KoFileDialog (the File Dialog wrapper in Krita source) I created a new widget "PreviewDialog" and only changed the File Open function in the krita main ui. They are using KoFileDialog for everything, and it's not necessary and maybe a bad idea to change the entire file dialog.

There are couple of issues: I cheated and set the filter to all files. There is an array of mimetypes in Krtia that I need to use for the Preview open file dialog, it's a TODO. Also, there are no "Shortcuts" available, which would appear on the left side of the dialog. This would be a great feature to add so it's another TODO.

Years ago I made a custom file dialog in Qt that creates thumbnails of the files so you get a preview of everything in the directory. There are issues that make it not such a great idea though. If you have a large directory of large images it will take forever and a day to generate all the thumbnails. The process has to be launched in a thread and update the view when there's progress, otherwise your open file dialog is blocking. This can be even a bigger problem on remote drives. And it's a good idea to cache the thumbnails (MS Windows does this in the "Thumbs.db") so it doesn't have to regenerate every time. But the cache has to be checked if files change or there's new files. It's quite complicated. I could go hunt down that code and try it here but the end result just isn't really worth it in my opinion. :) Having a single image preview is good enough I think. IT's way better than no preview!

Here's the new Open File Dialog.

  • [x] Fix the crazy behavior of the rectangular selection tool. There's X, Y, Width, Height in input boxes. Presently changing a value in one box totally messes up the other input box entries, even if the "lock" icon is selected. Make it quick and easy to input coordinates for the selection rectangle tool.

It appears this is fixed sometime after 4.3. I'm using 5.0 alpha and the mask/selection tool is different. Before it had "X, Y, Width, Height and Aspect Ratio" on the same panel. And If you changed a number, like the X position for example, it acted crazy and changed the width and height somewhat randomly.

Anyhow, now the selection tool has "X, Y and Aspect Ratio" and you right-click the selection and can choose to edit the position/location. It seems to be working although it's an extra step.

One thing I did notice is I put in 300 x by 300 y and the aspect ratio is .95 ? If I changed it to 1.0 then the Y size changed to 302 or something, while the X stayed 300. So there's some little bug there.

But you can also use the crop tool and type in the width, height and position, etc and it seems to work well.

Copyright 2021 Waitman Gobble. Contact