Commit e4b2bdaf authored by Boudewijn Rempt's avatar Boudewijn Rempt

Merge branch 'master' into krita-psd-rempt

parents c472ecb3 a30671e9
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
#include "kis_canvas2.h" #include "kis_canvas2.h"
#include "kis_canvas_resource_provider.h" #include "kis_canvas_resource_provider.h"
#include "kis_locked_properties_proxy.h"
#include "kis_locked_properties_server.h"
#include "kis_locked_properties.h"
#include <klocale.h> #include <klocale.h>
const int STEP = 25; const int STEP = 25;
...@@ -100,6 +104,11 @@ void KisCanvasControlsManager::stepAlpha(float step) ...@@ -100,6 +104,11 @@ void KisCanvasControlsManager::stepAlpha(float step)
alpha += step; alpha += step;
alpha = qBound<qreal>(0.0, alpha, 1.0); alpha = qBound<qreal>(0.0, alpha, 1.0);
m_view->canvasBase()->resourceManager ()->setResource(KisCanvasResourceProvider::Opacity, alpha); m_view->canvasBase()->resourceManager ()->setResource(KisCanvasResourceProvider::Opacity, alpha);
if (m_view->resourceProvider()->currentPreset()->settings()->hasProperty("OpacityValue"))
m_view->resourceProvider()->currentPreset()->settings()->setProperty("OpacityValue", alpha);
KisLockedPropertiesProxy *p = KisLockedPropertiesServer::instance()->createLockedPropertiesProxy(m_view->resourceProvider()->currentPreset()->settings());
p->setProperty("OpacityValue", alpha);
} }
void KisCanvasControlsManager::increaseOpacity() void KisCanvasControlsManager::increaseOpacity()
...@@ -110,4 +119,4 @@ void KisCanvasControlsManager::increaseOpacity() ...@@ -110,4 +119,4 @@ void KisCanvasControlsManager::increaseOpacity()
void KisCanvasControlsManager::decreaseOpacity() void KisCanvasControlsManager::decreaseOpacity()
{ {
stepAlpha(-0.1f); stepAlpha(-0.1f);
} }
\ No newline at end of file
...@@ -596,7 +596,7 @@ void KisPaintopBox::slotCurrentNodeChanged(KisNodeSP node) ...@@ -596,7 +596,7 @@ void KisPaintopBox::slotCurrentNodeChanged(KisNodeSP node)
void KisPaintopBox::slotCanvasResourceChanged(int /*key*/, const QVariant& /*v*/) void KisPaintopBox::slotCanvasResourceChanged(int /*key*/, const QVariant& /*v*/)
{ {
if (m_view) { if (m_view) {
sender()->blockSignals(true); sender()->blockSignals(true);
KisPaintOpPresetSP preset = m_view->canvasBase()->resourceManager()->resource(KisCanvasResourceProvider::CurrentPaintOpPreset).value<KisPaintOpPresetSP>(); KisPaintOpPresetSP preset = m_view->canvasBase()->resourceManager()->resource(KisCanvasResourceProvider::CurrentPaintOpPreset).value<KisPaintOpPresetSP>();
if (preset && m_resourceProvider->currentPreset()->name() != preset->name()) { if (preset && m_resourceProvider->currentPreset()->name() != preset->name()) {
...@@ -815,6 +815,7 @@ void KisPaintopBox::slotVerticalMirrorChanged(bool value) ...@@ -815,6 +815,7 @@ void KisPaintopBox::slotVerticalMirrorChanged(bool value)
void KisPaintopBox::sliderChanged(int n) void KisPaintopBox::sliderChanged(int n)
{ {
m_optionWidget->blockSignals(true); m_optionWidget->blockSignals(true);
m_optionWidget->writeConfiguration(const_cast<KisPaintOpSettings*>(m_resourceProvider->currentPreset()->settings().data())); m_optionWidget->writeConfiguration(const_cast<KisPaintOpSettings*>(m_resourceProvider->currentPreset()->settings().data()));
qreal opacity = m_sliderChooser[n]->getWidget<KisDoubleSliderSpinBox>("opacity")->value(); qreal opacity = m_sliderChooser[n]->getWidget<KisDoubleSliderSpinBox>("opacity")->value();
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
BoundedTextItem::BoundedTextItem(QGraphicsItem* parent): QGraphicsTextItem(parent) BoundedTextItem::BoundedTextItem(QGraphicsItem* parent): QGraphicsTextItem(parent)
{ {
setTextInteractionFlags(Qt::TextEditorInteraction); setTextInteractionFlags(Qt::TextEditorInteraction);
setCursor(QCursor(Qt::IBeamCursor));
} }
QRectF BoundedTextItem::boundingRect() const QRectF BoundedTextItem::boundingRect() const
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <QGraphicsScene> #include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent> #include <QGraphicsSceneMouseEvent>
#include <QTextCursor> #include <QTextCursor>
#include <QTextDocument>
// //
// class ReportEntityLabel // class ReportEntityLabel
...@@ -53,7 +53,10 @@ void KoReportDesignerItemLabel::init(QGraphicsScene *scene, KoReportDesigner *d) ...@@ -53,7 +53,10 @@ void KoReportDesignerItemLabel::init(QGraphicsScene *scene, KoReportDesigner *d)
m_inlineEdit->setVisible(false); m_inlineEdit->setVisible(false);
m_inlineEdit->setFlag(ItemIsFocusable); m_inlineEdit->setFlag(ItemIsFocusable);
m_inlineEdit->setFlag(ItemIsSelectable, false); m_inlineEdit->setFlag(ItemIsSelectable, false);
m_inlineEdit->setPlainText(text()); QTextDocument *doc = new QTextDocument;
doc->setDocumentMargin(0);
doc->setPlainText(text());
m_inlineEdit->setDocument(doc);
connect(m_inlineEdit, SIGNAL(exitEditMode()), this, SLOT(exitInlineEditingMode())); connect(m_inlineEdit, SIGNAL(exitEditMode()), this, SLOT(exitInlineEditingMode()));
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "KoReportPrintRenderer.h" #include "KoReportPrintRenderer.h"
#include "renderobjects.h" #include "renderobjects.h"
#include <KoPageFormat.h> #include <KoPageFormat.h>
#include <KoDpi.h>
#include <kdebug.h> #include <kdebug.h>
#include <QPainter> #include <QPainter>
...@@ -73,6 +74,9 @@ bool KoReportPrintRenderer::render(const KoReportRendererContext &context, ORODo ...@@ -73,6 +74,9 @@ bool KoReportPrintRenderer::render(const KoReportRendererContext &context, ORODo
int toPage = context.printer->toPage(); int toPage = context.printer->toPage();
if (toPage == 0 || toPage > document->pages()) if (toPage == 0 || toPage > document->pages())
toPage = document->pages(); toPage = document->pages();
qreal scale = context.printer->resolution() / qreal(KoDpi::dpiX());
for (int copy = 0; copy < context.printer->numCopies(); copy++) { for (int copy = 0; copy < context.printer->numCopies(); copy++) {
for (int page = fromPage; page < toPage; page++) { for (int page = fromPage; page < toPage; page++) {
if (page > fromPage) if (page > fromPage)
...@@ -82,10 +86,13 @@ bool KoReportPrintRenderer::render(const KoReportRendererContext &context, ORODo ...@@ -82,10 +86,13 @@ bool KoReportPrintRenderer::render(const KoReportRendererContext &context, ORODo
if (context.printer->pageOrder() == QPrinter::LastPageFirst) if (context.printer->pageOrder() == QPrinter::LastPageFirst)
p = document->page(toPage - 1 - page); p = document->page(toPage - 1 - page);
// Render Page Objects // Render Page Objects
for (int i = 0; i < p->primitives(); i++) { for (int i = 0; i < p->primitives(); i++) {
OROPrimitive * prim = p->primitive(i); OROPrimitive * prim = p->primitive(i);
prim->setPosition(prim->position() * scale);
prim->setSize(prim->size() * scale);
//kDebug() << "Rendering object" << i << "type" << prim->type(); //kDebug() << "Rendering object" << i << "type" << prim->type();
if (prim->type() == OROTextBox::TextBox) { if (prim->type() == OROTextBox::TextBox) {
//kDebug() << "Text Box"; //kDebug() << "Text Box";
...@@ -111,7 +118,7 @@ bool KoReportPrintRenderer::render(const KoReportRendererContext &context, ORODo ...@@ -111,7 +118,7 @@ bool KoReportPrintRenderer::render(const KoReportRendererContext &context, ORODo
context.painter->drawText(rc, tb->flags(), tb->text()); context.painter->drawText(rc, tb->flags(), tb->text());
//outer line //outer line
context.painter->setPen(QPen(tb->lineStyle().lineColor, tb->lineStyle().weight, tb->lineStyle().style)); context.painter->setPen(QPen(tb->lineStyle().lineColor, tb->lineStyle().weight * scale, tb->lineStyle().style));
context.painter->drawRect(rc); context.painter->drawRect(rc);
//Reset back to defaults for next element //Reset back to defaults for next element
...@@ -121,9 +128,9 @@ bool KoReportPrintRenderer::render(const KoReportRendererContext &context, ORODo ...@@ -121,9 +128,9 @@ bool KoReportPrintRenderer::render(const KoReportRendererContext &context, ORODo
//kDebug() << "Line"; //kDebug() << "Line";
OROLine * ln = (OROLine*) prim; OROLine * ln = (OROLine*) prim;
QPointF s = ln->startPoint(); QPointF s = ln->startPoint();
QPointF e = ln->endPoint(); QPointF e = ln->endPoint() * scale;
//QPen pen ( _painter->pen() ); //QPen pen ( _painter->pen() );
QPen pen(ln->lineStyle().lineColor, ln->lineStyle().weight, ln->lineStyle().style); QPen pen(ln->lineStyle().lineColor, ln->lineStyle().weight * scale, ln->lineStyle().style);
context.painter->save(); context.painter->save();
context.painter->setRenderHint(QPainter::Antialiasing, true); context.painter->setRenderHint(QPainter::Antialiasing, true);
...@@ -191,7 +198,7 @@ bool KoReportPrintRenderer::render(const KoReportRendererContext &context, ORODo ...@@ -191,7 +198,7 @@ bool KoReportPrintRenderer::render(const KoReportRendererContext &context, ORODo
if (chk->lineStyle().style == Qt::NoPen || chk->lineStyle().weight <= 0) { if (chk->lineStyle().style == Qt::NoPen || chk->lineStyle().weight <= 0) {
context.painter->setPen(QPen(Qt::lightGray)); context.painter->setPen(QPen(Qt::lightGray));
} else { } else {
context.painter->setPen(QPen(chk->lineStyle().lineColor, chk->lineStyle().weight, chk->lineStyle().style)); context.painter->setPen(QPen(chk->lineStyle().lineColor, chk->lineStyle().weight * scale, chk->lineStyle().style));
} }
qreal ox = sz.width() / 5; qreal ox = sz.width() / 5;
......
...@@ -128,11 +128,11 @@ KoResourceLoaderThread::KoResourceLoaderThread(KoResourceServerBase * server) ...@@ -128,11 +128,11 @@ KoResourceLoaderThread::KoResourceLoaderThread(KoResourceServerBase * server)
} }
} }
} }
connect(qApp, SIGNAL(aboutToQuit()), SLOT(barrier()));
} }
KoResourceLoaderThread::~KoResourceLoaderThread() KoResourceLoaderThread::~KoResourceLoaderThread()
{ {
barrier();
} }
void KoResourceLoaderThread::run() void KoResourceLoaderThread::run()
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
*/ */
class KOWIDGETS_EXPORT KoResourceLoaderThread : public QThread { class KOWIDGETS_EXPORT KoResourceLoaderThread : public QThread {
Q_OBJECT
public: public:
/** /**
...@@ -46,7 +47,7 @@ public: ...@@ -46,7 +47,7 @@ public:
*/ */
explicit KoResourceLoaderThread(KoResourceServerBase *server); explicit KoResourceLoaderThread(KoResourceServerBase *server);
~KoResourceLoaderThread(); ~KoResourceLoaderThread();
public slots:
/** /**
* Checks whether the thread has finished loading and waits * Checks whether the thread has finished loading and waits
* until it is finished if necessary * until it is finished if necessary
......
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