Commit cfc6108c authored by Boudewijn Rempt's avatar Boudewijn Rempt

actually set the pattern on the image

svn path=/trunk/koffice/; revision=971291
parent 21de2f40
......@@ -32,6 +32,8 @@
#include <kis_config.h>
#include <kis_types.h>
#include <kis_view2.h>
#include <kis_image.h>
#include <kis_paint_device.h>
#include "dlg_backgrounds.h"
......@@ -67,7 +69,7 @@ void Backgrounds::slotBackgrounds()
Q_CHECK_PTR(dlgBackgrounds);
if (dlgBackgrounds->exec() == QDialog::Accepted) {
//m_view->setBackgroundImage();
m_view->image()->setBackgroundPattern(dlgBackgrounds->background());
}
delete dlgBackgrounds;
......
......@@ -24,6 +24,8 @@
#include <kis_debug.h>
#include <kis_view2.h>
#include <kis_image.h>
#include <kis_paint_device.h>
DlgBackgrounds::DlgBackgrounds(KisView2* view)
: KDialog(view)
......@@ -42,9 +44,17 @@ DlgBackgrounds::DlgBackgrounds(KisView2* view)
DlgBackgrounds::~DlgBackgrounds()
{
delete m_page;
}
KisPaintDeviceSP DlgBackgrounds::background()
{
QImage img = m_page->lstBackgrounds->currentItem()->data(Qt::DecorationRole).value<QImage>();
KisPaintDeviceSP dev = new KisPaintDevice(m_view->image()->colorSpace());
dev->convertFromQImage(img, "");
return dev;
}
void DlgBackgrounds::applyClicked()
{
accept();
......
......@@ -22,8 +22,11 @@
#include <kdialog.h>
class KisView2;
#include <kis_types.h>
#include "wdg_backgrounds.h"
class KisView2;
/**
* This dialog allows the user to create a selection mask based
* on a (range of) colors.
......@@ -38,6 +41,8 @@ public:
DlgBackgrounds(KisView2* view);
~DlgBackgrounds();
KisPaintDeviceSP background();
private slots:
void applyClicked();
......
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