...
 
Commits (3)
......@@ -670,6 +670,22 @@ void KisAssistantTool::mouseMoveEvent(KoPointerEvent *event)
m_canvas->updateCanvas();
}
void KisAssistantTool::keyPressEvent(QKeyEvent *event)
{
// When the user is in the middle of creating a new
// assistant the escape key can be used to cancel this process.
if (event->key()==Qt::Key_Escape && (m_newAssistant)) {
// Clear shared pointer to the assistant being created so
// it gets cleaned-up
m_newAssistant.clear();
m_canvas->updateCanvas();
event->accept();
} else {
event->ignore();
}
}
void KisAssistantTool::paint(QPainter& _gc, const KoViewConverter &_converter)
{
QRectF canvasSize = QRectF(QPointF(0, 0), QSizeF(m_canvas->image()->size()));
......
......@@ -73,6 +73,7 @@ public:
void continuePrimaryAction(KoPointerEvent *event) override;
void endPrimaryAction(KoPointerEvent *event) override;
void mouseMoveEvent(KoPointerEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
QWidget *createOptionWidget() override;
......
......@@ -97,6 +97,7 @@ install_pykrita_plugin(krita_script_starter)
install_pykrita_plugin(plugin_importer)
install_pykrita_plugin(mixer_slider_docker)
install_pykrita_plugin(channels2layers)
install_pykrita_plugin(photobash_images)
# if(PYTHON_VERSION_MAJOR VERSION_EQUAL 3)
# install_pykrita_plugin(cmake_utils)
......
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Last Documents Docker Manual</title>
</head>
<body>
<h1>Krita Photobash Plugin</h1>
<p>Want to see this in action? Check out the <a href="https://youtu.be/QX9jwhfpB_8)">video</a>!</p>
<p>A simple Krita Plugin that lists the images you have on a folder you specify, with the ability to filter by words in the path. </p>
<p>To use this plugin, here's what you need to do:</p>
<ul>
<li>When inside Krita, activate the docker by going to Settings > Dockers > Photobash Images, and drag it to where you want. </li>
<li>Set the references directory. This can be any folder on your drive, and inside of it you can have whatever folders you want, so you can stay organized. The plugin will search recursively throughout the folders.</li>
<li>You can filter the images by what you input on the text field. You can even use multiple words like "rocks marble", and it will show all images that have rock OR marble in the name!</li>
<li>If you have more than 9 images, you can pass to the next page by using the arrow buttons in the bottom-left corner. </li>
<li>When you have a document open, click on an image, and it will automatically create a new centered paintable layer with that image.</li>
<li>If you want to have finer control of the size of the image to be placed, you can tweak the variable of the image scale, and if you want to use the original image size, un-tick "Fit to Canvas".</li>
</ul>
</body>
</html>
from krita import *
from .photobash import *
Krita.instance().addDockWidgetFactory(DockWidgetFactory("PhotobashDocker", DockWidgetFactoryBase.DockRight, PhotobashDocker))
\ No newline at end of file
[Desktop Entry]
Type=Service
ServiceTypes=Krita/PythonPlugin
X-KDE-Library=photobash_images
X-Python-2-Compatible=false
Name=Krita Photobash Images
Comment=A plugin to fetch images from a specified folder. Very useful for photobashing!
This diff is collapsed.