Skip to content

Alt key modifier to bucket fill tool

I felt like it's useful addition to me, so i've decided to share the code to the project

Pressing the alt key modifier, when using bucket fill tool, makes it fill the entire selection without toggling the option in the tool options tab. Just a simple time (and click) saver since i tend to switch often between those two options.

I based it on how libs/ui/tool/kis_tool_select_base.h manages the different selection modes, based on a key modifier.

Test Plan

  • Open existing image (so you can quickly test if it fills the similar colours versus thew hole selection)
  • Press Bucket Fill Tool
  • Make sure that the option "Fill entire selection" in tool options tab is unchecked.
  • Press left mouse button with cursor anywhere on the canvas Expected result: it should fill only the similar colours (may depend on the tool threshold setting in the tool option tab)
  • Undo
  • Press left mouse button with cursor anywhere on the canvas while pressing alt key Expected result: it should fill whole canvas with colour (as it would with "Fill entire selection" checked)

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)

(I think there are no relevant unit tests. I wasn't able to build most recent commit from the master, because it has broken tests, that as far as i can tell are not my doing. I was able to compile and test it with 4.2.8 and, as far as i can tell, i'm not encroaching on anyone's changes)

  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.

I mean, i've read and followed https://docs.krita.org/en/untranslatable_pages/intro_hacking_krita.html as people in IRC recommended me

  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

I apologize in advance, it's my first attempt at contributing to an opensource project. I've expected to first ask around what's the proper way to write and design it, but i was informed i'm supposed to just submit the code.

Edited by Kuntal Majumder

Merge request reports

Loading