--===============7561897986985350555== Content-Type: multipart/alternative; boundary=047d7b3a829a605de305075a3ce1 --047d7b3a829a605de305075a3ce1 Content-Type: text/plain; charset=UTF-8 Okay, so I tested this. In principle this works just fine. If you want transparent, just set the background colour to transparent instead of opaque in the new file menu. However, changing projection color is still buggy: Going from white to another colour is no problem, but going from white to transparent, accept, and then trying to go from transparent to white doesn't work. It seems to apply this colour to the LAYER instead of the background, and only to tiles that carry no information(leading to alpha-channel artefacts. On Tue, Nov 4, 2014 at 2:02 PM, Boudewijn Rempt wrote: > Git commit d925d5ac2b49c1aa6bccb90ad1edff3ef8fad641 by Boudewijn Rempt. > Committed on 04/11/2014 at 12:58. > Pushed by rempt into branch 'master'. > > Set the default projection color to the selected color > > CCMAIL:kimageshop@kde.org > BUG:340216 > > We used to set the default pixel color of the first layer to the color > selected in the custom image widget. We also have a default projection > color. This change sets the color and transparency set in the custom > image widget as the default projection color. > > This has two consequences: > > * erase will now no longer show up the transparency checkers if you > use an opaque background color (which is the default) > * in order to have transparent areas in the image, you need to use > the image properties or the new image background color menu option. > > Please test and give feedback whether this is what we want, or whether > we need refining. > > Two possible issues: > > * erase still doesn't erase to the bg color selected in the toolbar; > it will erase to the bg color selected for the image > * loading, say, a jpg and using the eraser will still by default erase > to transparency checkers. We could consider making the default background > color for an image solid white... > > M +2 -1 krita/krita.rc > M +61 -16 krita/ui/forms/wdgnewimage.ui > M +1 -1 krita/ui/kis_doc2.cc > M +28 -1 krita/ui/kis_image_manager.cc > M +1 -0 krita/ui/kis_image_manager.h > > http://commits.kde.org/calligra/d925d5ac2b49c1aa6bccb90ad1edff3ef8fad641 > > diff --git a/krita/krita.rc b/krita/krita.rc > index 804ecdc..edd76fd 100644 > --- a/krita/krita.rc > +++ b/krita/krita.rc > @@ -1,6 +1,6 @@ > > > - > + > > > &File > @@ -80,6 +80,7 @@ > > &Image > > + > > > > diff --git a/krita/ui/forms/wdgnewimage.ui b/krita/ui/forms/wdgnewimage.ui > index 2fc9d3b..814bc1a 100644 > --- a/krita/ui/forms/wdgnewimage.ui > +++ b/krita/ui/forms/wdgnewimage.ui > @@ -63,7 +63,16 @@ > > > > - > + > + 0 > + > + > + 0 > + > + > + 0 > + > + > 0 > > > @@ -96,7 +105,16 @@ > > > > - > + > + 0 > + > + > + 0 > + > + > + 0 > + > + > 0 > > > @@ -138,7 +156,16 @@ > > > > - > + > + 0 > + > + > + 0 > + > + > + 0 > + > + > 0 > > > @@ -376,7 +403,7 @@ > > > > - C&anvas color: > + &Image Background Color: > > > Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter > @@ -388,14 +415,17 @@ > > > > - > + > + Reset the image background color in the Image Properties > dialog > + > + > > 255 > 255 > 255 > > > - > + > > 255 > 255 > @@ -412,14 +442,14 @@ > > > > - > - > + > + > 2 > > - > + > 1 > > - > + > 200 > > > @@ -427,7 +457,7 @@ > > > > - &Opacity: > + Image Background &Opacity: > > > Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter > @@ -446,7 +476,16 @@ > QFrame::Plain > > > - > + > + 0 > + > + > + 0 > + > + > + 0 > + > + > 0 > > > @@ -517,16 +556,22 @@ > lblDescription > txtDescription > cmbColor > - textLabel2 > - sliderOpacity > - textLabel1 > intNumLayers > label_4 > > > > > - > + > + 0 > + > + > + 0 > + > + > + 0 > + > + > 0 > > > diff --git a/krita/ui/kis_doc2.cc b/krita/ui/kis_doc2.cc > index b4949e1..b352c25 100644 > --- a/krita/ui/kis_doc2.cc > +++ b/krita/ui/kis_doc2.cc > @@ -422,6 +422,7 @@ bool KisDoc2::newImage(const QString& name, > QApplication::setOverrideCursor(Qt::BusyCursor); > > image = new KisImage(createUndoStore(), width, height, cs, name); > + image->setDefaultProjectionColor(bgColor); > Q_CHECK_PTR(image); > > connect(image.data(), SIGNAL(sigImageModified()), this, > SLOT(setImageModified())); > @@ -437,7 +438,6 @@ bool KisDoc2::newImage(const QString& name, > layer = new KisPaintLayer(image.data(), image->nextLayerName(), > bgColor.opacityU8(), cs); > Q_CHECK_PTR(layer); > > - layer->paintDevice()->setDefaultPixel(bgColor.data()); > image->addNode(layer.data(), image->rootLayer().data()); > setCurrentImage(image); > > diff --git a/krita/ui/kis_image_manager.cc b/krita/ui/kis_image_manager.cc > index 4741cb3..107228b 100644 > --- a/krita/ui/kis_image_manager.cc > +++ b/krita/ui/kis_image_manager.cc > @@ -25,7 +25,9 @@ > #include > #include > #include > +#include > > +#include > #include > #include > #include > @@ -53,6 +55,12 @@ void KisImageManager::setup(KActionCollection * > actionCollection) > action = new KAction(koIcon("document-properties"), > i18n("Properties..."), this); > actionCollection->addAction("image_properties", action); > connect(action, SIGNAL(triggered()), this, > SLOT(slotImageProperties())); > + > + action = new KAction(koIcon("format-stroke-color"), i18n("Image > Background Colorc and Transparency..."), this); > + action->setToolTip(i18n("Change the background color of the image")); > + actionCollection->addAction("image_color", action); > + connect(action, SIGNAL(triggered()), this, SLOT(slotImageColor())); > + > } > > void KisImageManager::slotImportLayerFromFile() > @@ -126,7 +134,6 @@ void KisImageManager::shearCurrentImage(double angleX, > double angleY) > void KisImageManager::slotImageProperties() > { > KisImageWSP image = m_view->image(); > - > if (!image) return; > > QPointer dlg = new > KisDlgImageProperties(image, m_view); > @@ -136,5 +143,25 @@ void KisImageManager::slotImageProperties() > delete dlg; > } > > +void KisImageManager::slotImageColor() > +{ > + KisImageWSP image = m_view->image(); > + if (!image) return; > + > + KColorDialog dlg; > + dlg.setAlphaChannelEnabled(true); > + > + KoColor bg = image->defaultProjectionColor(); > + > + dlg.setColor(bg.toQColor()); > + dlg.setButtons(KColorDialog::Ok | KColorDialog::Cancel); > + if (dlg.exec() == KColorDialog::Accepted) { > + QColor c = dlg.color(); > + bg.fromQColor(c); > + image->setDefaultProjectionColor(bg); > + image->refreshGraphAsync(); > + } > +} > + > > #include "kis_image_manager.moc" > diff --git a/krita/ui/kis_image_manager.h b/krita/ui/kis_image_manager.h > index eaedb61..bafe9f3 100644 > --- a/krita/ui/kis_image_manager.h > +++ b/krita/ui/kis_image_manager.h > @@ -60,6 +60,7 @@ public slots: > void rotateCurrentImage(double radians); > void shearCurrentImage(double angleX, double angleY); > void slotImageProperties(); > + void slotImageColor(); > > private: > KisView2 * m_view; > _______________________________________________ > Krita mailing list > kimageshop@kde.org > https://mail.kde.org/mailman/listinfo/kimageshop > -- Wolthera --047d7b3a829a605de305075a3ce1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Okay, so I tested this.

In principl= e this works just fine. If you want transparent, just set the background co= lour to transparent instead of opaque in the new file menu.

Ho= wever, changing projection color is still buggy: Going from white to anothe= r colour is no problem, but going from white to transparent, accept, and th= en trying to go from transparent to white doesn't work. It seems to app= ly this colour to the LAYER instead of the background, and only to tiles th= at carry no information(leading to alpha-channel artefacts.

On Tue, Nov 4, 2014 at = 2:02 PM, Boudewijn Rempt <boud@valdyas.org> wrote:
Git commit d925d5ac2b49c1aa6bccb90ad1edff3ef8fad641= by Boudewijn Rempt.
Committed on 04/11/2014 at 12:58.
Pushed by rempt into branch 'master'.

Set the default projection color to the selected color

CCMAIL:kimageshop@kde.org
BUG:340216

We used to set the default pixel color of the first layer to the color
selected in the custom image widget. We also have a default projection
color. This change sets the color and transparency set in the custom
image widget as the default projection color.

This has two consequences:

* erase will now no longer show up the transparency checkers if you
use an opaque background color (which is the default)
* in order to have transparent areas in the image, you need to use
the image properties or the new image background color menu option.

Please test and give feedback whether this is what we want, or whether
we need refining.

Two possible issues:

* erase still doesn't erase to the bg color selected in the toolbar; it will erase to the bg color selected for the image
* loading, say, a jpg and using the eraser will still by default erase
to transparency checkers. We could consider making the default background color for an image solid white...

M=C2=A0 +2=C2=A0 =C2=A0 -1=C2=A0 =C2=A0 krita/krita.rc
M=C2=A0 +61=C2=A0 =C2=A0-16=C2=A0 =C2=A0krita/ui/forms/wdgnewimage.ui
M=C2=A0 +1=C2=A0 =C2=A0 -1=C2=A0 =C2=A0 krita/ui/kis_doc2.cc
M=C2=A0 +28=C2=A0 =C2=A0-1=C2=A0 =C2=A0 krita/ui/kis_image_manager.cc
M=C2=A0 +1=C2=A0 =C2=A0 -0=C2=A0 =C2=A0 krita/ui/kis_image_manager.h

http://commits.kde.org/calligra/d925d5ac2b49c1a= a6bccb90ad1edff3ef8fad641

diff --git a/krita/krita.rc b/krita/krita.rc
index 804ecdc..edd76fd 100644
--- a/krita/krita.rc
+++ b/krita/krita.rc
@@ -1,6 +1,6 @@
=C2=A0<?xml version=3D"1.0"?>
=C2=A0<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui name=3D"Krita" version=3D"53">
+<kpartgui name=3D"Krita" version=3D"55">

=C2=A0<MenuBar>
=C2=A0 <Menu name=3D"file"><text>&amp;File</te= xt>
@@ -80,6 +80,7 @@

=C2=A0<Menu name=3D"Image"><text>&amp;Image</t= ext>
=C2=A0 =C2=A0<Action name=3D"image_properties"/>
+=C2=A0 <Action name=3D"image_color"/>
=C2=A0 =C2=A0<Action name=3D"duplicate_image"/>
=C2=A0 =C2=A0<Separator/>
=C2=A0 =C2=A0<DefineGroup name=3D"canvas_resize_merge" append= =3D"canvas_resize_merge"/>
diff --git a/krita/ui/forms/wdgnewimage.ui b/krita/ui/forms/wdgnewimage.ui<= br> index 2fc9d3b..814bc1a 100644
--- a/krita/ui/forms/wdgnewimage.ui
+++ b/krita/ui/forms/wdgnewimage.ui
@@ -63,7 +63,16 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <layout class=3D"QHBoxLayout&quo= t;>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<item>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <layout class=3D"QVBoxLay= out">
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"margin= ">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"leftMa= rgin">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<number>0</number= >
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"topMar= gin">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<number>0</number= >
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"rightM= argin">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<number>0</number= >
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"bottom= Margin">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <number>0</number= >
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</property>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<item>
@@ -96,7 +105,16 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</item>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<item>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <layout class=3D"QVBoxLay= out">
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"margin= ">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"leftMa= rgin">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<number>0</number= >
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"topMar= gin">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<number>0</number= >
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"rightM= argin">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<number>0</number= >
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"bottom= Margin">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <number>0</number= >
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</property>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<item>
@@ -138,7 +156,16 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</item>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<item>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <layout class=3D"QVBoxLay= out">
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"margin= ">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"leftMa= rgin">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<number>0</number= >
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"topMar= gin">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<number>0</number= >
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"rightM= argin">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<number>0</number= >
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"bottom= Margin">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <number>0</number= >
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</property>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<item>
@@ -376,7 +403,7 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0<item row=3D"0" column=3D"0&qu= ot;>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 <widget class=3D"QLabel" name=3D&q= uot;lblColor">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<property name=3D"text"><= br> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<string>C&amp;anvas color:<= /string>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<string>&amp;Image Background = Color:</string>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</property>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<property name=3D"alignment"= >
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <set>Qt::AlignRight|Qt::AlignTrail= ing|Qt::AlignVCenter</set>
@@ -388,14 +415,17 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0</item>
=C2=A0 =C2=A0 =C2=A0 =C2=A0<item row=3D"0" column=3D"1&qu= ot;>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 <widget class=3D"KColorButton" nam= e=3D"cmbColor">
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"color">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"toolTip"> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<string>Reset the image background= color in the Image Properties dialog</string>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 </property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"color" stdset= =3D"0">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <color>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<red>255</red>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<green>255</green>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<blue>255</blue>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </color>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</property>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"defaultColor"&g= t;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"defaultColor" s= tdset=3D"0">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <color>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<red>255</red>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<green>255</green>
@@ -412,14 +442,14 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 </widget>
=C2=A0 =C2=A0 =C2=A0 =C2=A0</item>
=C2=A0 =C2=A0 =C2=A0 =C2=A0<item row=3D"0" column=3D"3&qu= ot;>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0<widget class=3D"KIntNumInput" nam= e=3D"intNumLayers">
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"value">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0<widget class=3D"KIntNumInput" nam= e=3D"intNumLayers" native=3D"true">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"value" stdset= =3D"0">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <number>2</number>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</property>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"minimum"> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"minimum" stdset= =3D"0">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <number>1</number>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</property>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"maximum"> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 <property name=3D"maximum" stdset= =3D"0">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <number>200</number>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</property>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 </widget>
@@ -427,7 +457,7 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0<item row=3D"1" column=3D"0&qu= ot;>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 <widget class=3D"QLabel" name=3D&q= uot;lblOpacity">
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<property name=3D"text"><= br> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<string>&amp;Opacity:</stri= ng>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<string>Image Background &amp;= Opacity:</string>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</property>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<property name=3D"alignment"= >
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <set>Qt::AlignRight|Qt::AlignTrail= ing|Qt::AlignVCenter</set>
@@ -446,7 +476,16 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <enum>QFrame::Plain</enum> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</property>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<layout class=3D"QHBoxLayout"= ;>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<property name=3D"margin"&g= t;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<property name=3D"leftMargin&quo= t;>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <number>0</number>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<property name=3D"topMargin"= ;>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <number>0</number>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<property name=3D"rightMargin&qu= ot;>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <number>0</number>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<property name=3D"bottomMargin&q= uot;>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<number>0</number>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </property>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <item>
@@ -517,16 +556,22 @@
=C2=A0 =C2=A0 =C2=A0 <zorder>lblDescription</zorder>
=C2=A0 =C2=A0 =C2=A0 <zorder>txtDescription</zorder>
=C2=A0 =C2=A0 =C2=A0 <zorder>cmbColor</zorder>
-=C2=A0 =C2=A0 =C2=A0<zorder>textLabel2</zorder>
-=C2=A0 =C2=A0 =C2=A0<zorder>sliderOpacity</zorder>
-=C2=A0 =C2=A0 =C2=A0<zorder>textLabel1</zorder>
=C2=A0 =C2=A0 =C2=A0 <zorder>intNumLayers</zorder>
=C2=A0 =C2=A0 =C2=A0 <zorder>label_4</zorder>
=C2=A0 =C2=A0 =C2=A0</widget>
=C2=A0 =C2=A0 </item>
=C2=A0 =C2=A0 <item>
=C2=A0 =C2=A0 =C2=A0<layout class=3D"QHBoxLayout">
-=C2=A0 =C2=A0 =C2=A0<property name=3D"margin">
+=C2=A0 =C2=A0 =C2=A0<property name=3D"leftMargin">
+=C2=A0 =C2=A0 =C2=A0 <number>0</number>
+=C2=A0 =C2=A0 =C2=A0</property>
+=C2=A0 =C2=A0 =C2=A0<property name=3D"topMargin">
+=C2=A0 =C2=A0 =C2=A0 <number>0</number>
+=C2=A0 =C2=A0 =C2=A0</property>
+=C2=A0 =C2=A0 =C2=A0<property name=3D"rightMargin">
+=C2=A0 =C2=A0 =C2=A0 <number>0</number>
+=C2=A0 =C2=A0 =C2=A0</property>
+=C2=A0 =C2=A0 =C2=A0<property name=3D"bottomMargin">
=C2=A0 =C2=A0 =C2=A0 =C2=A0<number>0</number>
=C2=A0 =C2=A0 =C2=A0 </property>
=C2=A0 =C2=A0 =C2=A0 <item>
diff --git a/krita/ui/kis_doc2.cc b/krita/ui/kis_doc2.cc
index b4949e1..b352c25 100644
--- a/krita/ui/kis_doc2.cc
+++ b/krita/ui/kis_doc2.cc
@@ -422,6 +422,7 @@ bool KisDoc2::newImage(const QString& name,
=C2=A0 =C2=A0 =C2=A0QApplication::setOverrideCursor(Qt::BusyCursor);

=C2=A0 =C2=A0 =C2=A0image =3D new KisImage(createUndoStore(), width, height= , cs, name);
+=C2=A0 =C2=A0 image->setDefaultProjectionColor(bgColor);
=C2=A0 =C2=A0 =C2=A0Q_CHECK_PTR(image);

=C2=A0 =C2=A0 =C2=A0connect(image.data(), SIGNAL(sigImageModified()), this,= SLOT(setImageModified()));
@@ -437,7 +438,6 @@ bool KisDoc2::newImage(const QString& name,
=C2=A0 =C2=A0 =C2=A0layer =3D new KisPaintLayer(image.data(), image->nex= tLayerName(), bgColor.opacityU8(), cs);
=C2=A0 =C2=A0 =C2=A0Q_CHECK_PTR(layer);

-=C2=A0 =C2=A0 layer->paintDevice()->setDefaultPixel(bgColor.data());=
=C2=A0 =C2=A0 =C2=A0image->addNode(layer.data(), image->rootLayer().d= ata());
=C2=A0 =C2=A0 =C2=A0setCurrentImage(image);

diff --git a/krita/ui/kis_image_manager.cc b/krita/ui/kis_image_manager.cc<= br> index 4741cb3..107228b 100644
--- a/krita/ui/kis_image_manager.cc
+++ b/krita/ui/kis_image_manager.cc
@@ -25,7 +25,9 @@
=C2=A0#include <klocale.h>
=C2=A0#include <kurl.h>
=C2=A0#include <kactioncollection.h>
+#include <kcolordialog.h>

+#include <KoColor.h>
=C2=A0#include <KoIcon.h>
=C2=A0#include <KoFilterManager.h>
=C2=A0#include <KoFileDialog.h>
@@ -53,6 +55,12 @@ void KisImageManager::setup(KActionCollection * actionCo= llection)
=C2=A0 =C2=A0 =C2=A0action=C2=A0 =3D new KAction(koIcon("document-prop= erties"), i18n("Properties..."), this);
=C2=A0 =C2=A0 =C2=A0actionCollection->addAction("image_properties&q= uot;, action);
=C2=A0 =C2=A0 =C2=A0connect(action, SIGNAL(triggered()), this, SLOT(slotIma= geProperties()));
+
+=C2=A0 =C2=A0 action =3D new KAction(koIcon("format-stroke-color"= ;), i18n("Image Background Colorc and Transparency..."), this); +=C2=A0 =C2=A0 action->setToolTip(i18n("Change the background color= of the image"));
+=C2=A0 =C2=A0 actionCollection->addAction("image_color", acti= on);
+=C2=A0 =C2=A0 connect(action, SIGNAL(triggered()), this, SLOT(slotImageCol= or()));
+
=C2=A0}

=C2=A0void KisImageManager::slotImportLayerFromFile()
@@ -126,7 +134,6 @@ void KisImageManager::shearCurrentImage(double angleX, = double angleY)
=C2=A0void KisImageManager::slotImageProperties()
=C2=A0{
=C2=A0 =C2=A0 =C2=A0KisImageWSP image =3D m_view->image();
-
=C2=A0 =C2=A0 =C2=A0if (!image) return;

=C2=A0 =C2=A0 =C2=A0QPointer<KisDlgImageProperties> dlg =3D new KisDl= gImageProperties(image, m_view);
@@ -136,5 +143,25 @@ void KisImageManager::slotImageProperties()
=C2=A0 =C2=A0 =C2=A0delete dlg;
=C2=A0}

+void KisImageManager::slotImageColor()
+{
+=C2=A0 =C2=A0 KisImageWSP image =3D m_view->image();
+=C2=A0 =C2=A0 if (!image) return;
+
+=C2=A0 =C2=A0 KColorDialog dlg;
+=C2=A0 =C2=A0 dlg.setAlphaChannelEnabled(true);
+
+=C2=A0 =C2=A0 KoColor bg =3D image->defaultProjectionColor();
+
+=C2=A0 =C2=A0 dlg.setColor(bg.toQColor());
+=C2=A0 =C2=A0 dlg.setButtons(KColorDialog::Ok | KColorDialog::Cancel);
+=C2=A0 =C2=A0 if (dlg.exec() =3D=3D KColorDialog::Accepted) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 QColor c =3D dlg.color();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 bg.fromQColor(c);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 image->setDefaultProjectionColor(bg);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 image->refreshGraphAsync();
+=C2=A0 =C2=A0 }
+}
+

=C2=A0#include "kis_image_manager.moc"
diff --git a/krita/ui/kis_image_manager.h b/krita/ui/kis_image_manager.h index eaedb61..bafe9f3 100644
--- a/krita/ui/kis_image_manager.h
+++ b/krita/ui/kis_image_manager.h
@@ -60,6 +60,7 @@ public slots:
=C2=A0 =C2=A0 =C2=A0void rotateCurrentImage(double radians);
=C2=A0 =C2=A0 =C2=A0void shearCurrentImage(double angleX, double angleY); =C2=A0 =C2=A0 =C2=A0void slotImageProperties();
+=C2=A0 =C2=A0 void slotImageColor();

=C2=A0private:
=C2=A0 =C2=A0 =C2=A0KisView2 * m_view;
_______________________________________________
Krita mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop



--
Wolthera
--047d7b3a829a605de305075a3ce1-- --===============7561897986985350555== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Krita mailing list kimageshop@kde.org https://mail.kde.org/mailman/listinfo/kimageshop --===============7561897986985350555==--