Commit 46425980 authored by Halla Rempt's avatar Halla Rempt
Browse files

Load the imagesize "plugin"

It's no longer a real plugin, but it needs to be loaded otherwise
we cannot scale images, layers or selections.
parent 60c0e91c
......@@ -150,6 +150,10 @@ xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org
<Action name="resizeimagetolayer"/>
<Action name="resizeimagetoselection"/>
<Separator/>
<Action name="imagesize" group="image_transform_merge"/>
<Action name="imageresolution"/>
<Action name="canvassize" group="canvas_resize_merge"/>
<Separator/>
<Menu name="Rotate">
<text>&amp;Rotate</text>
<Action name="rotateimage"/>
......@@ -230,6 +234,7 @@ xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org
</Menu>
<Menu name="LayerTransform">
<text>&amp;Transform</text>
<Action name="layersize" group="layer_transform_merge"/>
<Action name="mirrorNodeX"/>
<Action name="mirrorNodeY"/>
<Action name="layersize"/>
......@@ -291,6 +296,7 @@ xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org
<Action name="reselect"/>
<Action name="invert_selection"/>
<Separator/>
<Action name="selectionscale"/>
<Action name="edit_selection"/>
<Action name="convert_to_vector_selection"/>
<Action name="convert_to_raster_selection"/>
......
......@@ -150,6 +150,7 @@
#include <katecommandbar.h>
#include "KisNodeActivationActionCreatorVisitor.h"
#include <mutex>
class ToolDockerFactory : public KoDockFactoryBase
......
......@@ -119,6 +119,7 @@
#include "dialogs/kis_delayed_save_dialog.h"
#include <KisMainWindow.h>
#include "kis_signals_blocker.h"
#include "imagesize/imagesize.h"
class BlockingUserInputEventFilter : public QObject
......@@ -308,6 +309,9 @@ KisViewManager::KisViewManager(QWidget *parent, KActionCollection *_actionCollec
d->canvasResourceProvider.setFGColor(cfg.readKoColor("LastForeGroundColor",foreground));
KoColor background(Qt::white, cs);
d->canvasResourceProvider.setBGColor(cfg.readKoColor("LastBackGroundColor",background));
// Initialize the old imagesize plugin
new ImageSize(this);
}
......
add_subdirectory( pics )
set(kritaimagesize_SOURCES
imagesize.cc
dlg_imagesize.cc
dlg_canvassize.cc
dlg_layersize.cc
kcanvaspreview.cc
)
ki18n_wrap_ui(kritaimagesize_SOURCES
wdg_imagesize.ui
wdg_canvassize.ui
wdg_layersize.ui
)
add_library(kritaimagesize MODULE ${kritaimagesize_SOURCES})
target_link_libraries(kritaimagesize kritaui)
install(TARGETS kritaimagesize DESTINATION ${KRITA_PLUGIN_INSTALL_DIR})
install( FILES imagesize.xmlgui DESTINATION ${DATA_INSTALL_DIR}/kritaplugins)
......@@ -31,11 +31,10 @@
#include "kis_action.h"
#include "kis_action_manager.h"
K_PLUGIN_FACTORY_WITH_JSON(ImageSizeFactory, "kritaimagesize.json", registerPlugin<ImageSize>();)
ImageSize::ImageSize(QObject *parent, const QVariantList &)
ImageSize::ImageSize(QObject *parent)
: KisActionPlugin(parent)
{
KisAction *action = createAction("imagesize");
connect(action, SIGNAL(triggered()), this, SLOT(slotImageSize()));
......@@ -61,7 +60,7 @@ void ImageSize::slotImageSize()
KisImageSP image = viewManager()->image().toStrongRef();
if (!image) return;
if(!viewManager()->blockUntilOperationsFinished(image)) return;
if (!viewManager()->blockUntilOperationsFinished(image)) return;
DlgImageSize * dlgImageSize = new DlgImageSize(viewManager()->mainWindow(), image->width(), image->height(), image->yRes());
Q_CHECK_PTR(dlgImageSize);
......
......@@ -17,7 +17,7 @@ class ImageSize : public KisActionPlugin
{
Q_OBJECT
public:
ImageSize(QObject *parent, const QVariantList &);
ImageSize(QObject *parent);
~ImageSize() override;
private:
......
{
"Id": "Image Resize and Scale Plugin",
"Type": "Service",
"X-KDE-Library": "kritaimagesize",
"X-KDE-ServiceTypes": [
"Krita/ViewPlugin"
],
"X-Krita-Version": "28"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment