Commit e4b2bdaf authored by Boudewijn Rempt's avatar Boudewijn Rempt

Merge branch 'master' into krita-psd-rempt

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