[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#594493: marked as done (unblock: merkaartor/0.16.3-1)



Your message dated Fri, 27 Aug 2010 17:29:14 +0200
with message-id <4C77D9CA.4010700@bzed.de>
and subject line merkaartor: unblocked by zobel
has caused the Debian Bug report #594493,
regarding unblock: merkaartor/0.16.3-1
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
594493: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594493
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package merkaartor, 0.16.3 is an upstream bugfix release
with the following bugfixes since 0.16.1:

    v0.16.3
        * FIX : language support broken
    v0.16.2
        * FIX : Initial viewport issue
        * FIX : Do not export incomplete features
        * FIX : CSV import bugs
        * FIX : Use "GPX track width" setting even when not in "Simple track
          appearance" (Merkaartor bug #3095)
        * FIX : temporary solution for #3082
        * CHG : Allow to pan with middle mouse button
        * FIX : lat/lon grid Merkaartor bug for non-othogonal projections
        * FIX : for non-rthogonal projections, maximize the viewport in lat/lon
        * FIX : Handle empty style list in editor (Merkaartor bug #3079)
        * FIX : Fix scale bar to take latitude into account.
        * FIX : Do not tag-match relation's children unless the type is
          "multippolygon" (Merkaartor bug #2916)
        * FIX : problem with "Bottom-left standard" TMS
        * FIX : OSX fix
        * FIX : Draw relations children dashed to avoid multiple parent drawing
        * FIX : Fix several issues with features dock.
        * FIX : Fix reappearance of deleted features.
        * FIX : Fix WayRemoveNodeCommand reversibility.

A diff between 0.16.1-1 and 0.16.3-1 is attached to this mail.

unblock merkaartor/0.16.3-1


Thanks,

Bernd

--
 Bernd Zeimetz                            Debian GNU/Linux Developer
 http://bzed.de                                http://www.debian.org
 GPG Fingerprints: 06C8 C9A2 EAAD E37E 5B2C BE93 067A AD04 C93B FF79
                   ECA1 E3F2 8E11 2432 D485 DD95 EB36 171A 6FF9 435F
diff --git a/CHANGELOG b/CHANGELOG
index 206df26..3991d7d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,26 @@
+v0.16.3
+    * FIX : language support broken
+v0.16.2
+    * FIX : Initial viewport issue
+    * FIX : Do not export incomplete features
+    * FIX : CSV import bugs
+    * FIX : Use "GPX track width" setting even when not in "Simple track appearance" (fixes #3095)
+    * FIX : temporary solution for #3082
+    * CHG : Allow to pan with middle mouse button
+    * FIX : lat/lon grid fixes for non-othogonal projections
+    * FIX : for non-rthogonal projections, maximize the viewport in lat/lon
+    * FIX : Handle empty style list in editor (fixes #3079)
+    * FIX : Fix scale bar to take latitude into account.
+    * FIX : Do not tag-match relation's children unless the type is "multippolygon" (fixes #2916)
+    * FIX : problem with "Bottom-left standard" TMS
+    * FIX : OSX fix
+    * FIX : Draw relations children dashed to avoid multiple parent drawing
+    * FIX : Fix several issues with features dock.
+    * FIX : Fix reappearance of deleted features.
+    * FIX : Fix WayRemoveNodeCommand reversibility.
 v0.16.1
+    * ADD : Allow to move complete relations
+    * FIX : First feature not OSM exported 
     * FIX : WMS'es in EPSG:4326 not showing
     * FIX : Don't overzoom on layer zoom (and don't allow if the bbox is null). fixes #3046
     * ADD : Add a "portable" mode to merkaartor via command-line ("-p") or build setting ("PORTABLE=1")
diff --git a/debian/changelog b/debian/changelog
index 3e88ae7..8fc5954 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,39 @@
+merkaartor (0.16.3-1) unstable; urgency=low
+
+  * [e9c11925] Merge branch 'upstream'
+
+    Updating to version 0.16.3 - Upstream bugfix release,
+    fixing the following bugs:
+
+    v0.16.3
+        * FIX : language support broken
+    v0.16.2
+        * FIX : Initial viewport issue
+        * FIX : Do not export incomplete features
+        * FIX : CSV import bugs
+        * FIX : Use "GPX track width" setting even when not in "Simple track
+          appearance" (Merkaartor bug #3095)
+        * FIX : temporary solution for #3082
+        * CHG : Allow to pan with middle mouse button
+        * FIX : lat/lon grid Merkaartor bug for non-othogonal projections
+        * FIX : for non-rthogonal projections, maximize the viewport in lat/lon
+        * FIX : Handle empty style list in editor (Merkaartor bug #3079)
+        * FIX : Fix scale bar to take latitude into account.
+        * FIX : Do not tag-match relation's children unless the type is
+          "multippolygon" (Merkaartor bug #2916)
+        * FIX : problem with "Bottom-left standard" TMS
+        * FIX : OSX fix
+        * FIX : Draw relations children dashed to avoid multiple parent drawing
+        * FIX : Fix several issues with features dock.
+        * FIX : Fix reappearance of deleted features.
+        * FIX : Fix WayRemoveNodeCommand reversibility.
+
+ -- Bernd Zeimetz <bzed@debian.org>  Thu, 26 Aug 2010 12:56:37 +0200
+
 merkaartor (0.16.1-1) unstable; urgency=low
 
   * [486efdb0] Merge branch 'upstream'
-    Updating to verion 0.16.1.
+    Updating to version 0.16.1.
 
  -- Bernd Zeimetz <bzed@debian.org>  Tue, 15 Jun 2010 01:13:43 +0200
 
diff --git a/src/Commands/WayCommands.cpp b/src/Commands/WayCommands.cpp
index cf9a90d..b3ea6ed 100644
--- a/src/Commands/WayCommands.cpp
+++ b/src/Commands/WayCommands.cpp
@@ -114,12 +114,12 @@ WayAddNodeCommand * WayAddNodeCommand::fromXML(Document * d, QDomElement e)
 /* ROADREMOVETRACKPOINTCOMMAND */
 
 WayRemoveNodeCommand::WayRemoveNodeCommand(Way* R)
-: Command(R), theLayer(0), oldLayer(0), Idx(0), theRoad(R), theNode(0)
+: Command(R), theLayer(0), oldLayer(0), Idx(0), wasClosed(R ? R->isClosed() : false), theRoad(R), theNode(0)
 {
 }
 
 WayRemoveNodeCommand::WayRemoveNodeCommand(Way* R, Node* W, Layer* aLayer)
-: Command(R), theLayer(aLayer), oldLayer(0), Idx(R->find(W)), theRoad(R), theNode(W)
+: Command(R), theLayer(aLayer), oldLayer(0), Idx(R->find(W)), wasClosed(R ? R->isClosed() : false), theRoad(R), theNode(W)
 {
     if (!theLayer)
         theLayer = theRoad->layer();
@@ -127,7 +127,7 @@ WayRemoveNodeCommand::WayRemoveNodeCommand(Way* R, Node* W, Layer* aLayer)
 }
 
 WayRemoveNodeCommand::WayRemoveNodeCommand(Way* R, int anIdx, Layer* aLayer)
-: Command(R), theLayer(aLayer), oldLayer(0), Idx(anIdx), theRoad(R), theNode(R->getNode(anIdx))
+: Command(R), theLayer(aLayer), oldLayer(0), Idx(anIdx), wasClosed(R ? R->isClosed() : false), theRoad(R), theNode(R->getNode(anIdx))
 {
     if (!theLayer)
         theLayer = theRoad->layer();
@@ -143,14 +143,11 @@ WayRemoveNodeCommand::~WayRemoveNodeCommand(void)
 void WayRemoveNodeCommand::undo()
 {
     Command::undo();
-    if (theRoad->isClosed()) {
-        theRoad->add(theNode,Idx);
-        if (Idx == 0) {
-            theRoad->remove(theRoad->size()-1);
-            theRoad->add(theNode);
-        }
-    } else
-        theRoad->add(theNode,Idx);
+    theRoad->add(theNode,Idx);
+    if (wasClosed && Idx == 0) {
+        theRoad->remove(theRoad->size()-1);
+        theRoad->add(theNode);
+    }
 
     if (theLayer && oldLayer && (theLayer != oldLayer)) {
         theLayer->remove(theRoad);
@@ -162,14 +159,11 @@ void WayRemoveNodeCommand::undo()
 void WayRemoveNodeCommand::redo()
 {
     oldLayer = theRoad->layer();
-    if (theRoad->isClosed()) {
-        theRoad->remove(Idx); // cannot do outside of "if" because the way wouldn't be closed anymore
-        if (Idx == 0 && theRoad->size() > 2) {
-            theRoad->remove(theRoad->size()-1);
-            theRoad->add(theRoad->getNode(0));
-        }
-    } else
-        theRoad->remove(Idx);
+    theRoad->remove(Idx);
+    if (wasClosed && Idx == 0) {
+        theRoad->remove(theRoad->size()-1);
+        theRoad->add(theRoad->getNode(0));
+    }
 
     if (theLayer && oldLayer && (theLayer != oldLayer)) {
         oldLayer->remove(theRoad);
@@ -204,6 +198,8 @@ bool WayRemoveNodeCommand::toXML(QDomElement& xParent) const
     e.setAttribute("road", theRoad->xmlId());
     e.setAttribute("trackpoint", theNode->xmlId());
     e.setAttribute("index", QString::number(Idx));
+    if (wasClosed)
+        e.setAttribute("closed", "true");
     if (theLayer)
         e.setAttribute("layer", theLayer->id());
     if (oldLayer)
@@ -226,6 +222,7 @@ WayRemoveNodeCommand * WayRemoveNodeCommand::fromXML(Document * d, QDomElement e
         a->oldLayer = d->getLayer(e.attribute("oldlayer"));
     else
         a->oldLayer = NULL;
+    a->wasClosed = (e.hasAttribute("closed") && e.attribute("closed") == "true");
     a->theRoad = Feature::getWayOrCreatePlaceHolder(d, a->theLayer, e.attribute("road"));
     a->theNode = Feature::getTrackPointOrCreatePlaceHolder(d, a->theLayer, e.attribute("trackpoint"));
     a->Idx = e.attribute("index").toUInt();
diff --git a/src/Commands/WayCommands.h b/src/Commands/WayCommands.h
index e45958f..32293a7 100644
--- a/src/Commands/WayCommands.h
+++ b/src/Commands/WayCommands.h
@@ -49,6 +49,7 @@ class WayRemoveNodeCommand : public Command
 		Layer* theLayer;
 		Layer* oldLayer;
 		int Idx;
+		bool wasClosed;
 		Way* theRoad;
 		Node* theNode;
 };
diff --git a/src/Docks/FeaturesDock.cpp b/src/Docks/FeaturesDock.cpp
index 3e7f17f..43528b1 100644
--- a/src/Docks/FeaturesDock.cpp
+++ b/src/Docks/FeaturesDock.cpp
@@ -296,11 +296,25 @@ void FeaturesDock::addItem(MapFeaturePtr F)
     }
 }
 
+void FeaturesDock::invalidate()
+{
+    ui.FeaturesList->clear();
+    Highlighted.clear();
+}
+
 void FeaturesDock::clearItems()
 {
     for(int i=ui.FeaturesList->count()-1; i>=0; --i) {
-        if (!ui.FeaturesList->item(i)->isSelected())
-            delete ui.FeaturesList->item(i);
+        QListWidgetItem* item = ui.FeaturesList->item(i);
+        if (item->isSelected()) {
+            Feature * F = item->data(Qt::UserRole).value<Feature*>();
+            if (F->isDeleted()) {
+                item->setSelected(false);
+                Highlighted.removeOne(F);
+            }
+        }
+        if (!item->isSelected())
+            delete item;
     }
 }
 
diff --git a/src/Docks/FeaturesDock.h b/src/Docks/FeaturesDock.h
index a53ecb9..a491866 100644
--- a/src/Docks/FeaturesDock.h
+++ b/src/Docks/FeaturesDock.h
@@ -53,6 +53,8 @@ public slots:
 
     void tabChanged(int idx);
 
+    void invalidate();
+
 private:
     QList<Feature*> Highlighted;
 
diff --git a/src/Document.cpp b/src/Document.cpp
index e320175..2257895 100644
--- a/src/Document.cpp
+++ b/src/Document.cpp
@@ -573,7 +573,7 @@ QString Document::exportOSM(QMainWindow* main, QList<Feature*> aFeatures)
 
     if (exportedFeatures.size()) {
         aCoordBox = exportedFeatures[0]->boundingBox();
-        aCoordBox.merge(exportedFeatures[0]->boundingBox());
+        exportedFeatures[0]->toXML(o, dlg);
         for (int i=1; i < exportedFeatures.size(); i++) {
             aCoordBox.merge(exportedFeatures[i]->boundingBox());
             exportedFeatures[i]->toXML(o, dlg);
@@ -594,7 +594,6 @@ QString Document::exportOSM(QMainWindow* main, QList<Feature*> aFeatures)
 
 QList<Feature*> Document::exportCoreOSM(QList<Feature*> aFeatures)
 {
-    QString coreExport;
     QList<Feature*> exportedFeatures;
     QList<Feature*>::Iterator i;
 
diff --git a/src/Features/Feature.cpp b/src/Features/Feature.cpp
index 0bf45f1..a88a5bb 100644
--- a/src/Features/Feature.cpp
+++ b/src/Features/Feature.cpp
@@ -264,7 +264,7 @@ void Feature::setId(const QString& id)
 
 const QString& Feature::resetId()
 {
-    p->Id = QString::number((((qint64)this) * -1));
+    p->Id = QString::number((llabs((qint64)this) * -1));
     if (parent())
         dynamic_cast<Layer*>(parent())->notifyIdUpdate(p->Id,const_cast<Feature*>(this));
     return p->Id;
@@ -274,7 +274,7 @@ const QString& Feature::id() const
 {
     if (p->Id.isEmpty())
     {
-        p->Id = QString::number((((qint64)this) * -1));
+        p->Id = QString::number((llabs((qint64)this) * -1));
         Layer* L = dynamic_cast<Layer*>(parent());
         if (L)
             L->notifyIdUpdate(p->Id,const_cast<Feature*>(this));
@@ -293,7 +293,7 @@ qint64 Feature::idToLong() const
         p->LongId = s.toLongLong(&ok);
         Q_ASSERT(ok);
     } else {
-        p->LongId = (((qint64)this) * -1);
+        p->LongId = (llabs((qint64)this) * -1);
     }
 
     return p->LongId;
@@ -694,11 +694,16 @@ void Feature::notifyParents(int Id)
 
 QString Feature::toXML(int lvl, QProgressDialog * progress)
 {
-    QDomDocument theXmlDoc;
-    QDomElement root = theXmlDoc.documentElement();
-    if (toXML(root, progress))
-        return theXmlDoc.toString(lvl);
-    else
+    QDomDocument doc;
+    QDomElement root = doc.createElement("root");
+    doc.appendChild(root);
+    if (toXML(root, progress)) {
+        QString ret;
+        QTextStream ts(&ret);
+        root.firstChild().save(ts, lvl);
+        return ret;
+//        return theXmlDoc.toString(lvl);
+    } else
         return "";
 }
 
diff --git a/src/Features/Relation.cpp b/src/Features/Relation.cpp
index 3dba680..3fe8e6a 100644
--- a/src/Features/Relation.cpp
+++ b/src/Features/Relation.cpp
@@ -76,14 +76,15 @@ Relation::~Relation()
 
 void Relation::setLayer(Layer* L)
 {
-    if (L)
+    if (L) {
         for (int i=0; i<p->Members.size(); ++i)
             if (p->Members[i].second)
                 p->Members[i].second->setParentFeature(this);
-    else
+    } else {
         for (int i=0; i<p->Members.size(); ++i)
             if (p->Members[i].second)
                 p->Members[i].second->unsetParentFeature(this);
+    }
     Feature::setLayer(L);
 }
 
@@ -122,7 +123,7 @@ CoordBox Relation::boundingBox() const
             CoordBox Clip;
             bool haveFirst = false;
             for (int i=0; i<p->Members.size(); ++i)
-                if (p->Members[i].second && !p->Members[i].second->notEverythingDownloaded() && !CAST_RELATION(p->Members[i].second)) {
+                if (p->Members[i].second && !p->Members[i].second->notEverythingDownloaded()/* && !CAST_RELATION(p->Members[i].second)*/) {
                     if (!haveFirst) {
                         Clip = p->Members[i].second->boundingBox();
                         haveFirst = true;
@@ -187,7 +188,7 @@ void Relation::drawHover(QPainter& P, MapView* theView, bool solid)
         for (int i=0; i<p->Members.size(); ++i)
             if (p->Members[i].second && !p->Members[i].second->isDeleted())
                 if (p->Members[i].second->boundingBox().intersects(theView->viewport()))
-                    p->Members[i].second->drawHover(P,theView, solid);
+                    p->Members[i].second->drawHover(P,theView, false);
 
         if (M_PREFS->getShowParents()) {
             for (int i=0; i<sizeParents(); ++i)
@@ -237,20 +238,21 @@ double Relation::pixelDistance(const QPointF& Target, double ClearEndDistance, b
     //	}
     //}
 
+
     double D;
-    QRectF bb = QRectF(theView->toView(boundingBox().topLeft()),theView->toView(boundingBox().bottomRight()));
+    //QRectF bb = QRectF(theView->toView(boundingBox().bottomLeft()),theView->toView(boundingBox().topRight()));
     //bb.adjust(-10, -10, 10, 10);
 
-    LineF F(bb.topLeft(), bb.topRight());
+    LineF F(theView->toView(boundingBox().topLeft()), theView->toView(boundingBox().topRight()));
     D = F.capDistance(Target);
     if ((D < ClearEndDistance) && (D<Best)) Best = D;
-    F = LineF(bb.topLeft(), bb.bottomLeft());
+    F = LineF(theView->toView(boundingBox().topLeft()), theView->toView(boundingBox().bottomLeft()));
     D = F.capDistance(Target);
     if ((D < ClearEndDistance) && (D<Best)) Best = D;
-    F = LineF(bb.bottomRight(), bb.bottomLeft());
+    F = LineF(theView->toView(boundingBox().bottomRight()), theView->toView(boundingBox().bottomLeft()));
     D = F.capDistance(Target);
     if ((D < ClearEndDistance) && (D<Best)) Best = D;
-    F = LineF(bb.bottomRight(), bb.topRight());
+    F = LineF(theView->toView(boundingBox().bottomRight()), theView->toView(boundingBox().topRight()));
     D = F.capDistance(Target);
     if ((D < ClearEndDistance) && (D<Best)) Best = D;
 
@@ -300,10 +302,12 @@ void Relation::add(const QString& Role, Feature* F)
     F->setParentFeature(this);
     p->BBoxUpToDate = false;
     MetaUpToDate = false;
-    if (layer()) {
+    if (layer() && !isDeleted() && isVisible()) {
         CoordBox bb = boundingBox();
         layer()->indexAdd(bb, this);
     }
+
+    notifyChanges();
 }
 
 void Relation::add(const QString& Role, Feature* F, int Idx)
@@ -315,10 +319,12 @@ void Relation::add(const QString& Role, Feature* F, int Idx)
     F->setParentFeature(this);
     p->BBoxUpToDate = false;
     MetaUpToDate = false;
-    if (layer()) {
+    if (layer() && !isDeleted() && isVisible()) {
         CoordBox bb = boundingBox();
         layer()->indexAdd(bb, this);
     }
+
+    notifyChanges();
 }
 
 void Relation::remove(int Idx)
@@ -332,10 +338,12 @@ void Relation::remove(int Idx)
     p->Members.erase(p->Members.begin()+Idx);
     p->BBoxUpToDate = false;
     MetaUpToDate = false;
-    if (layer()) {
+    if (layer() && !isDeleted() && isVisible()) {
         CoordBox bb = boundingBox();
         layer()->indexAdd(bb, this);
     }
+
+    notifyChanges();
 }
 
 void Relation::remove(Feature* F)
@@ -408,8 +416,17 @@ void Relation::buildPath(Projection const &theProjection, const QTransform& /*th
     if (!p->Members.size())
         return;
 
-    QRectF bb = QRectF(theProjection.project(boundingBox().bottomLeft()),theProjection.project(boundingBox().topRight()));
-    p->theBoundingPath.addRect(bb);
+    QVector<QPointF>theVector;
+    theVector.append(theProjection.project(boundingBox().bottomLeft()));
+    theVector.append(theProjection.project(boundingBox().topLeft()));
+    theVector.append(theProjection.project(boundingBox().topRight()));
+    theVector.append(theProjection.project(boundingBox().bottomRight()));
+    theVector.append(theProjection.project(boundingBox().bottomLeft()));
+
+    //QRectF bb = QPolygonF(theVector).boundingRect();
+    //p->theBoundingPath.addRect(bb);
+
+    p->theBoundingPath.addPolygon(QPolygonF(theVector));
 
     p->theBoundingPath = p->theBoundingPath.intersected(clipPath);
 }
diff --git a/src/Features/TrackSegment.cpp b/src/Features/TrackSegment.cpp
index 6a0b2b7..6e4848d 100644
--- a/src/Features/TrackSegment.cpp
+++ b/src/Features/TrackSegment.cpp
@@ -124,34 +124,6 @@ bool TrackSegment::isNull() const
     return (p->Nodes.size() == 0);
 }
 
-static void configurePen(QPen & pen, double slope, double speed)
-{
-    // Encode speed in width of path ...
-    double penWidth = 1.0;
-    if (speed > 10.0)
-        penWidth = qMin(1.0+speed*0.02, 5.0);
-
-    // ... and slope in the color
-    int green = 0;
-    int red = 0;
-
-    if (slope > 2.0)
-    {
-        slope = qMin(slope, 20.0);
-        green = 48 + int(slope*79.0 / 20.0);
-    }
-    else if (slope < -2.0)
-    {
-        slope = qMax(slope, - 20.0);
-        red = 48 + int(-slope*79.0 / 20.0);
-    }
-
-    pen.setColor(QColor(128 + red, 128 + green, 128));
-
-    pen.setStyle(Qt::DotLine);
-    pen.setWidthF(penWidth);
-}
-
 void TrackSegment::drawDirectionMarkers(QPainter &P, QPen &pen, const QPointF & FromF, const QPointF & ToF)
 {
     if (::distance(FromF,ToF) <= 30.0)
@@ -193,11 +165,43 @@ void TrackSegment::draw(QPainter &P, MapView* theView)
 
         if (!M_PREFS->getSimpleGpxTrack())
         {
-            const double distance = here.distanceFrom(last);
-            const double slope = (p->Nodes[i]->elevation() - p->Nodes[i-1]->elevation()) / (distance * 10.0);
-            const double speed = p->Nodes[i]->speed();
+            double distance = here.distanceFrom(last);
+            double slope = (p->Nodes[i]->elevation() - p->Nodes[i-1]->elevation()) / (distance * 10.0);
+            double speed = p->Nodes[i]->speed();
+
+            int width = M_PREFS->getGpxTrackWidth();
+            // Dynamic track line width adaption to zoom level
+            if (theView->pixelPerM() > 2)
+                width++;
+            else if (theView->pixelPerM() < 1)
+                width--;
+
+            // Encode speed in width of path ...
+            double penWidth = 1.0;
+            if (speed > 10.0)
+                penWidth = qMin(1.0+speed*0.02, 5.0);
+
+            penWidth *= width;
+
+            // ... and slope in the color
+            int green = 0;
+            int red = 0;
+
+            if (slope > 2.0)
+            {
+                slope = qMin(slope, 20.0);
+                green = 48 + int(slope*79.0 / 20.0);
+            }
+            else if (slope < -2.0)
+            {
+                slope = qMax(slope, - 20.0);
+                red = 48 + int(-slope*79.0 / 20.0);
+            }
+
+            pen.setColor(QColor(128 + red, 128 + green, 128));
 
-            configurePen(pen, slope, speed);
+            pen.setStyle(Qt::DotLine);
+            pen.setWidthF(penWidth);
         }
         else
         {
diff --git a/src/Features/Way.cpp b/src/Features/Way.cpp
index 3c60c04..10d7366 100644
--- a/src/Features/Way.cpp
+++ b/src/Features/Way.cpp
@@ -228,10 +228,12 @@ void Way::add(Node* Pt, int Idx)
     p->SmoothedUpToDate = false;
     p->wasPathComplete = false;
     p->VirtualsUptodate = false;
-    if (layer()) {
+    if (layer() && !isDeleted() && isVisible()) {
         CoordBox bb = boundingBox();
         layer()->indexAdd(bb, this);
     }
+
+    notifyChanges();
 }
 
 int Way::find(Feature* Pt) const
@@ -266,10 +268,12 @@ void Way::remove(int idx)
     p->SmoothedUpToDate = false;
     p->wasPathComplete = false;
     p->VirtualsUptodate = false;
-    if (layer()) {
+    if (layer() && !isDeleted() && isVisible()) {
         CoordBox bb = boundingBox();
         layer()->indexAdd(bb, this);
     }
+
+    notifyChanges();
 }
 
 void Way::remove(Feature* F)
@@ -1059,6 +1063,7 @@ QString Way::toHtml()
     D += "<i>"+QApplication::translate("MapFeature", "Botright")+": </i>" + QString::number(coordToAng(bb.bottomRight().lat()), 'f', 4) + " / " + QString::number(coordToAng(bb.bottomRight().lon()), 'f', 4);
 
     QString type = isClosed() ? QApplication::translate("MapFeature", "Area") : QApplication::translate("MapFeature", "Way");
+
     return Feature::toMainHtml(type, "way").arg(D);
 }
 
diff --git a/src/ImportExport/ImportCSVDialog.cpp b/src/ImportExport/ImportCSVDialog.cpp
index a090eed..183a17a 100644
--- a/src/ImportExport/ImportCSVDialog.cpp
+++ b/src/ImportExport/ImportCSVDialog.cpp
@@ -177,7 +177,10 @@ Feature* ImportCSVDialog::generateOSM(QString line)
         delete N;
         return NULL;
     }
-    N->setPosition(CSVProjection.inverse(p));
+    if (CSVProjection.projIsLatLong())
+        N->setPosition(Coord(p.y(), p.x()));
+    else
+        N->setPosition(CSVProjection.inverse(p));
     return N;
 }
 
@@ -334,7 +337,7 @@ bool ImportCSVDialog::import(Layer *aLayer)
     QString line;
 
     m_dev->seek(0);
-    if (ui->cbHasHeader)
+    if (ui->cbHasHeader->isChecked())
         m_dev->readLine();
 
     int l = 0;
@@ -343,7 +346,7 @@ bool ImportCSVDialog::import(Layer *aLayer)
         ++l;
     }
 
-    while ((l < ui->sbTo->value() || ui->sbTo == 0) && !m_dev->atEnd()) {
+    while ((l < ui->sbTo->value() || ui->sbTo->value() == 0) && !m_dev->atEnd()) {
         line = m_dev->readLine();
         Feature* F = generateOSM(line);
         if (F)
diff --git a/src/ImportExport/ImportExportCSV.cpp b/src/ImportExport/ImportExportCSV.cpp
index 6120a31..767a9cb 100644
--- a/src/ImportExport/ImportExportCSV.cpp
+++ b/src/ImportExport/ImportExportCSV.cpp
@@ -42,6 +42,9 @@ bool ImportExportCSV::import(Layer* aLayer)
     ImportCSVDialog* dlg = new ImportCSVDialog(Device);
     if (dlg->exec() == QDialog::Rejected)
         return false;
-    return dlg->import(aLayer);
+    bool ret = dlg->import(aLayer);
+    delete dlg;
+
+    return ret;
 }
 
diff --git a/src/Interactions/Interaction.cpp b/src/Interactions/Interaction.cpp
index a8fbb98..41e54d4 100644
--- a/src/Interactions/Interaction.cpp
+++ b/src/Interactions/Interaction.cpp
@@ -53,6 +53,10 @@ const QTransform& Interaction::transform() const
 
 void Interaction::mousePressEvent(QMouseEvent * anEvent)
 {
+    if (anEvent->buttons() & Qt::MidButton) {
+        Panning = true;
+        FirstPan = LastPan = anEvent->pos();
+    } else
 #if defined(Q_OS_MAC)
     // In the name of beautifull code, Steve, add a right mouse button
     if (	(anEvent->modifiers() & Qt::MetaModifier) ||
@@ -104,6 +108,19 @@ void Interaction::mouseReleaseEvent(QMouseEvent * anEvent)
 
 void Interaction::mouseMoveEvent(QMouseEvent* anEvent)
 {
+    if (anEvent->buttons() & Qt::MidButton) {
+        if (Panning)
+        {
+            QPoint Delta = LastPan;
+            Delta -= anEvent->pos();
+            view()->panScreen(-Delta);
+            LastPan = anEvent->pos();
+#if defined(ENABLE_NVIDIA_HACK)
+            view()->invalidate(true, false);
+#endif // ENABLE_NVIDIA_HACK
+        }
+    } else
+
 #if defined(Q_OS_MAC)
     // In the name of beautifull code, Steve, add a right mouse button
     if (	(anEvent->modifiers() & Qt::MetaModifier) ||
diff --git a/src/Interactions/MoveNodeInteraction.cpp b/src/Interactions/MoveNodeInteraction.cpp
index ac7ec21..bdc18ba 100644
--- a/src/Interactions/MoveNodeInteraction.cpp
+++ b/src/Interactions/MoveNodeInteraction.cpp
@@ -102,6 +102,21 @@ void MoveNodeInteraction::snapMousePressEvent(QMouseEvent * event, Feature* aLas
                 }
             addToNoSnap(R);
         }
+        else if (Relation* L = CAST_RELATION(sel[i])) {
+            for (int j=0; j<L->size(); ++j) {
+                if (Node* N = CAST_NODE(L->get(j))) {
+                    if (std::find(Moving.begin(),Moving.end(),N) == Moving.end()) {
+                        Moving.push_back(N);
+                    }
+                } else {
+                    for (int k=0; k<L->get(j)->size(); k++)
+                        if (std::find(Moving.begin(),Moving.end(),L->get(j)->get(k)) == Moving.end()) {
+                        Moving.push_back(CAST_NODE(L->get(j)->get(k)));
+                    }
+                }
+            }
+            addToNoSnap(L);
+        }
     }
     for (int i=0; i<Moving.size(); ++i)
     {
diff --git a/src/Layers/ImageMapLayer.cpp b/src/Layers/ImageMapLayer.cpp
index f5709be..cb371c3 100644
--- a/src/Layers/ImageMapLayer.cpp
+++ b/src/Layers/ImageMapLayer.cpp
@@ -413,10 +413,7 @@ int ImageMapLayer::getCurrentZoom()
 void ImageMapLayer::setCurrentZoom(const CoordBox& viewport, const QRect& rect)
 {
     QRectF vp;
-    if (p->theProjection.projIsLatLong())
-        vp = viewport.toQRectF();
-    else
-        vp = p->theProjection.getProjectedViewport(viewport, rect);
+    vp = p->theProjection.getProjectedViewport(viewport, rect);
 
     qreal tileWidth, tileHeight;
     int maxZoom = p->theMapAdapter->getAdaptedMaxZoom();
@@ -517,8 +514,8 @@ void ImageMapLayer::draw(MapView& theView, QRect& rect)
             pms = p->pm.copy(drawingRect);
     }
 
-    QPainter P(&p->pm);
     p->pm.fill(Qt::transparent);
+    QPainter P(&p->pm);
     P.drawPixmap((pmSize.width()-pms.width())/2, (pmSize.height()-pms.height())/2, pms);
     //    if (p->theMapAdapter->isTiled())
     //        P.drawPixmap((pmSize.width()-pms.width())/2, (pmSize.height()-pms.height())/2, pms);
@@ -532,10 +529,7 @@ QRect ImageMapLayer::drawFull(MapView& theView, QRect& rect) const
     CoordBox Viewport(p->theProjection.inverse(p->theTransform.inverted().map(fScreen.bottomLeft())),
                      p->theProjection.inverse(p->theTransform.inverted().map(fScreen.topRight())));
     QRectF vp;
-    if (p->theProjection.projIsLatLong())
-        vp = p->Viewport.toQRectF();
-    else
-        vp = p->theProjection.getProjectedViewport(p->Viewport, rect);
+    vp = p->theProjection.getProjectedViewport(p->Viewport, rect);
     QRectF wgs84vp = QRectF(QPointF(coordToAng(Viewport.bottomLeft().lon()), coordToAng(Viewport.bottomLeft().lat()))
                         , QPointF(coordToAng(Viewport.topRight().lon()), coordToAng(Viewport.topRight().lat())));
 
@@ -548,13 +542,12 @@ QRect ImageMapLayer::drawFull(MapView& theView, QRect& rect) const
     } else {
         QString url (p->theMapAdapter->getQuery(wgs84vp, vp, rect));
         if (!url.isEmpty()) {
-
             qDebug() << "ImageMapLayer::drawFull: getting: " << url;
-
             QPixmap pm = p->theMapAdapter->getImageManager()->getImage(p->theMapAdapter,url);
-            if (!pm.isNull())  {
+            if (!pm.isNull())
                 p->pm = pm.scaled(rect.size(), Qt::IgnoreAspectRatio);
-            }
+            else
+                return rect;
         }
     }
 
@@ -567,10 +560,7 @@ QRect ImageMapLayer::drawFull(MapView& theView, QRect& rect) const
 QRect ImageMapLayer::drawTiled(MapView& theView, QRect& rect) const
 {
     QRectF vp;
-    if (p->theProjection.projIsLatLong())
-        vp = p->Viewport.toQRectF();
-    else
-        vp = p->theProjection.getProjectedViewport(p->Viewport, rect);
+    vp = p->theProjection.getProjectedViewport(p->Viewport, rect);
 
     qreal tileWidth, tileHeight;
     int maxZoom = p->theMapAdapter->getAdaptedMaxZoom();
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index fc7c388..e843725 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -643,7 +643,7 @@ void MainWindow::on_editPasteFeatureAction_triggered()
     }
     for (int i=0; i<theFeats.size(); ++i) {
         Feature*F = theFeats.at(i);
-        if (theDocument->getFeature(F->id()))
+        if (theDocument->getFeature(F->id(), false))
             F->resetId();
 
 //		if (TrackPoint* P = CAST_NODE(F)) {
@@ -1120,9 +1120,11 @@ void MainWindow::loadFiles(const QStringList & fileList)
         if (foundImport)
         {
             // only imported some tracks
+            p->theFeats->invalidate();
             delete theDocument;
             theDocument = newDoc;
             connect (theDocument, SIGNAL(historyChanged()), theDirty, SLOT(updateList()));
+            connect (theDocument, SIGNAL(historyChanged()), this, SIGNAL(content_changed()));
             theDirty->updateList();
             theView->setDocument(theDocument);
             on_viewZoomAllAction_triggered();
@@ -1482,6 +1484,7 @@ void MainWindow::on_fileNewAction_triggered()
     p->theProperties->setSelection(0);
     if (!theDocument || !theDocument->hasUnsavedChanges() || mayDiscardUnsavedChanges(this)) {
         M_PREFS->cleanupBackgroundPlugins();
+        p->theFeats->invalidate();
         delete theDocument;
         theDocument = new Document(theLayers);
         theDocument->addDefaultLayers();
@@ -1499,6 +1502,7 @@ void MainWindow::on_fileNewAction_triggered()
         theView->setDocument(theDocument);
         theDocument->history().setActions(ui->editUndoAction, ui->editRedoAction, ui->fileUploadAction);
         connect (theDocument, SIGNAL(historyChanged()), theDirty, SLOT(updateList()));
+        connect (theDocument, SIGNAL(historyChanged()), this, SIGNAL(content_changed()));
         theDirty->updateList();
 
         fileName = "";
@@ -2166,12 +2170,14 @@ void MainWindow::loadDocument(QString fn)
 
             if (newDoc) {
                 p->theProperties->setSelection(0);
+                p->theFeats->invalidate();
                 delete theDocument;
                 theDocument = newDoc;
                 theView->setDocument(theDocument);
                 on_editPropertiesAction_triggered();
                 theDocument->history().setActions(ui->editUndoAction, ui->editRedoAction, ui->fileUploadAction);
                 connect (theDocument, SIGNAL(historyChanged()), theDirty, SLOT(updateList()));
+                connect (theDocument, SIGNAL(historyChanged()), this, SIGNAL(content_changed()));
                 theDirty->updateList();
                 fileName = fn;
                 setWindowTitle(QString("%1 - %2").arg(fileName).arg(p->title));
@@ -2341,15 +2347,23 @@ bool MainWindow::selectExportedFeatures(QList<Feature*>& theFeatures)
     }
     if (dlg.exec()) {
         if (dlgExport.rbAll->isChecked()) {
-            theFeatures = document()->getFeatures();
-            MerkaartorPreferences::instance()->setExportType(Export_All);
+            for (VisibleFeatureIterator i(document()); !i.isEnd(); ++i) {
+                if (i.get()->notEverythingDownloaded())
+                    continue;
+
+                theFeatures.append(i.get());
+            }
+            M_PREFS->setExportType(Export_All);
             return true;
         }
-        if (dlgExport.rbViewport->isChecked()) {
+        else if (dlgExport.rbViewport->isChecked()) {
             CoordBox aCoordBox = view()->viewport();
 
             theFeatures.clear();
             for (VisibleFeatureIterator i(document()); !i.isEnd(); ++i) {
+                if (i.get()->notEverythingDownloaded())
+                    continue;
+
                 if (Node* P = dynamic_cast<Node*>(i.get())) {
                     if (aCoordBox.contains(P->position())) {
                         theFeatures.append(P);
@@ -2387,7 +2401,7 @@ bool MainWindow::selectExportedFeatures(QList<Feature*>& theFeatures)
             MerkaartorPreferences::instance()->setExportType(Export_Viewport);
             return true;
         }
-        if (dlgExport.rbSelected->isChecked()) {
+        else if (dlgExport.rbSelected->isChecked()) {
             theFeatures = p->theProperties->selection();
             MerkaartorPreferences::instance()->setExportType(Export_Selected);
             return true;
@@ -3029,16 +3043,16 @@ void MainWindow::updateLanguage()
     QString DefaultLanguage = getDefaultLanguage();
     if (DefaultLanguage != "-" && DefaultLanguage != "en")
     {
+#if defined(Q_OS_MAC)
+        QDir resources = QDir(QCoreApplication::applicationDirPath());
+        resources.cdUp();
+        resources.cd("Resources");
+#endif
         qtTranslator = new QTranslator;
         bool retQt;
         if (g_Merk_Portable) {
             retQt = qtTranslator->load("qt_" + DefaultLanguage.left(2), QCoreApplication::applicationDirPath() + "/translations");
         } else {
-#if defined(Q_OS_MAC)
-            QDir resources = QDir(QCoreApplication::applicationDirPath());
-            resources.cdUp();
-            resources.cd("Resources");
-#endif
 #ifdef TRANSDIR_SYSTEM
             if (!QDir::isAbsolutePath(STRINGIFY(TRANSDIR_SYSTEM)))
                 retQt = qtTranslator->load("qt_" + DefaultLanguage.left(2), QCoreApplication::applicationDirPath() + "/" + STRINGIFY(TRANSDIR_SYSTEM));
diff --git a/src/MapView.cpp b/src/MapView.cpp
index 6219eea..537bca5 100644
--- a/src/MapView.cpp
+++ b/src/MapView.cpp
@@ -435,15 +435,30 @@ void MapView::drawLatLonGrid(QPainter & P)
         medianLines << l;
     }
 
+    P.save();
+    P.setRenderHint(QPainter::Antialiasing);
     P.setPen(QColor(180, 217, 255));
+    QLineF lb = QLineF(rect().topLeft(), rect().bottomLeft());
+    QLineF lt = QLineF(rect().topLeft(), rect().topRight());
+    QLineF l;
     for (int i=0; i<parallelLines.size(); ++i) {
 
         if (parallelLines[i].size() == 0)
           continue;
 
         P.drawPolyline(p->theTransform.map(parallelLines[i]));
-        QPoint pt = QPoint(0, p->theTransform.map(parallelLines.at(i).at(0)).y());
-        QPoint ptt = pt + QPoint(5, -5);
+        int k=0;
+        QPointF pt;
+        while (k < parallelLines.at(i).size()-2) {
+            l = QLineF(p->theTransform.map(parallelLines.at(i).at(k)), p->theTransform.map(parallelLines.at(i).at(k+1)));
+            if (l.intersect(lb, &pt) == QLineF::BoundedIntersection)
+                break;
+            ++k;
+        }
+        if (pt.isNull())
+            continue;
+//        QPoint pt = QPoint(0, p->theTransform.map(parallelLines.at(i).at(0)).y());
+        QPoint ptt = pt.toPoint() + QPoint(5, -5);
         P.drawText(ptt, QString("%1").arg(coordToAng(theProjection.inverse(parallelLines.at(i).at(0)).lat()), 0, 'f', 2-prec));
     }
     for (int i=0; i<medianLines.size(); ++i) {
@@ -452,10 +467,22 @@ void MapView::drawLatLonGrid(QPainter & P)
           continue;
 
         P.drawPolyline(p->theTransform.map(medianLines[i]));
-        QPoint pt = QPoint(p->theTransform.map(medianLines.at(i).at(0)).x(), 0);
-        QPoint ptt = pt + QPoint(5, 10);
+        int k=0;
+        QPointF pt;
+        while (k < medianLines.at(i).size()-2) {
+            l = QLineF(p->theTransform.map(medianLines.at(i).at(k)), p->theTransform.map(medianLines.at(i).at(k+1)));
+            if (l.intersect(lt, &pt) == QLineF::BoundedIntersection)
+                break;
+            ++k;
+        }
+        if (pt.isNull())
+            continue;
+//        QPoint pt = QPoint(p->theTransform.map(medianLines.at(i).at(0)).x(), 0);
+        QPoint ptt = pt.toPoint() + QPoint(5, 10);
         P.drawText(ptt, QString("%1").arg(coordToAng(theProjection.inverse(medianLines.at(i).at(0)).lon()), 0, 'f', 2-prec));
     }
+
+    P.restore();
 }
 
 void MapView::drawFeatures(QPainter & P, Projection& /*aProj*/)
@@ -974,9 +1001,25 @@ CoordBox MapView::viewport() const
 void MapView::viewportRecalc(const QRect & Screen)
 {
     QRectF fScreen(Screen);
-    p->Viewport =
-        CoordBox(theProjection.inverse(p->theTransform.inverted().map(fScreen.bottomLeft())),
-             theProjection.inverse(p->theTransform.inverted().map(fScreen.topRight())));
+    Coord bl = theProjection.inverse(p->theTransform.inverted().map(fScreen.bottomLeft()));
+    Coord br = theProjection.inverse(p->theTransform.inverted().map(fScreen.bottomRight()));
+    Coord tr = theProjection.inverse(p->theTransform.inverted().map(fScreen.topRight()));
+    Coord tl = theProjection.inverse(p->theTransform.inverted().map(fScreen.topLeft()));
+    double t = qMax(tr.lat(), tl.lat());
+    double b = qMin(br.lat(), bl.lat());
+    double l = qMin(tl.lon(), bl.lon());
+    double r = qMax(tr.lon(), br.lon());
+    p->Viewport = CoordBox(Coord(b, l), Coord(t, r));
+
+    if (theProjection.projIsLatLong()) {
+        p->PixelPerM = Screen.width() / (double)p->Viewport.lonDiff() * theProjection.lonAnglePerM(coordToRad(p->Viewport.center().lat()));
+    } else {
+        // measure geographical distance between mid left and mid right of the screen
+        int mid = (fScreen.topLeft().y() + fScreen.bottomLeft().y()) / 2;
+        Coord left = theProjection.inverse(p->theTransform.inverted().map(QPointF(fScreen.left(), mid)));
+        Coord right = theProjection.inverse(p->theTransform.inverted().map(QPointF(fScreen.right(), mid)));
+        p->PixelPerM = Screen.width() / (left.distanceFrom(right)*1000);
+    }
 
     emit viewportChanged();
 }
@@ -1043,9 +1086,6 @@ void MapView::setViewport(const CoordBox & TargetMap,
     transformCalc(p->theTransform, theProjection, targetVp, Screen);
     viewportRecalc(Screen);
 
-    QRectF vp = theProjection.getProjectedViewport(p->Viewport, Screen);
-    p->PixelPerM = Screen.width() / vp.width();
-
     p->NodeWidth = p->PixelPerM * M_PREFS->getNodeSize();
     if (p->NodeWidth > M_PREFS->getNodeSize())
         p->NodeWidth = M_PREFS->getNodeSize();
@@ -1123,12 +1163,6 @@ void MapView::zoom(double d, const QPoint & Around,
     p->theTransform.setMatrix(ScaleLon, 0, 0, 0, ScaleLat, 0, DeltaLon, DeltaLat, 1);
     viewportRecalc(Screen);
 
-    if (theProjection.projIsLatLong()) {
-        p->PixelPerM = Screen.width() / (double)p->Viewport.lonDiff() * LAT_ANG_PER_M / M_PI * COORD_MAX;
-    } else {
-        QRectF vp = theProjection.getProjectedViewport(p->Viewport, Screen);
-        p->PixelPerM = Screen.width() / vp.width();
-    }
     p->NodeWidth = p->PixelPerM * M_PREFS->getNodeSize();
     if (p->NodeWidth > M_PREFS->getNodeSize())
         p->NodeWidth = M_PREFS->getNodeSize();
diff --git a/src/Maps/Projection.cpp b/src/Maps/Projection.cpp
index 4952917..6f0ee41 100644
--- a/src/Maps/Projection.cpp
+++ b/src/Maps/Projection.cpp
@@ -216,28 +216,33 @@ bool Projection::projIsLatLong() const
 QRectF Projection::getProjectedViewport(const CoordBox& Viewport, const QRect& screen) const
 {
     QPointF bl, tr;
-
+    QRectF pViewport;
     double x, y;
-    if (p->IsLatLong || p->IsMercator)
-        tr = project(Viewport.topRight());
-    else {
-        x = coordToRad(Viewport.topRight().lon());
-        y = coordToRad(Viewport.topRight().lat());
-        projTransformFromWGS84(1, 0, &x, &y, NULL);
-        tr = QPointF(x, y);
-    }
 
-    if (p->IsLatLong || p->IsMercator)
-        bl = project(Viewport.bottomLeft());
+    if (p->IsLatLong)
+        pViewport = Viewport.toQRectF();
     else {
-        x = coordToRad(Viewport.bottomLeft().lon());
-        y = coordToRad(Viewport.bottomLeft().lat());
-        projTransformFromWGS84(1, 0, &x, &y, NULL);
-        bl = QPointF(x, y);
+        if (p->IsMercator)
+            tr = project(Viewport.topRight());
+        else {
+            x = coordToRad(Viewport.topRight().lon());
+            y = coordToRad(Viewport.topRight().lat());
+            projTransformFromWGS84(1, 0, &x, &y, NULL);
+            tr = QPointF(x, y);
+        }
+
+        if (p->IsMercator)
+            bl = project(Viewport.bottomLeft());
+        else {
+            x = coordToRad(Viewport.bottomLeft().lon());
+            y = coordToRad(Viewport.bottomLeft().lat());
+            projTransformFromWGS84(1, 0, &x, &y, NULL);
+            bl = QPointF(x, y);
+        }
+
+        pViewport = QRectF(bl.x(), tr.y(), tr.x() - bl.x(), bl.y() - tr.y());
     }
 
-    QRectF pViewport = QRectF(bl.x(), tr.y(), tr.x() - bl.x(), bl.y() - tr.y());
-
     QPointF pCenter(pViewport.center());
 
     double wv, hv;
diff --git a/src/PaintStyle/PaintStyleEditor.cpp b/src/PaintStyle/PaintStyleEditor.cpp
index 4afaf75..e940331 100644
--- a/src/PaintStyle/PaintStyleEditor.cpp
+++ b/src/PaintStyle/PaintStyleEditor.cpp
@@ -14,593 +14,603 @@
 
 static void makeBoundaryIcon(QToolButton* bt, QColor C)
 {
-	QPixmap pm(36, 18);
-	pm.fill(QColor(255, 255, 255));
-	QPainter p(&pm);
-	p.setPen(C);
-	p.setBrush(C);
-	p.drawRect(0, 6, 36, 6);
-	bt->setIcon(pm);
+    QPixmap pm(36, 18);
+    pm.fill(QColor(255, 255, 255));
+    QPainter p(&pm);
+    p.setPen(C);
+    p.setBrush(C);
+    p.drawRect(0, 6, 36, 6);
+    bt->setIcon(pm);
 }
 
 PaintStyleEditor::PaintStyleEditor(QWidget *aParent, const GlobalPainter& aGlobalPainter, const QList<FeaturePainter>& aPainters)
-		: QDialog(aParent), theGlobalPainter(aGlobalPainter), thePainters(aPainters), FreezeUpdate(true)
+        : QDialog(aParent), theGlobalPainter(aGlobalPainter), thePainters(aPainters), FreezeUpdate(true)
 {
-	setupUi(this);
+    setupUi(this);
 
-	setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
-	setWindowFlags(windowFlags() | Qt::MSWindowsFixedSizeDialogHint);
+    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
+    setWindowFlags(windowFlags() | Qt::MSWindowsFixedSizeDialogHint);
 
-	BackgroundColor->setIconSize(QSize(36, 18));
-	ForegroundColor->setIconSize(QSize(36, 18));
-	TouchupColor->setIconSize(QSize(36, 18));
-	FillColor->setIconSize(QSize(36, 18));
-	LabelColor->setIconSize(QSize(36, 18));
-	LabelBackgroundlColor->setIconSize(QSize(36, 18));
-	GlobalBackgroundColor->setIconSize(QSize(36, 18));
+    BackgroundColor->setIconSize(QSize(36, 18));
+    ForegroundColor->setIconSize(QSize(36, 18));
+    TouchupColor->setIconSize(QSize(36, 18));
+    FillColor->setIconSize(QSize(36, 18));
+    LabelColor->setIconSize(QSize(36, 18));
+    LabelBackgroundlColor->setIconSize(QSize(36, 18));
+    GlobalBackgroundColor->setIconSize(QSize(36, 18));
 
-	for (int i = 0; i < thePainters.size(); ++i)
-		PaintList->addItem(thePainters[i].userName());
-	PaintList->setCurrentRow(0);
-	LowerZoomBoundary->setSpecialValueText(tr("Always"));
-	UpperZoomBoundary->setSpecialValueText(tr("Always"));
+    for (int i = 0; i < thePainters.size(); ++i)
+        PaintList->addItem(thePainters[i].userName());
+    PaintList->setCurrentRow(0);
+    LowerZoomBoundary->setSpecialValueText(tr("Always"));
+    UpperZoomBoundary->setSpecialValueText(tr("Always"));
 
-	DrawGlobalBackground->setChecked(theGlobalPainter.getDrawBackground());
-	makeBoundaryIcon(GlobalBackgroundColor, theGlobalPainter.getBackgroundColor());
-	on_PaintList_itemSelectionChanged();
+    DrawGlobalBackground->setChecked(theGlobalPainter.getDrawBackground());
+    makeBoundaryIcon(GlobalBackgroundColor, theGlobalPainter.getBackgroundColor());
+    on_PaintList_itemSelectionChanged();
 
-	FreezeUpdate = false;
+    FreezeUpdate = false;
 
-	resize(1, 1);
+    resize(1, 1);
 }
 
 void PaintStyleEditor::on_AddButton_clicked()
 {
-	thePainters.push_back(FeaturePainter());
-	PaintList->addItem(thePainters[thePainters.size()-1].userName());
-	PaintList->setCurrentRow(thePainters.size() - 1);
-	on_PaintList_itemSelectionChanged();
+    thePainters.push_back(FeaturePainter());
+    PaintList->addItem(thePainters[thePainters.size()-1].userName());
+    PaintList->setCurrentRow(thePainters.size() - 1);
+    on_PaintList_itemSelectionChanged();
 }
 
 void PaintStyleEditor::on_DuplicateButton_clicked()
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	//QList<FeaturePainter>::iterator theIterator = thePainters.begin();
-	thePainters.insert(thePainters.begin() + idx, FeaturePainter(thePainters[idx]));
-	idx++;
-	PaintList->insertItem(idx, thePainters[idx].userName());
-	PaintList->setCurrentRow(idx);
-	on_PaintList_itemSelectionChanged();
+    int idx = PaintList->currentRow();
+    if (idx < 0 || idx >= thePainters.size())
+        return;
+    //QList<FeaturePainter>::iterator theIterator = thePainters.begin();
+    thePainters.insert(thePainters.begin() + idx, FeaturePainter(thePainters[idx]));
+    idx++;
+    PaintList->insertItem(idx, thePainters[idx].userName());
+    PaintList->setCurrentRow(idx);
+    on_PaintList_itemSelectionChanged();
 }
 
 void PaintStyleEditor::on_RemoveButton_clicked()
 {
-	FreezeUpdate = true;
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	thePainters.erase(thePainters.begin() + idx);
-	delete PaintList->takeItem(idx);
-	if (idx && (idx >= thePainters.size()))
-		--idx;
-	PaintList->setCurrentRow(idx);
-	on_PaintList_itemSelectionChanged();
+    FreezeUpdate = true;
+    int idx = PaintList->currentRow();
+    if (idx < 0 || idx >= thePainters.size())
+        return;
+    thePainters.erase(thePainters.begin() + idx);
+    delete PaintList->takeItem(idx);
+    if (idx && (idx >= thePainters.size()))
+        --idx;
+    PaintList->setCurrentRow(idx);
+    on_PaintList_itemSelectionChanged();
 }
 
 void PaintStyleEditor::on_btUp_clicked()
 {
-	int idx = static_cast<int>(PaintList->currentRow());
-	if (idx <= 0)
-		return;
-	FeaturePainter fp = thePainters[idx-1];
-	thePainters[idx-1] = thePainters[idx];
-	thePainters[idx] = fp;
-	PaintList->item(idx-1)->setText(thePainters[idx-1].userName());
-	PaintList->item(idx)->setText(thePainters[idx].userName());
-	PaintList->setCurrentRow(idx-1);
+    int idx = static_cast<int>(PaintList->currentRow());
+    if (idx <= 0)
+        return;
+    FeaturePainter fp = thePainters[idx-1];
+    thePainters[idx-1] = thePainters[idx];
+    thePainters[idx] = fp;
+    PaintList->item(idx-1)->setText(thePainters[idx-1].userName());
+    PaintList->item(idx)->setText(thePainters[idx].userName());
+    PaintList->setCurrentRow(idx-1);
 }
 
 void PaintStyleEditor::on_btDown_clicked()
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size()-1)
-		return;
-	FeaturePainter fp = thePainters[idx+1];
-	thePainters[idx+1] = thePainters[idx];
-	thePainters[idx] = fp;
-	PaintList->item(idx+1)->setText(thePainters[idx+1].userName());
-	PaintList->item(idx)->setText(thePainters[idx].userName());
-	PaintList->setCurrentRow(idx+1);
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size()-1)
+        return;
+    FeaturePainter fp = thePainters[idx+1];
+    thePainters[idx+1] = thePainters[idx];
+    thePainters[idx] = fp;
+    PaintList->item(idx+1)->setText(thePainters[idx+1].userName());
+    PaintList->item(idx)->setText(thePainters[idx].userName());
+    PaintList->setCurrentRow(idx+1);
 }
 
 void PaintStyleEditor::on_PaintList_itemSelectionChanged()
 {
-	FreezeUpdate = true;
-	int idx = PaintList->currentRow();
-	if (idx < 0 || idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	TagSelection->setText(FP.userName());
-	if (FP.zoomBoundaries().first == 0)
-		LowerZoomBoundary->setValue(0);
-	else
-		LowerZoomBoundary->setValue(1 / FP.zoomBoundaries().first);
-	if ((FP.zoomBoundaries().second == 0) || (FP.zoomBoundaries().second > 10e5))
-		UpperZoomBoundary->setValue(0);
-	else
-		UpperZoomBoundary->setValue(1 / FP.zoomBoundaries().second);
-	DrawBackground->setChecked(FP.backgroundBoundary().Draw);
-	ProportionalBackground->setValue(FP.backgroundBoundary().Proportional);
-	FixedBackground->setValue(FP.backgroundBoundary().Fixed);
-	makeBoundaryIcon(BackgroundColor, FP.backgroundBoundary().Color);
-	DrawForeground->setChecked(FP.foregroundBoundary().Draw);
-	ProportionalForeground->setValue(FP.foregroundBoundary().Proportional);
-	FixedForeground->setValue(FP.foregroundBoundary().Fixed);
-	makeBoundaryIcon(ForegroundColor, FP.foregroundBoundary().Color);
-	ForegroundDashed->setChecked(FP.foregroundBoundary().Dashed);
-	ForegroundDashOn->setValue(FP.foregroundBoundary().DashOn);
-	ForegroundDashOff->setValue(FP.foregroundBoundary().DashOff);
-	DrawTouchup->setChecked(FP.touchupBoundary().Draw);
-	ProportionalTouchup->setValue(FP.touchupBoundary().Proportional);
-	FixedTouchup->setValue(FP.touchupBoundary().Fixed);
-	makeBoundaryIcon(TouchupColor, FP.touchupBoundary().Color);
-	TouchupDashed->setChecked(FP.touchupBoundary().Dashed);
-	TouchupDashOn->setValue(FP.touchupBoundary().DashOn);
-	TouchupDashOff->setValue(FP.touchupBoundary().DashOff);
-	DrawFill->setChecked(FP.fillColor().isValid());
-	makeBoundaryIcon(FillColor, FP.fillColor());
-	DrawIcon->setChecked(FP.icon().Draw);
-	IconName->setText(FP.icon().Name);
-	ProportionalIcon->setValue(FP.icon().Proportional);
-	FixedIcon->setValue(FP.icon().Fixed);
-	DrawLabel->setChecked(FP.labelBoundary().Draw);
-	makeBoundaryIcon(LabelColor, FP.labelBoundary().Color);
-	ProportionalLabel->setValue(FP.labelBoundary().Proportional);
-	FixedLabel->setValue(FP.labelBoundary().Fixed);
-	DrawLabelBackground->setChecked(FP.labelBackgroundColor().isValid());
-	makeBoundaryIcon(LabelBackgroundlColor, FP.labelBackgroundColor());
-	LabelFont->setCurrentFont(FP.getLabelFont());
-	LabelTag->setText(FP.getLabelTag());
-	LabelBackgroundTag->setText(FP.getLabelBackgroundTag());
-	LabelHalo->setChecked(FP.getLabelHalo());
-	LabelArea->setChecked(FP.getLabelArea());
-
-	updatePagesIcons();
-
-	FreezeUpdate = false;
+    FreezeUpdate = true;
+    int idx = PaintList->currentRow();
+    if (idx < 0) {
+        editArea->setEnabled(false);
+        DuplicateButton->setEnabled(false);
+        RemoveButton->setEnabled(false);
+        return;
+    } else {
+        editArea->setEnabled(true);
+        DuplicateButton->setEnabled(true);
+        RemoveButton->setEnabled(true);
+    }
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    TagSelection->setText(FP.userName());
+    if (FP.zoomBoundaries().first == 0)
+        LowerZoomBoundary->setValue(0);
+    else
+        LowerZoomBoundary->setValue(1 / FP.zoomBoundaries().first);
+    if ((FP.zoomBoundaries().second == 0) || (FP.zoomBoundaries().second > 10e5))
+        UpperZoomBoundary->setValue(0);
+    else
+        UpperZoomBoundary->setValue(1 / FP.zoomBoundaries().second);
+    DrawBackground->setChecked(FP.backgroundBoundary().Draw);
+    ProportionalBackground->setValue(FP.backgroundBoundary().Proportional);
+    FixedBackground->setValue(FP.backgroundBoundary().Fixed);
+    makeBoundaryIcon(BackgroundColor, FP.backgroundBoundary().Color);
+    DrawForeground->setChecked(FP.foregroundBoundary().Draw);
+    ProportionalForeground->setValue(FP.foregroundBoundary().Proportional);
+    FixedForeground->setValue(FP.foregroundBoundary().Fixed);
+    makeBoundaryIcon(ForegroundColor, FP.foregroundBoundary().Color);
+    ForegroundDashed->setChecked(FP.foregroundBoundary().Dashed);
+    ForegroundDashOn->setValue(FP.foregroundBoundary().DashOn);
+    ForegroundDashOff->setValue(FP.foregroundBoundary().DashOff);
+    DrawTouchup->setChecked(FP.touchupBoundary().Draw);
+    ProportionalTouchup->setValue(FP.touchupBoundary().Proportional);
+    FixedTouchup->setValue(FP.touchupBoundary().Fixed);
+    makeBoundaryIcon(TouchupColor, FP.touchupBoundary().Color);
+    TouchupDashed->setChecked(FP.touchupBoundary().Dashed);
+    TouchupDashOn->setValue(FP.touchupBoundary().DashOn);
+    TouchupDashOff->setValue(FP.touchupBoundary().DashOff);
+    DrawFill->setChecked(FP.fillColor().isValid());
+    makeBoundaryIcon(FillColor, FP.fillColor());
+    DrawIcon->setChecked(FP.icon().Draw);
+    IconName->setText(FP.icon().Name);
+    ProportionalIcon->setValue(FP.icon().Proportional);
+    FixedIcon->setValue(FP.icon().Fixed);
+    DrawLabel->setChecked(FP.labelBoundary().Draw);
+    makeBoundaryIcon(LabelColor, FP.labelBoundary().Color);
+    ProportionalLabel->setValue(FP.labelBoundary().Proportional);
+    FixedLabel->setValue(FP.labelBoundary().Fixed);
+    DrawLabelBackground->setChecked(FP.labelBackgroundColor().isValid());
+    makeBoundaryIcon(LabelBackgroundlColor, FP.labelBackgroundColor());
+    LabelFont->setCurrentFont(FP.getLabelFont());
+    LabelTag->setText(FP.getLabelTag());
+    LabelBackgroundTag->setText(FP.getLabelBackgroundTag());
+    LabelHalo->setChecked(FP.getLabelHalo());
+    LabelArea->setChecked(FP.getLabelArea());
+
+    updatePagesIcons();
+
+    FreezeUpdate = false;
 }
 
 void PaintStyleEditor::updatePagesIcons()
 {
-	if (DrawForeground->isChecked() || DrawFill->isChecked())
-		tbStyle->setItemIcon(0, QIcon(":/Icons/actions/software-update-available.png"));
-	else
-		tbStyle->setItemIcon(0, QIcon());
+    if (DrawForeground->isChecked() || DrawFill->isChecked())
+        tbStyle->setItemIcon(0, QIcon(":/Icons/actions/software-update-available.png"));
+    else
+        tbStyle->setItemIcon(0, QIcon());
 
-	if (DrawBackground->isChecked())
-		tbStyle->setItemIcon(1, QIcon(":/Icons/actions/software-update-available.png"));
-	else
-		tbStyle->setItemIcon(1, QIcon());
+    if (DrawBackground->isChecked())
+        tbStyle->setItemIcon(1, QIcon(":/Icons/actions/software-update-available.png"));
+    else
+        tbStyle->setItemIcon(1, QIcon());
 
-	if (DrawTouchup->isChecked() || DrawIcon->isChecked())
-		tbStyle->setItemIcon(2, QIcon(":/Icons/actions/software-update-available.png"));
-	else
-		tbStyle->setItemIcon(2, QIcon());
+    if (DrawTouchup->isChecked() || DrawIcon->isChecked())
+        tbStyle->setItemIcon(2, QIcon(":/Icons/actions/software-update-available.png"));
+    else
+        tbStyle->setItemIcon(2, QIcon());
 
-	if (DrawLabel->isChecked())
-		tbStyle->setItemIcon(3, QIcon(":/Icons/actions/software-update-available.png"));
-	else
-		tbStyle->setItemIcon(3, QIcon());
+    if (DrawLabel->isChecked())
+        tbStyle->setItemIcon(3, QIcon(":/Icons/actions/software-update-available.png"));
+    else
+        tbStyle->setItemIcon(3, QIcon());
 }
 
 void PaintStyleEditor::on_TagSelection_editingFinished()
 {
-	updatePaintList();
+    updatePaintList();
 }
 
 void PaintStyleEditor::on_LowerZoomBoundary_valueChanged()
 {
-	if (FreezeUpdate)
-		return;
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	QPair<double, double> Result(0, 0);
-	if (LowerZoomBoundary->value() > 10e-6)
-		Result.first = 1 / LowerZoomBoundary->value();
-	if (UpperZoomBoundary->value() > 10e-6)
-		Result.second = 1 / UpperZoomBoundary->value();
-	else
-		Result.second = 10e6;
-	FP.zoomBoundary(Result.first, Result.second);
+    if (FreezeUpdate)
+        return;
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    QPair<double, double> Result(0, 0);
+    if (LowerZoomBoundary->value() > 10e-6)
+        Result.first = 1 / LowerZoomBoundary->value();
+    if (UpperZoomBoundary->value() > 10e-6)
+        Result.second = 1 / UpperZoomBoundary->value();
+    else
+        Result.second = 10e6;
+    FP.zoomBoundary(Result.first, Result.second);
 }
 
 void PaintStyleEditor::on_UpperZoomBoundary_valueChanged()
 {
-	on_LowerZoomBoundary_valueChanged();
+    on_LowerZoomBoundary_valueChanged();
 }
 
 void PaintStyleEditor::on_DrawGlobalBackground_clicked(bool b)
 {
-	theGlobalPainter.backgroundActive(b);
+    theGlobalPainter.backgroundActive(b);
 }
 
 void PaintStyleEditor::on_GlobalBackgroundColor_clicked()
 {
-	QColor rgb = QColorDialog::getColor(theGlobalPainter.getBackgroundColor(), this
+    QColor rgb = QColorDialog::getColor(theGlobalPainter.getBackgroundColor(), this
 #if (QT_VERSION >= QT_VERSION_CHECK(4, 5, 0))
                                             , tr("Select Color"), QColorDialog::ShowAlphaChannel
 #endif
                                            );
-	if (rgb.isValid()) {
-		makeBoundaryIcon(GlobalBackgroundColor, rgb);
-		theGlobalPainter.background(rgb);
-	}
+    if (rgb.isValid()) {
+        makeBoundaryIcon(GlobalBackgroundColor, rgb);
+        theGlobalPainter.background(rgb);
+    }
 }
 
 void PaintStyleEditor::on_DrawBackground_clicked(bool b)
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	thePainters[idx].backgroundActive(b);
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    thePainters[idx].backgroundActive(b);
 
-	updatePagesIcons();
+    updatePagesIcons();
 }
 
 void PaintStyleEditor::on_BackgroundColor_clicked()
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	QColor rgb = QColorDialog::getColor(FP.backgroundBoundary().Color, this
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    QColor rgb = QColorDialog::getColor(FP.backgroundBoundary().Color, this
 #if (QT_VERSION >= QT_VERSION_CHECK(4, 5, 0))
                                             , tr("Select Color"), QColorDialog::ShowAlphaChannel
 #endif
                                            );
-	if (rgb.isValid()) {
-		makeBoundaryIcon(BackgroundColor, rgb);
-		FP.background(rgb, ProportionalBackground->value(), FixedBackground->value());
-	}
+    if (rgb.isValid()) {
+        makeBoundaryIcon(BackgroundColor, rgb);
+        FP.background(rgb, ProportionalBackground->value(), FixedBackground->value());
+    }
 }
 
 void PaintStyleEditor::on_ProportionalBackground_valueChanged()
 {
-	if (FreezeUpdate)
-		return;
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	FP.background(FP.backgroundBoundary().Color, ProportionalBackground->value(), FixedBackground->value());
+    if (FreezeUpdate)
+        return;
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    FP.background(FP.backgroundBoundary().Color, ProportionalBackground->value(), FixedBackground->value());
 }
 
 void PaintStyleEditor::on_FixedBackground_valueChanged()
 {
-	on_ProportionalBackground_valueChanged();
+    on_ProportionalBackground_valueChanged();
 }
 
 void PaintStyleEditor::on_DrawForeground_clicked(bool b)
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	thePainters[idx].foregroundActive(b);
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    thePainters[idx].foregroundActive(b);
 
-	updatePagesIcons();
+    updatePagesIcons();
 }
 
 
 void PaintStyleEditor::on_ForegroundColor_clicked()
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	QColor rgb = QColorDialog::getColor(FP.foregroundBoundary().Color, this
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    QColor rgb = QColorDialog::getColor(FP.foregroundBoundary().Color, this
 #if (QT_VERSION >= QT_VERSION_CHECK(4, 5, 0))
                                             , tr("Select Color"), QColorDialog::ShowAlphaChannel
 #endif
                                            );
-	if (rgb.isValid()) {
-		makeBoundaryIcon(ForegroundColor, rgb);
-		FP.foreground(rgb, ProportionalForeground->value(), FixedForeground->value());
-	}
+    if (rgb.isValid()) {
+        makeBoundaryIcon(ForegroundColor, rgb);
+        FP.foreground(rgb, ProportionalForeground->value(), FixedForeground->value());
+    }
 }
 
 void PaintStyleEditor::on_ProportionalForeground_valueChanged()
 {
-	if (FreezeUpdate)
-		return;
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	FP.foreground(FP.foregroundBoundary().Color, ProportionalForeground->value(), FixedForeground->value());
+    if (FreezeUpdate)
+        return;
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    FP.foreground(FP.foregroundBoundary().Color, ProportionalForeground->value(), FixedForeground->value());
 }
 
 void PaintStyleEditor::on_FixedForeground_valueChanged()
 {
-	on_ProportionalForeground_valueChanged();
+    on_ProportionalForeground_valueChanged();
 }
 
 
 void PaintStyleEditor::on_ForegroundDashed_clicked()
 {
-	if (FreezeUpdate)
-		return;
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	if (ForegroundDashed->isChecked())
-		FP.foregroundDash(ForegroundDashOn->value(), ForegroundDashOff->value());
-	else
-		FP.clearForegroundDash();
+    if (FreezeUpdate)
+        return;
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    if (ForegroundDashed->isChecked())
+        FP.foregroundDash(ForegroundDashOn->value(), ForegroundDashOff->value());
+    else
+        FP.clearForegroundDash();
 }
 
 void PaintStyleEditor::on_ForegroundDashOff_valueChanged()
 {
-	on_ForegroundDashed_clicked();
+    on_ForegroundDashed_clicked();
 }
 
 void PaintStyleEditor::on_ForegroundDashOn_valueChanged()
 {
-	on_ForegroundDashed_clicked();
+    on_ForegroundDashed_clicked();
 }
 
 void PaintStyleEditor::on_DrawTouchup_clicked(bool b)
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	thePainters[idx].touchupActive(b);
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    thePainters[idx].touchupActive(b);
 
-	updatePagesIcons();
+    updatePagesIcons();
 }
 
 void PaintStyleEditor::on_TouchupColor_clicked()
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	QColor rgb = QColorDialog::getColor(FP.touchupBoundary().Color, this
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    QColor rgb = QColorDialog::getColor(FP.touchupBoundary().Color, this
 #if (QT_VERSION >= QT_VERSION_CHECK(4, 5, 0))
                                             , tr("Select Color"), QColorDialog::ShowAlphaChannel
 #endif
                                            );
-	if (rgb.isValid()) {
-		makeBoundaryIcon(TouchupColor, rgb);
-		FP.touchup(rgb, ProportionalTouchup->value(), FixedTouchup->value());
-	}
+    if (rgb.isValid()) {
+        makeBoundaryIcon(TouchupColor, rgb);
+        FP.touchup(rgb, ProportionalTouchup->value(), FixedTouchup->value());
+    }
 }
 
 void PaintStyleEditor::on_ProportionalTouchup_valueChanged()
 {
-	if (FreezeUpdate)
-		return;
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	FP.touchup(FP.touchupBoundary().Color, ProportionalTouchup->value(), FixedTouchup->value());
+    if (FreezeUpdate)
+        return;
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    FP.touchup(FP.touchupBoundary().Color, ProportionalTouchup->value(), FixedTouchup->value());
 }
 
 void PaintStyleEditor::on_FixedTouchup_valueChanged()
 {
-	on_ProportionalTouchup_valueChanged();
+    on_ProportionalTouchup_valueChanged();
 }
 
 
 void PaintStyleEditor::on_TouchupDashed_clicked()
 {
-	if (FreezeUpdate)
-		return;
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	if (TouchupDashed->isChecked())
-		FP.touchupDash(TouchupDashOn->value(), TouchupDashOff->value());
-	else
-		FP.clearTouchupDash();
+    if (FreezeUpdate)
+        return;
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    if (TouchupDashed->isChecked())
+        FP.touchupDash(TouchupDashOn->value(), TouchupDashOff->value());
+    else
+        FP.clearTouchupDash();
 }
 
 void PaintStyleEditor::on_TouchupDashOff_valueChanged()
 {
-	on_TouchupDashed_clicked();
+    on_TouchupDashed_clicked();
 }
 
 void PaintStyleEditor::on_TouchupDashOn_valueChanged()
 {
-	on_TouchupDashed_clicked();
+    on_TouchupDashed_clicked();
 }
 
 void PaintStyleEditor::on_DrawFill_clicked(bool b)
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	thePainters[idx].fillActive(b);
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    thePainters[idx].fillActive(b);
 
-	updatePagesIcons();
+    updatePagesIcons();
 }
 
 void PaintStyleEditor::on_FillColor_clicked()
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	QColor rgb = QColorDialog::getColor(FP.fillColor(), this
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    QColor rgb = QColorDialog::getColor(FP.fillColor(), this
 #if (QT_VERSION >= QT_VERSION_CHECK(4, 5, 0))
                                             , tr("Select Color"), QColorDialog::ShowAlphaChannel
 #endif
                                            );
-	if (rgb.isValid()) {
-		makeBoundaryIcon(FillColor, rgb);
-		FP.foregroundFill(rgb);
-	}
+    if (rgb.isValid()) {
+        makeBoundaryIcon(FillColor, rgb);
+        FP.foregroundFill(rgb);
+    }
 }
 
 void PaintStyleEditor::on_DrawIcon_clicked(bool b)
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	thePainters[idx].iconActive(b);
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    thePainters[idx].iconActive(b);
 
-	updatePagesIcons();
+    updatePagesIcons();
 }
 
 void PaintStyleEditor::on_IconName_textEdited()
 {
-	if (FreezeUpdate)
-		return;
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	FP.setIcon(IconName->text(), ProportionalIcon->value(), FixedIcon->value());
+    if (FreezeUpdate)
+        return;
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    FP.setIcon(IconName->text(), ProportionalIcon->value(), FixedIcon->value());
 }
 
 void PaintStyleEditor::on_ProportionalIcon_valueChanged()
 {
-	on_IconName_textEdited();
+    on_IconName_textEdited();
 }
 
 void PaintStyleEditor::on_FixedIcon_valueChanged()
 {
-	on_IconName_textEdited();
+    on_IconName_textEdited();
 }
 
 void PaintStyleEditor::on_DrawLabel_clicked(bool b)
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	thePainters[idx].labelActive(b);
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    thePainters[idx].labelActive(b);
 
-	updatePagesIcons();
+    updatePagesIcons();
 }
 
 void PaintStyleEditor::on_LabelHalo_clicked(bool b)
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	thePainters[idx].labelHalo(b);
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    thePainters[idx].labelHalo(b);
 }
 
 void PaintStyleEditor::on_LabelArea_clicked(bool b)
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	thePainters[idx].labelArea(b);
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    thePainters[idx].labelArea(b);
 }
 
 void PaintStyleEditor::on_LabelTag_textEdited()
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	thePainters[idx].labelTag(LabelTag->text());
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    thePainters[idx].labelTag(LabelTag->text());
 }
 
 void PaintStyleEditor::on_LabelBackgroundTag_textEdited()
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	thePainters[idx].labelBackgroundTag(LabelBackgroundTag->text());
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    thePainters[idx].labelBackgroundTag(LabelBackgroundTag->text());
 }
 
 void PaintStyleEditor::on_LabelColor_clicked()
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	QColor rgb = QColorDialog::getColor(FP.labelBoundary().Color, this
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    QColor rgb = QColorDialog::getColor(FP.labelBoundary().Color, this
 #if (QT_VERSION >= QT_VERSION_CHECK(4, 5, 0))
                                             , tr("Select Color"), QColorDialog::ShowAlphaChannel
 #endif
                                            );
-	if (rgb.isValid()) {
-		makeBoundaryIcon(LabelColor, rgb);
-		FP.label(rgb, ProportionalLabel->value(), FixedLabel->value());
-	}
+    if (rgb.isValid()) {
+        makeBoundaryIcon(LabelColor, rgb);
+        FP.label(rgb, ProportionalLabel->value(), FixedLabel->value());
+    }
 }
 
 void PaintStyleEditor::on_ProportionalLabel_valueChanged()
 {
-	if (FreezeUpdate)
-		return;
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	FP.label(FP.labelBoundary().Color, ProportionalLabel->value(), FixedLabel->value());
+    if (FreezeUpdate)
+        return;
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    FP.label(FP.labelBoundary().Color, ProportionalLabel->value(), FixedLabel->value());
 }
 
 void PaintStyleEditor::on_FixedLabel_valueChanged()
 {
-	on_ProportionalLabel_valueChanged();
+    on_ProportionalLabel_valueChanged();
 }
 
 void PaintStyleEditor::on_DrawLabelBackground_clicked(bool b)
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	thePainters[idx].labelBackgroundActive(b);
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    thePainters[idx].labelBackgroundActive(b);
 }
 
 void PaintStyleEditor::on_LabelBackgroundlColor_clicked()
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	QColor rgb = QColorDialog::getColor(FP.labelBackgroundColor(), this
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    QColor rgb = QColorDialog::getColor(FP.labelBackgroundColor(), this
 #if (QT_VERSION >= QT_VERSION_CHECK(4, 5, 0))
                                             , tr("Select Color"), QColorDialog::ShowAlphaChannel
 #endif
                                            );
-	if (rgb.isValid()) {
-		makeBoundaryIcon(LabelBackgroundlColor, rgb);
-		FP.labelBackground(rgb);
-	}
+    if (rgb.isValid()) {
+        makeBoundaryIcon(LabelBackgroundlColor, rgb);
+        FP.labelBackground(rgb);
+    }
 }
 
 void PaintStyleEditor::on_LabelFont_currentFontChanged(const QFont & font)
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	thePainters[idx].setLabelFont(font.toString());
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    thePainters[idx].setLabelFont(font.toString());
 }
 
 void PaintStyleEditor::updatePaintList()
 {
-	int idx = PaintList->currentRow();
-	if (idx >= thePainters.size())
-		return;
-	FeaturePainter& FP(thePainters[idx]);
-	FP.setSelector(TagSelection->text());
-	PaintList->currentItem()->setText(FP.userName());
+    int idx = PaintList->currentRow();
+    if (idx >= thePainters.size())
+        return;
+    FeaturePainter& FP(thePainters[idx]);
+    FP.setSelector(TagSelection->text());
+    PaintList->currentItem()->setText(FP.userName());
 }
 
 void PaintStyleEditor::on_buttonBox_clicked(QAbstractButton * button)
 {
-	if (buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole) {
-		emit(stylesApplied(&thePainters));
-	}
+    if (buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole) {
+        emit(stylesApplied(&thePainters));
+    }
 }
 
diff --git a/src/PaintStyle/PaintStyleEditor.ui b/src/PaintStyle/PaintStyleEditor.ui
index 3b23bf4..29fe421 100644
--- a/src/PaintStyle/PaintStyleEditor.ui
+++ b/src/PaintStyle/PaintStyleEditor.ui
@@ -1,61 +1,62 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>PaintStyleEditor</class>
- <widget class="QDialog" name="PaintStyleEditor" >
-  <property name="geometry" >
+ <widget class="QDialog" name="PaintStyleEditor">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>719</width>
-    <height>544</height>
+    <height>560</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>Map style editor</string>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout_5" >
+  <layout class="QVBoxLayout" name="verticalLayout_5">
    <item>
-    <widget class="QGroupBox" name="groupBox_5" >
-     <property name="title" >
+    <widget class="QGroupBox" name="groupBox_5">
+     <property name="title">
       <string>Global</string>
      </property>
-     <layout class="QVBoxLayout" name="verticalLayout_6" >
-      <property name="spacing" >
+     <layout class="QVBoxLayout" name="verticalLayout_6">
+      <property name="spacing">
        <number>2</number>
       </property>
-      <property name="margin" >
+      <property name="margin">
        <number>2</number>
       </property>
       <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_6" >
+       <layout class="QHBoxLayout" name="horizontalLayout_6">
         <item>
-         <widget class="QCheckBox" name="DrawGlobalBackground" >
-          <property name="text" >
+         <widget class="QCheckBox" name="DrawGlobalBackground">
+          <property name="text">
            <string>Background</string>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QToolButton" name="GlobalBackgroundColor" >
-          <property name="enabled" >
+         <widget class="QToolButton" name="GlobalBackgroundColor">
+          <property name="enabled">
            <bool>false</bool>
           </property>
-          <property name="minimumSize" >
+          <property name="minimumSize">
            <size>
             <width>45</width>
             <height>25</height>
            </size>
           </property>
-          <property name="text" >
+          <property name="text">
            <string>...</string>
           </property>
          </widget>
         </item>
         <item>
-         <spacer name="horizontalSpacer_6" >
-          <property name="orientation" >
+         <spacer name="horizontalSpacer_6">
+          <property name="orientation">
            <enum>Qt::Horizontal</enum>
           </property>
-          <property name="sizeHint" stdset="0" >
+          <property name="sizeHint" stdset="0">
            <size>
             <width>40</width>
             <height>20</height>
@@ -69,34 +70,34 @@
     </widget>
    </item>
    <item>
-    <layout class="QHBoxLayout" name="horizontalLayout_2" >
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
      <item>
-      <layout class="QVBoxLayout" name="verticalLayout_8" >
+      <layout class="QVBoxLayout" name="verticalLayout_8">
        <item>
-        <layout class="QHBoxLayout" >
-         <property name="spacing" >
+        <layout class="QHBoxLayout">
+         <property name="spacing">
           <number>6</number>
          </property>
-         <property name="margin" >
+         <property name="margin">
           <number>0</number>
          </property>
          <item>
-          <widget class="QPushButton" name="AddButton" >
-           <property name="text" >
+          <widget class="QPushButton" name="AddButton">
+           <property name="text">
             <string>Add</string>
            </property>
           </widget>
          </item>
          <item>
-          <widget class="QPushButton" name="RemoveButton" >
-           <property name="text" >
+          <widget class="QPushButton" name="RemoveButton">
+           <property name="text">
             <string>Remove</string>
            </property>
           </widget>
          </item>
          <item>
-          <widget class="QPushButton" name="DuplicateButton" >
-           <property name="text" >
+          <widget class="QPushButton" name="DuplicateButton">
+           <property name="text">
             <string>Duplicate</string>
            </property>
           </widget>
@@ -104,11 +105,11 @@
         </layout>
        </item>
        <item>
-        <layout class="QHBoxLayout" name="horizontalLayout" >
+        <layout class="QHBoxLayout" name="horizontalLayout">
          <item>
-          <widget class="QListWidget" name="PaintList" >
-           <property name="sizePolicy" >
-            <sizepolicy vsizetype="Expanding" hsizetype="Minimum" >
+          <widget class="QListWidget" name="PaintList">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
@@ -116,35 +117,35 @@
           </widget>
          </item>
          <item>
-          <layout class="QVBoxLayout" name="verticalLayout_7" >
+          <layout class="QVBoxLayout" name="verticalLayout_7">
            <item>
-            <widget class="QToolButton" name="btUp" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Expanding" hsizetype="Fixed" >
+            <widget class="QToolButton" name="btUp">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
                <horstretch>0</horstretch>
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
-             <property name="text" >
+             <property name="text">
               <string>...</string>
              </property>
-             <property name="arrowType" >
+             <property name="arrowType">
               <enum>Qt::UpArrow</enum>
              </property>
             </widget>
            </item>
            <item>
-            <widget class="QToolButton" name="btDown" >
-             <property name="sizePolicy" >
-              <sizepolicy vsizetype="Expanding" hsizetype="Fixed" >
+            <widget class="QToolButton" name="btDown">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
                <horstretch>0</horstretch>
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
-             <property name="text" >
+             <property name="text">
               <string>...</string>
              </property>
-             <property name="arrowType" >
+             <property name="arrowType">
               <enum>Qt::DownArrow</enum>
              </property>
             </widget>
@@ -156,1246 +157,1258 @@
       </layout>
      </item>
      <item>
-      <layout class="QVBoxLayout" >
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <property name="margin" >
-        <number>0</number>
-       </property>
-       <item>
-        <layout class="QGridLayout" >
-         <property name="margin" >
-          <number>0</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item row="0" column="0" >
-          <widget class="QLabel" name="label" >
-           <property name="text" >
-            <string>Tag selection</string>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="1" >
-          <widget class="QLineEdit" name="TagSelection" />
-         </item>
-        </layout>
-       </item>
-       <item>
-        <layout class="QGridLayout" >
-         <property name="margin" >
-          <number>0</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item row="0" column="2" >
-          <widget class="QLabel" name="label_6" >
-           <property name="text" >
-            <string>meter/pixel</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1" >
-          <widget class="QDoubleSpinBox" name="LowerZoomBoundary" >
-           <property name="sizePolicy" >
-            <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="decimals" >
-            <number>0</number>
-           </property>
-           <property name="minimum" >
-            <double>0.000000000000000</double>
-           </property>
-           <property name="maximum" >
-            <double>99999.000000000000000</double>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="0" >
-          <widget class="QLabel" name="label_5" >
-           <property name="text" >
-            <string>Visible up to</string>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="0" >
-          <widget class="QLabel" name="label_4" >
-           <property name="text" >
-            <string>Visible from scale</string>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="1" >
-          <widget class="QDoubleSpinBox" name="UpperZoomBoundary" >
-           <property name="decimals" >
-            <number>0</number>
-           </property>
-           <property name="minimum" >
-            <double>0.000000000000000</double>
-           </property>
-           <property name="maximum" >
-            <double>99999.000000000000000</double>
-           </property>
-           <property name="singleStep" >
-            <double>100.000000000000000</double>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="2" >
-          <widget class="QLabel" name="label_7" >
-           <property name="text" >
-            <string>meter/pixel</string>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="3" >
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0" >
-            <size>
-             <width>40</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="QToolBox" name="tbStyle" >
-         <property name="minimumSize" >
-          <size>
-           <width>400</width>
-           <height>350</height>
-          </size>
-         </property>
-         <property name="currentIndex" >
-          <number>0</number>
-         </property>
-         <property name="tabSpacing" >
-          <number>6</number>
-         </property>
-         <widget class="QWidget" name="pgBackground" >
-          <property name="geometry" >
-           <rect>
-            <x>0</x>
-            <y>0</y>
-            <width>400</width>
-            <height>238</height>
-           </rect>
-          </property>
-          <attribute name="label" >
-           <string>Background</string>
-          </attribute>
-          <layout class="QVBoxLayout" name="verticalLayout_9" >
-           <item>
-            <layout class="QHBoxLayout" >
-             <property name="spacing" >
-              <number>6</number>
-             </property>
-             <property name="margin" >
-              <number>0</number>
-             </property>
-             <item>
-              <widget class="QCheckBox" name="DrawForeground" >
-               <property name="text" >
-                <string>Draw with color</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QToolButton" name="ForegroundColor" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="minimumSize" >
-                <size>
-                 <width>45</width>
-                 <height>25</height>
-                </size>
-               </property>
-               <property name="text" >
-                <string>...</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" >
-             <property name="spacing" >
-              <number>6</number>
-             </property>
-             <property name="margin" >
-              <number>0</number>
-             </property>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType" >
-                <enum>QSizePolicy::Minimum</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_10" >
-               <property name="text" >
-                <string>Proportional thickness</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="ProportionalForeground" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="decimals" >
-                <number>1</number>
-               </property>
-               <property name="singleStep" >
-                <double>0.500000000000000</double>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_11" >
-               <property name="text" >
-                <string>Fixed thickness</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="FixedForeground" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="decimals" >
-                <number>1</number>
-               </property>
-               <property name="singleStep" >
-                <double>0.500000000000000</double>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" >
-             <property name="spacing" >
-              <number>6</number>
-             </property>
-             <property name="margin" >
-              <number>0</number>
-             </property>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType" >
-                <enum>QSizePolicy::Minimum</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="ForegroundDashed" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="text" >
-                <string>Dashed</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="ForegroundDashOn" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_12" >
-               <property name="text" >
-                <string>off</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="ForegroundDashOff" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" >
-             <property name="spacing" >
-              <number>6</number>
-             </property>
-             <property name="margin" >
-              <number>0</number>
-             </property>
-             <item>
-              <widget class="QCheckBox" name="DrawFill" >
-               <property name="text" >
-                <string>Fill area</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QToolButton" name="FillColor" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="minimumSize" >
-                <size>
-                 <width>45</width>
-                 <height>25</height>
-                </size>
-               </property>
-               <property name="text" >
-                <string>...</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <spacer name="verticalSpacer_2" >
-             <property name="orientation" >
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0" >
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="pgBoundary" >
-          <property name="geometry" >
-           <rect>
-            <x>0</x>
-            <y>0</y>
-            <width>400</width>
-            <height>238</height>
-           </rect>
-          </property>
-          <attribute name="label" >
-           <string>Boundary</string>
-          </attribute>
-          <layout class="QVBoxLayout" name="verticalLayout_2" >
-           <item>
-            <layout class="QHBoxLayout" >
-             <property name="spacing" >
-              <number>6</number>
-             </property>
-             <property name="margin" >
-              <number>0</number>
-             </property>
-             <item>
-              <widget class="QCheckBox" name="DrawBackground" >
-               <property name="text" >
-                <string>Draw with color</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QToolButton" name="BackgroundColor" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="minimumSize" >
-                <size>
-                 <width>45</width>
-                 <height>25</height>
-                </size>
-               </property>
-               <property name="text" >
-                <string>...</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" >
-             <property name="spacing" >
-              <number>6</number>
-             </property>
-             <property name="margin" >
-              <number>0</number>
-             </property>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType" >
-                <enum>QSizePolicy::Minimum</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_8" >
-               <property name="text" >
-                <string>Proportional thickness</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="ProportionalBackground" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="decimals" >
-                <number>1</number>
-               </property>
-               <property name="singleStep" >
-                <double>0.500000000000000</double>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_9" >
-               <property name="text" >
-                <string>Fixed thickness</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="FixedBackground" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="decimals" >
-                <number>1</number>
-               </property>
-               <property name="singleStep" >
-                <double>0.500000000000000</double>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <spacer name="verticalSpacer_3" >
-             <property name="orientation" >
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0" >
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="pgTouchup" >
-          <property name="geometry" >
-           <rect>
-            <x>0</x>
-            <y>0</y>
-            <width>400</width>
-            <height>238</height>
-           </rect>
+      <widget class="QWidget" name="editArea" native="true">
+       <layout class="QVBoxLayout" name="verticalLayout_4">
+        <property name="spacing">
+         <number>0</number>
+        </property>
+        <property name="margin">
+         <number>0</number>
+        </property>
+        <item>
+         <layout class="QVBoxLayout" name="_2">
+          <property name="spacing">
+           <number>6</number>
           </property>
-          <attribute name="label" >
-           <string>Touchup</string>
-          </attribute>
-          <layout class="QVBoxLayout" name="verticalLayout" >
-           <item>
-            <layout class="QHBoxLayout" >
-             <property name="spacing" >
-              <number>6</number>
-             </property>
-             <property name="margin" >
-              <number>0</number>
-             </property>
-             <item>
-              <widget class="QCheckBox" name="DrawTouchup" >
-               <property name="text" >
-                <string>Draw steps</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QToolButton" name="TouchupColor" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="minimumSize" >
-                <size>
-                 <width>45</width>
-                 <height>25</height>
-                </size>
-               </property>
-               <property name="text" >
-                <string>...</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" >
-             <property name="spacing" >
-              <number>6</number>
-             </property>
-             <property name="margin" >
-              <number>0</number>
-             </property>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType" >
-                <enum>QSizePolicy::Minimum</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_14" >
-               <property name="text" >
-                <string>Proportional thickness</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="ProportionalTouchup" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="decimals" >
-                <number>1</number>
-               </property>
-               <property name="singleStep" >
-                <double>0.500000000000000</double>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_15" >
-               <property name="text" >
-                <string>Fixed thickness</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="FixedTouchup" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="decimals" >
-                <number>1</number>
-               </property>
-               <property name="singleStep" >
-                <double>0.500000000000000</double>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" >
-             <property name="spacing" >
-              <number>6</number>
-             </property>
-             <property name="margin" >
-              <number>0</number>
-             </property>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType" >
-                <enum>QSizePolicy::Minimum</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="TouchupDashed" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="text" >
-                <string>Dashed</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="TouchupDashOn" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_13" >
-               <property name="text" >
-                <string>off</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="TouchupDashOff" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" >
-             <property name="spacing" >
-              <number>6</number>
-             </property>
-             <property name="margin" >
-              <number>0</number>
-             </property>
-             <item>
-              <widget class="QCheckBox" name="DrawIcon" >
-               <property name="text" >
-                <string>Draw icon</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="IconName" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="_2" >
-             <property name="spacing" >
-              <number>6</number>
-             </property>
-             <property name="margin" >
-              <number>0</number>
-             </property>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType" >
-                <enum>QSizePolicy::Minimum</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_19" >
-               <property name="text" >
-                <string>Proportional thickness</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="ProportionalIcon" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="decimals" >
-                <number>1</number>
-               </property>
-               <property name="singleStep" >
-                <double>0.500000000000000</double>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_20" >
-               <property name="text" >
-                <string>Fixed thickness</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="FixedIcon" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="decimals" >
-                <number>1</number>
-               </property>
-               <property name="singleStep" >
-                <double>0.500000000000000</double>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <spacer name="verticalSpacer_4" >
-             <property name="orientation" >
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0" >
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="pgLabel" >
-          <property name="geometry" >
-           <rect>
-            <x>0</x>
-            <y>0</y>
-            <width>400</width>
-            <height>238</height>
-           </rect>
+          <property name="margin">
+           <number>0</number>
           </property>
-          <attribute name="label" >
-           <string>Label</string>
-          </attribute>
-          <layout class="QVBoxLayout" name="verticalLayout_3" >
-           <item>
-            <layout class="QHBoxLayout" name="_5" >
-             <property name="spacing" >
-              <number>6</number>
-             </property>
-             <property name="margin" >
-              <number>0</number>
-             </property>
-             <item>
-              <widget class="QCheckBox" name="DrawLabel" >
-               <property name="text" >
-                <string>Draw with color</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QToolButton" name="LabelColor" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="minimumSize" >
-                <size>
-                 <width>45</width>
-                 <height>25</height>
-                </size>
-               </property>
-               <property name="text" >
-                <string>...</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_2" >
-               <property name="text" >
-                <string>Font</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QFontComboBox" name="LabelFont" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_3" >
-             <item>
-              <spacer name="horizontalSpacer_2" >
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType" >
-                <enum>QSizePolicy::Minimum</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_3" >
-               <property name="text" >
-                <string>Label tag</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="LabelTag" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontallayout_3" >
-             <property name="spacing" >
-              <number>6</number>
+          <item>
+           <layout class="QGridLayout" name="_3">
+            <property name="margin">
+             <number>0</number>
+            </property>
+            <property name="spacing">
+             <number>6</number>
+            </property>
+            <item row="0" column="0">
+             <widget class="QLabel" name="label">
+              <property name="text">
+               <string>Tag selection</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1">
+             <widget class="QLineEdit" name="TagSelection"/>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <layout class="QGridLayout" name="_4">
+            <property name="margin">
+             <number>0</number>
+            </property>
+            <property name="spacing">
+             <number>6</number>
+            </property>
+            <item row="0" column="2">
+             <widget class="QLabel" name="label_6">
+              <property name="text">
+               <string>meter/pixel</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="1">
+             <widget class="QDoubleSpinBox" name="LowerZoomBoundary">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="decimals">
+               <number>0</number>
+              </property>
+              <property name="minimum">
+               <double>0.000000000000000</double>
+              </property>
+              <property name="maximum">
+               <double>99999.000000000000000</double>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="0">
+             <widget class="QLabel" name="label_5">
+              <property name="text">
+               <string>Visible up to</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="0">
+             <widget class="QLabel" name="label_4">
+              <property name="text">
+               <string>Visible from scale</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1">
+             <widget class="QDoubleSpinBox" name="UpperZoomBoundary">
+              <property name="decimals">
+               <number>0</number>
+              </property>
+              <property name="minimum">
+               <double>0.000000000000000</double>
+              </property>
+              <property name="maximum">
+               <double>99999.000000000000000</double>
+              </property>
+              <property name="singleStep">
+               <double>100.000000000000000</double>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="2">
+             <widget class="QLabel" name="label_7">
+              <property name="text">
+               <string>meter/pixel</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="3">
+             <spacer>
+              <property name="orientation">
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" stdset="0">
+               <size>
+                <width>40</width>
+                <height>20</height>
+               </size>
+              </property>
+             </spacer>
+            </item>
+           </layout>
+          </item>
+          <item>
+           <widget class="QToolBox" name="tbStyle">
+            <property name="minimumSize">
+             <size>
+              <width>400</width>
+              <height>350</height>
+             </size>
+            </property>
+            <property name="currentIndex">
+             <number>0</number>
+            </property>
+            <property name="tabSpacing">
+             <number>6</number>
+            </property>
+            <widget class="QWidget" name="pgBackground">
+             <property name="geometry">
+              <rect>
+               <x>0</x>
+               <y>0</y>
+               <width>401</width>
+               <height>242</height>
+              </rect>
              </property>
-             <property name="margin" >
-              <number>0</number>
-             </property>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType" >
-                <enum>QSizePolicy::Minimum</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_16" >
-               <property name="text" >
-                <string>Proportional thickness</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="ProportionalLabel" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="decimals" >
-                <number>1</number>
-               </property>
-               <property name="singleStep" >
-                <double>0.500000000000000</double>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_17" >
-               <property name="text" >
-                <string>Fixed thickness</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QDoubleSpinBox" name="FixedLabel" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="decimals" >
-                <number>1</number>
-               </property>
-               <property name="singleStep" >
-                <double>0.500000000000000</double>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_5" >
-             <item>
-              <spacer name="horizontalSpacer_4" >
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType" >
-                <enum>QSizePolicy::Minimum</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="LabelHalo" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="text" >
-                <string>Halo</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="LabelArea" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="text" >
-                <string>Area</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_5" >
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="_4" >
-             <property name="spacing" >
-              <number>6</number>
-             </property>
-             <property name="margin" >
-              <number>0</number>
+             <attribute name="label">
+              <string>Background</string>
+             </attribute>
+             <layout class="QVBoxLayout" name="verticalLayout_9">
+              <item>
+               <layout class="QHBoxLayout" name="_5">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <widget class="QCheckBox" name="DrawForeground">
+                  <property name="text">
+                   <string>Draw with color</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QToolButton" name="ForegroundColor">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="minimumSize">
+                   <size>
+                    <width>45</width>
+                    <height>25</height>
+                   </size>
+                  </property>
+                  <property name="text">
+                   <string>...</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="_6">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Minimum</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_10">
+                  <property name="text">
+                   <string>Proportional thickness</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="ProportionalForeground">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="decimals">
+                   <number>1</number>
+                  </property>
+                  <property name="singleStep">
+                   <double>0.500000000000000</double>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_11">
+                  <property name="text">
+                   <string>Fixed thickness</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="FixedForeground">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="decimals">
+                   <number>1</number>
+                  </property>
+                  <property name="singleStep">
+                   <double>0.500000000000000</double>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="_7">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Minimum</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item>
+                 <widget class="QCheckBox" name="ForegroundDashed">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="text">
+                   <string>Dashed</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="ForegroundDashOn">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_12">
+                  <property name="text">
+                   <string>off</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="ForegroundDashOff">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="_8">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <widget class="QCheckBox" name="DrawFill">
+                  <property name="text">
+                   <string>Fill area</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QToolButton" name="FillColor">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="minimumSize">
+                   <size>
+                    <width>45</width>
+                    <height>25</height>
+                   </size>
+                  </property>
+                  <property name="text">
+                   <string>...</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <spacer name="verticalSpacer_2">
+                <property name="orientation">
+                 <enum>Qt::Vertical</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>20</width>
+                  <height>40</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+             </layout>
+            </widget>
+            <widget class="QWidget" name="pgBoundary">
+             <property name="geometry">
+              <rect>
+               <x>0</x>
+               <y>0</y>
+               <width>384</width>
+               <height>83</height>
+              </rect>
              </property>
-             <item>
-              <spacer name="horizontalSpacer" >
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType" >
-                <enum>QSizePolicy::Minimum</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="DrawLabelBackground" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="text" >
-                <string>Draw with background color</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QToolButton" name="LabelBackgroundlColor" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-               <property name="minimumSize" >
-                <size>
-                 <width>45</width>
-                 <height>25</height>
-                </size>
-               </property>
-               <property name="text" >
-                <string>...</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer>
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_4" >
-             <item>
-              <spacer name="horizontalSpacer_3" >
-               <property name="orientation" >
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType" >
-                <enum>QSizePolicy::Minimum</enum>
-               </property>
-               <property name="sizeHint" stdset="0" >
-                <size>
-                 <width>60</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_18" >
-               <property name="text" >
-                <string>Label with background tag</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLineEdit" name="LabelBackgroundTag" >
-               <property name="enabled" >
-                <bool>false</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <spacer name="verticalSpacer_5" >
-             <property name="orientation" >
-              <enum>Qt::Vertical</enum>
+             <attribute name="label">
+              <string>Boundary</string>
+             </attribute>
+             <layout class="QVBoxLayout" name="verticalLayout_2">
+              <item>
+               <layout class="QHBoxLayout" name="_9">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <widget class="QCheckBox" name="DrawBackground">
+                  <property name="text">
+                   <string>Draw with color</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QToolButton" name="BackgroundColor">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="minimumSize">
+                   <size>
+                    <width>45</width>
+                    <height>25</height>
+                   </size>
+                  </property>
+                  <property name="text">
+                   <string>...</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="_10">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Minimum</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_8">
+                  <property name="text">
+                   <string>Proportional thickness</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="ProportionalBackground">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="decimals">
+                   <number>1</number>
+                  </property>
+                  <property name="singleStep">
+                   <double>0.500000000000000</double>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_9">
+                  <property name="text">
+                   <string>Fixed thickness</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="FixedBackground">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="decimals">
+                   <number>1</number>
+                  </property>
+                  <property name="singleStep">
+                   <double>0.500000000000000</double>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <spacer name="verticalSpacer_3">
+                <property name="orientation">
+                 <enum>Qt::Vertical</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>20</width>
+                  <height>40</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+             </layout>
+            </widget>
+            <widget class="QWidget" name="pgTouchup">
+             <property name="geometry">
+              <rect>
+               <x>0</x>
+               <y>0</y>
+               <width>384</width>
+               <height>179</height>
+              </rect>
              </property>
-             <property name="sizeHint" stdset="0" >
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
+             <attribute name="label">
+              <string>Touchup</string>
+             </attribute>
+             <layout class="QVBoxLayout" name="verticalLayout">
+              <item>
+               <layout class="QHBoxLayout" name="_11">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <widget class="QCheckBox" name="DrawTouchup">
+                  <property name="text">
+                   <string>Draw steps</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QToolButton" name="TouchupColor">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="minimumSize">
+                   <size>
+                    <width>45</width>
+                    <height>25</height>
+                   </size>
+                  </property>
+                  <property name="text">
+                   <string>...</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="_12">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Minimum</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_14">
+                  <property name="text">
+                   <string>Proportional thickness</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="ProportionalTouchup">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="decimals">
+                   <number>1</number>
+                  </property>
+                  <property name="singleStep">
+                   <double>0.500000000000000</double>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_15">
+                  <property name="text">
+                   <string>Fixed thickness</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="FixedTouchup">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="decimals">
+                   <number>1</number>
+                  </property>
+                  <property name="singleStep">
+                   <double>0.500000000000000</double>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="_13">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Minimum</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item>
+                 <widget class="QCheckBox" name="TouchupDashed">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="text">
+                   <string>Dashed</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="TouchupDashOn">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_13">
+                  <property name="text">
+                   <string>off</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="TouchupDashOff">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="_14">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <widget class="QCheckBox" name="DrawIcon">
+                  <property name="text">
+                   <string>Draw icon</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QLineEdit" name="IconName">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                 </widget>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="_15">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Minimum</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_19">
+                  <property name="text">
+                   <string>Proportional thickness</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="ProportionalIcon">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="decimals">
+                   <number>1</number>
+                  </property>
+                  <property name="singleStep">
+                   <double>0.500000000000000</double>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_20">
+                  <property name="text">
+                   <string>Fixed thickness</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="FixedIcon">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="decimals">
+                   <number>1</number>
+                  </property>
+                  <property name="singleStep">
+                   <double>0.500000000000000</double>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <spacer name="verticalSpacer_4">
+                <property name="orientation">
+                 <enum>Qt::Vertical</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>20</width>
+                  <height>40</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+             </layout>
+            </widget>
+            <widget class="QWidget" name="pgLabel">
+             <property name="geometry">
+              <rect>
+               <x>0</x>
+               <y>0</y>
+               <width>384</width>
+               <height>211</height>
+              </rect>
              </property>
-            </spacer>
-           </item>
-          </layout>
-         </widget>
-        </widget>
-       </item>
-      </layout>
+             <attribute name="label">
+              <string>Label</string>
+             </attribute>
+             <layout class="QVBoxLayout" name="verticalLayout_3">
+              <item>
+               <layout class="QHBoxLayout" name="_16">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <widget class="QCheckBox" name="DrawLabel">
+                  <property name="text">
+                   <string>Draw with color</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QToolButton" name="LabelColor">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="minimumSize">
+                   <size>
+                    <width>45</width>
+                    <height>25</height>
+                   </size>
+                  </property>
+                  <property name="text">
+                   <string>...</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_2">
+                  <property name="text">
+                   <string>Font</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QFontComboBox" name="LabelFont">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="horizontalLayout_3">
+                <item>
+                 <spacer name="horizontalSpacer_2">
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Minimum</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_3">
+                  <property name="text">
+                   <string>Label tag</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QLineEdit" name="LabelTag">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                 </widget>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="horizontallayout_3">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Minimum</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_16">
+                  <property name="text">
+                   <string>Proportional thickness</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="ProportionalLabel">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="decimals">
+                   <number>1</number>
+                  </property>
+                  <property name="singleStep">
+                   <double>0.500000000000000</double>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_17">
+                  <property name="text">
+                   <string>Fixed thickness</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QDoubleSpinBox" name="FixedLabel">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="decimals">
+                   <number>1</number>
+                  </property>
+                  <property name="singleStep">
+                   <double>0.500000000000000</double>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="horizontalLayout_5">
+                <item>
+                 <spacer name="horizontalSpacer_4">
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Minimum</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item>
+                 <widget class="QCheckBox" name="LabelHalo">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="text">
+                   <string>Halo</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QCheckBox" name="LabelArea">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="text">
+                   <string>Area</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer name="horizontalSpacer_5">
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="_17">
+                <property name="spacing">
+                 <number>6</number>
+                </property>
+                <property name="margin">
+                 <number>0</number>
+                </property>
+                <item>
+                 <spacer name="horizontalSpacer">
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Minimum</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item>
+                 <widget class="QCheckBox" name="DrawLabelBackground">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="text">
+                   <string>Draw with background color</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QToolButton" name="LabelBackgroundlColor">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                  <property name="minimumSize">
+                   <size>
+                    <width>45</width>
+                    <height>25</height>
+                   </size>
+                  </property>
+                  <property name="text">
+                   <string>...</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer>
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="horizontalLayout_4">
+                <item>
+                 <spacer name="horizontalSpacer_3">
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Minimum</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>60</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item>
+                 <widget class="QLabel" name="label_18">
+                  <property name="text">
+                   <string>Label with background tag</string>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QLineEdit" name="LabelBackgroundTag">
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+                 </widget>
+                </item>
+               </layout>
+              </item>
+              <item>
+               <spacer name="verticalSpacer_5">
+                <property name="orientation">
+                 <enum>Qt::Vertical</enum>
+                </property>
+                <property name="sizeHint" stdset="0">
+                 <size>
+                  <width>20</width>
+                  <height>40</height>
+                 </size>
+                </property>
+               </spacer>
+              </item>
+             </layout>
+            </widget>
+           </widget>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
      </item>
     </layout>
    </item>
    <item>
-    <spacer name="verticalSpacer" >
-     <property name="orientation" >
+    <spacer name="verticalSpacer">
+     <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
-     <property name="sizeHint" stdset="0" >
+     <property name="sizeHint" stdset="0">
       <size>
        <width>20</width>
        <height>40</height>
@@ -1404,11 +1417,11 @@
     </spacer>
    </item>
    <item>
-    <widget class="QDialogButtonBox" name="buttonBox" >
-     <property name="orientation" >
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
       <enum>Qt::Horizontal</enum>
      </property>
-     <property name="standardButtons" >
+     <property name="standardButtons">
       <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
      </property>
     </widget>
@@ -1419,42 +1432,9 @@
   <tabstop>AddButton</tabstop>
   <tabstop>RemoveButton</tabstop>
   <tabstop>PaintList</tabstop>
-  <tabstop>TagSelection</tabstop>
-  <tabstop>UpperZoomBoundary</tabstop>
-  <tabstop>LowerZoomBoundary</tabstop>
-  <tabstop>DrawForeground</tabstop>
-  <tabstop>ForegroundColor</tabstop>
-  <tabstop>ProportionalForeground</tabstop>
-  <tabstop>FixedForeground</tabstop>
-  <tabstop>ForegroundDashed</tabstop>
-  <tabstop>ForegroundDashOn</tabstop>
-  <tabstop>ForegroundDashOff</tabstop>
-  <tabstop>DrawFill</tabstop>
-  <tabstop>FillColor</tabstop>
-  <tabstop>DrawBackground</tabstop>
-  <tabstop>BackgroundColor</tabstop>
-  <tabstop>ProportionalBackground</tabstop>
-  <tabstop>FixedBackground</tabstop>
-  <tabstop>DrawTouchup</tabstop>
-  <tabstop>TouchupColor</tabstop>
-  <tabstop>ProportionalTouchup</tabstop>
-  <tabstop>FixedTouchup</tabstop>
-  <tabstop>TouchupDashed</tabstop>
-  <tabstop>TouchupDashOn</tabstop>
-  <tabstop>TouchupDashOff</tabstop>
-  <tabstop>DrawIcon</tabstop>
-  <tabstop>IconName</tabstop>
-  <tabstop>DrawLabel</tabstop>
-  <tabstop>LabelColor</tabstop>
-  <tabstop>DrawLabelBackground</tabstop>
-  <tabstop>LabelBackgroundlColor</tabstop>
-  <tabstop>ProportionalLabel</tabstop>
-  <tabstop>FixedLabel</tabstop>
   <tabstop>buttonBox</tabstop>
  </tabstops>
- <resources>
-  <include location="../../Icons/AllIcons.qrc" />
- </resources>
+ <resources/>
  <connections>
   <connection>
    <sender>buttonBox</sender>
@@ -1462,11 +1442,11 @@
    <receiver>PaintStyleEditor</receiver>
    <slot>accept()</slot>
    <hints>
-    <hint type="sourcelabel" >
+    <hint type="sourcelabel">
      <x>317</x>
      <y>764</y>
     </hint>
-    <hint type="destinationlabel" >
+    <hint type="destinationlabel">
      <x>157</x>
      <y>274</y>
     </hint>
@@ -1478,479 +1458,31 @@
    <receiver>PaintStyleEditor</receiver>
    <slot>reject()</slot>
    <hints>
-    <hint type="sourcelabel" >
+    <hint type="sourcelabel">
      <x>385</x>
      <y>764</y>
     </hint>
-    <hint type="destinationlabel" >
+    <hint type="destinationlabel">
      <x>286</x>
      <y>274</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>DrawBackground</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>BackgroundColor</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>330</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>463</x>
-     <y>334</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawBackground</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>ProportionalBackground</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>330</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>519</x>
-     <y>360</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawBackground</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>FixedBackground</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>330</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>653</x>
-     <y>360</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawTouchup</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>ProportionalTouchup</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>392</x>
-     <y>413</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>519</x>
-     <y>443</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawTouchup</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>FixedTouchup</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>392</x>
-     <y>413</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>653</x>
-     <y>443</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawTouchup</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>TouchupDashed</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>392</x>
-     <y>413</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>420</x>
-     <y>468</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawTouchup</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>TouchupDashOff</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>392</x>
-     <y>413</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>550</x>
-     <y>469</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawIcon</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>IconName</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>385</x>
-     <y>494</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>704</x>
-     <y>477</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawTouchup</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>TouchupDashOn</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>392</x>
-     <y>413</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>475</x>
-     <y>469</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawLabelBackground</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>LabelBackgroundlColor</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>517</x>
-     <y>683</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>568</x>
-     <y>687</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawLabel</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>LabelColor</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>574</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>463</x>
-     <y>578</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawLabel</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>DrawLabelBackground</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>574</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>517</x>
-     <y>683</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawLabel</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>ProportionalLabel</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>574</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>519</x>
-     <y>630</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawLabel</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>FixedLabel</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>574</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>653</x>
-     <y>630</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawLabel</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>LabelFont</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>574</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>658</x>
-     <y>575</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawLabel</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>LabelTag</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>574</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>704</x>
-     <y>600</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawLabelBackground</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>LabelBackgroundTag</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>517</x>
-     <y>683</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>709</x>
-     <y>713</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawIcon</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>ProportionalIcon</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>385</x>
-     <y>494</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>519</x>
-     <y>521</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawIcon</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>FixedIcon</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>385</x>
-     <y>494</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>653</x>
-     <y>521</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawLabel</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>LabelHalo</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>342</x>
-     <y>564</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>381</x>
-     <y>649</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawLabel</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>LabelArea</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>324</x>
-     <y>562</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>435</x>
-     <y>646</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
    <sender>DrawGlobalBackground</sender>
    <signal>toggled(bool)</signal>
    <receiver>GlobalBackgroundColor</receiver>
    <slot>setEnabled(bool)</slot>
    <hints>
-    <hint type="sourcelabel" >
+    <hint type="sourcelabel">
      <x>42</x>
      <y>43</y>
     </hint>
-    <hint type="destinationlabel" >
+    <hint type="destinationlabel">
      <x>122</x>
      <y>38</y>
     </hint>
    </hints>
   </connection>
-  <connection>
-   <sender>DrawFill</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>FillColor</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>375</x>
-     <y>273</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>426</x>
-     <y>277</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawForeground</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>ForegroundColor</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>190</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>463</x>
-     <y>194</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawForeground</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>ProportionalForeground</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>190</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>519</x>
-     <y>220</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawForeground</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>FixedForeground</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>190</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>653</x>
-     <y>220</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawForeground</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>ForegroundDashed</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>190</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>420</x>
-     <y>245</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawForeground</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>ForegroundDashOn</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>190</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>475</x>
-     <y>246</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>DrawForeground</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>ForegroundDashOff</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>412</x>
-     <y>190</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>550</x>
-     <y>246</y>
-    </hint>
-   </hints>
-  </connection>
  </connections>
 </ui>
diff --git a/src/PaintStyle/TagSelector.cpp b/src/PaintStyle/TagSelector.cpp
index 2d02269..40bbce0 100644
--- a/src/PaintStyle/TagSelector.cpp
+++ b/src/PaintStyle/TagSelector.cpp
@@ -5,247 +5,246 @@
 
 void skipWhite(const QString& Expression, int& idx)
 {
-	while (idx < Expression.length())
-		if (Expression[idx] == ' ')
-			++idx;
-		else
-			return;
+    while (idx < Expression.length())
+        if (Expression[idx] == ' ')
+            ++idx;
+        else
+            return;
 }
 
 bool canParseSymbol(const QString& Expression, int& idx, char Symbol)
 {
-	skipWhite(Expression, idx);
-	if ((idx < Expression.length()) && (Expression[idx] == Symbol))
-	{
-		++idx;
-		return true;
-	}
-	return false;
+    skipWhite(Expression, idx);
+    if ((idx < Expression.length()) && (Expression[idx] == Symbol))
+    {
+        ++idx;
+        return true;
+    }
+    return false;
 }
 
 bool canParseValue(const QString& Expression, int& idx, QString& Key)
 {
-	Key = "";
-	skipWhite(Expression,idx);
-	unsigned short opened =0;
-	while (idx < Expression.length())
-	{
-		if ( ((Expression[idx] == '_') || (Expression[idx].isLetterOrNumber()) || (Expression[idx].isPunct()) || (Expression[idx] == '*') || (Expression[idx] == '?'))
-				&&  ( (Expression[idx] != '[') && (Expression[idx] != ']') && (Expression[idx] != ',') && (Expression[idx] != '(')&& (Expression[idx] != ')')) )
-			Key += Expression[idx++];
-		else if ( Expression[idx] == '[' )
-		{
-			opened++;
-			Key += Expression[idx++];
-		}
-		else if ( Expression[idx] == ']' )
-		{
-			if( opened == 0) break;
-			opened--;
-			Key += Expression[idx++];
-		}
-		else
-			break;
-	}
-	return Key.length() > 0;
+    Key = "";
+    skipWhite(Expression,idx);
+    unsigned short opened =0;
+    while (idx < Expression.length())
+    {
+        if ( ((Expression[idx] == '_') || (Expression[idx].isLetterOrNumber()) || (Expression[idx].isPunct()) || (Expression[idx] == '*') || (Expression[idx] == '?'))
+                &&  ( (Expression[idx] != '[') && (Expression[idx] != ']') && (Expression[idx] != ',') && (Expression[idx] != '(')&& (Expression[idx] != ')')) )
+            Key += Expression[idx++];
+        else if ( Expression[idx] == '[' )
+        {
+            opened++;
+            Key += Expression[idx++];
+        }
+        else if ( Expression[idx] == ']' )
+        {
+            if( opened == 0) break;
+            opened--;
+            Key += Expression[idx++];
+        }
+        else
+            break;
+    }
+    return Key.length() > 0;
 }
 
 bool canParseKey(const QString& Expression, int& idx, QString& Key)
 {
-	if (!canParseSymbol(Expression,idx,'['))
-		return false;
-	if (!canParseValue(Expression,idx,Key))
-		return false;
-	canParseSymbol(Expression,idx,']');
-	return true;
+    if (!canParseSymbol(Expression,idx,'['))
+        return false;
+    if (!canParseValue(Expression,idx,Key))
+        return false;
+    canParseSymbol(Expression,idx,']');
+    return true;
 }
 
 bool canParseLiteral(const QString& Expression, int& idx, const QString& Literal)
 {
-	skipWhite(Expression,idx);
-	QString Result;
-	int TempIdx = idx;
-	if (canParseValue(Expression,TempIdx,Result))
-	{
-		if (Result == Literal)
-		{
-			idx = TempIdx;
-			return true;
-		}
-	}
-	return false;
+    skipWhite(Expression,idx);
+    QString Result;
+    int TempIdx = idx;
+    if (canParseValue(Expression,TempIdx,Result))
+    {
+        if (Result == Literal)
+        {
+            idx = TempIdx;
+            return true;
+        }
+    }
+    return false;
 }
 
 TagSelectorIs* parseTagSelectorIs(const QString& Expression, int& idx)
 {
-	QString Key, Value;
-	if (!canParseKey(Expression, idx, Key))
-		return 0;
-	if (!canParseLiteral(Expression, idx, "is"))
-		return 0;
-	if (!canParseValue(Expression, idx, Value))
-		return 0;
-	return new TagSelectorIs(Key, Value);
+    QString Key, Value;
+    if (!canParseKey(Expression, idx, Key))
+        return 0;
+    if (!canParseLiteral(Expression, idx, "is"))
+        return 0;
+    if (!canParseValue(Expression, idx, Value))
+        return 0;
+    return new TagSelectorIs(Key, Value);
 }
 
 TagSelectorTypeIs* parseTagSelectorTypeIs(const QString& Expression, int& idx)
 {
-	QString Type;
-	if (!canParseLiteral(Expression, idx, "Type"))
-		return 0;
-	if (!canParseLiteral(Expression, idx, "is"))
-		return 0;
-	if (!canParseValue(Expression, idx, Type))
-		return 0;
-	return new TagSelectorTypeIs(Type);
+    QString Type;
+    if (!canParseLiteral(Expression, idx, "Type"))
+        return 0;
+    if (!canParseLiteral(Expression, idx, "is"))
+        return 0;
+    if (!canParseValue(Expression, idx, Type))
+        return 0;
+    return new TagSelectorTypeIs(Type);
 }
 
 TagSelectorHasTags* parseTagSelectorHasTags(const QString& Expression, int& idx)
 {
-	if (!canParseLiteral(Expression, idx, "HasTags"))
-		return 0;
-	return new TagSelectorHasTags();
+    if (!canParseLiteral(Expression, idx, "HasTags"))
+        return 0;
+    return new TagSelectorHasTags();
 }
 
 TagSelectorIsOneOf* parseTagSelectorIsOneOf(const QString& Expression, int& idx)
 {
-	QString Key;
-	if (!canParseKey(Expression, idx, Key))
-		return 0;
-	if (!canParseLiteral(Expression, idx, "isoneof"))
-		return 0;
-	if (!canParseSymbol(Expression, idx, '('))
-		return 0;
-	QList<QString> Values;
-	while (true)
-	{
-		QString Value;
-		if (!canParseValue(Expression, idx, Value))
-			break;
-		Values.push_back(Value);
-		if (!canParseSymbol(Expression, idx, ','))
-			break;
-	}
-	canParseSymbol(Expression, idx, ')');
-	if (Values.size())
-		return new TagSelectorIsOneOf(Key,Values);
-	return 0;
+    QString Key;
+    if (!canParseKey(Expression, idx, Key))
+        return 0;
+    if (!canParseLiteral(Expression, idx, "isoneof"))
+        return 0;
+    if (!canParseSymbol(Expression, idx, '('))
+        return 0;
+    QList<QString> Values;
+    while (true)
+    {
+        QString Value;
+        if (!canParseValue(Expression, idx, Value))
+            break;
+        Values.push_back(Value);
+        if (!canParseSymbol(Expression, idx, ','))
+            break;
+    }
+    canParseSymbol(Expression, idx, ')');
+    if (Values.size())
+        return new TagSelectorIsOneOf(Key,Values);
+    return 0;
 }
 
 TagSelectorFalse* parseTagSelectorFalse(const QString& Expression, int& idx)
 {
-	if (!canParseLiteral(Expression, idx, "false"))
-		return 0;
-	return new TagSelectorFalse();
+    if (!canParseLiteral(Expression, idx, "false"))
+        return 0;
+    return new TagSelectorFalse();
 }
 
 TagSelectorTrue* parseTagSelectorTrue(const QString& Expression, int& idx)
 {
-	if (!canParseLiteral(Expression, idx, "true"))
-		return 0;
-	return new TagSelectorTrue();
+    if (!canParseLiteral(Expression, idx, "true"))
+        return 0;
+    return new TagSelectorTrue();
 }
 
 TagSelector* parseTagSelector(const QString& Expression, int& idx);
 
 TagSelector* parseFactor(const QString& Expression, int& idx)
 {
-	TagSelector* Current = 0;
-	if (canParseLiteral(Expression,idx,"[Default]")) {
-		TagSelector* defFactor = parseTagSelector(Expression, idx);
-		Current = new TagSelectorDefault(defFactor);
-	}
-	int Saved = idx;
-	if (!Current) {
-		if (canParseSymbol(Expression, idx, '('))
-		{
-			Current = parseTagSelector(Expression, idx);
-			canParseSymbol(Expression, idx, ')');
-		}
-	}
-
-	if (!Current) {
-		idx = Saved;
-		Current = parseTagSelectorIs(Expression, idx);
-	}
-
-	if (!Current)
-	{
-		idx = Saved;
-		Current = parseTagSelectorFalse(Expression, idx);
-	}
-	if (!Current)
-	{
-		idx = Saved;
-		Current = parseTagSelectorTrue(Expression, idx);
-	}
-	if (!Current)
-	{
-		idx = Saved;
-		Current = parseTagSelectorTypeIs(Expression, idx);
-	}
-	if (!Current)
-	{
-		idx = Saved;
-		Current = parseTagSelectorHasTags(Expression, idx);
-	}
-	if (!Current)
-	{
-		idx = Saved;
-		Current = parseTagSelectorIsOneOf(Expression, idx);
-	}
-	if (!Current)
-	{
-		if (canParseLiteral(Expression,idx,"not")) {
-			TagSelector* notFactor = parseFactor(Expression, idx);
-			Current = new TagSelectorNot(notFactor);
-		}
-	}
-	return Current;
+    TagSelector* Current = 0;
+    if (canParseLiteral(Expression,idx,"[Default]")) {
+        TagSelector* defFactor = parseTagSelector(Expression, idx);
+        Current = new TagSelectorDefault(defFactor);
+    }
+    int Saved = idx;
+    if (!Current) {
+        if (canParseSymbol(Expression, idx, '('))
+        {
+            Current = parseTagSelector(Expression, idx);
+            canParseSymbol(Expression, idx, ')');
+        }
+    }
+
+    if (!Current)
+    {
+        idx = Saved;
+        Current = parseTagSelectorTypeIs(Expression, idx);
+    }
+    if (!Current)
+    {
+        idx = Saved;
+        Current = parseTagSelectorIsOneOf(Expression, idx);
+    }
+    if (!Current) {
+        idx = Saved;
+        Current = parseTagSelectorIs(Expression, idx);
+    }
+    if (!Current)
+    {
+        idx = Saved;
+        Current = parseTagSelectorFalse(Expression, idx);
+    }
+    if (!Current)
+    {
+        idx = Saved;
+        Current = parseTagSelectorTrue(Expression, idx);
+    }
+    if (!Current)
+    {
+        idx = Saved;
+        Current = parseTagSelectorHasTags(Expression, idx);
+    }
+    if (!Current)
+    {
+        if (canParseLiteral(Expression,idx,"not")) {
+            TagSelector* notFactor = parseFactor(Expression, idx);
+            Current = new TagSelectorNot(notFactor);
+        }
+    }
+    return Current;
 }
 
 TagSelector* parseTerm(const QString& Expression, int& idx)
 {
-	QList<TagSelector*> Factors;
-	while (idx < Expression.length())
-	{
-		TagSelector* Current = parseFactor(Expression, idx);
-		if (!Current)
-			break;
-		Factors.push_back(Current);
-		if (!canParseLiteral(Expression,idx,"and"))
-			break;
-	}
-	if (Factors.size() == 1)
-		return Factors[0];
-	else if (Factors.size() > 1)
-		return new TagSelectorAnd(Factors);
-	return 0;
+    QList<TagSelector*> Factors;
+    while (idx < Expression.length())
+    {
+        TagSelector* Current = parseFactor(Expression, idx);
+        if (!Current)
+            break;
+        Factors.push_back(Current);
+        if (!canParseLiteral(Expression,idx,"and"))
+            break;
+    }
+    if (Factors.size() == 1)
+        return Factors[0];
+    else if (Factors.size() > 1)
+        return new TagSelectorAnd(Factors);
+    return 0;
 }
 
 TagSelector* parseTagSelector(const QString& Expression, int& idx)
 {
-	QList<TagSelector*> Terms;
-	while (idx < Expression.length())
-	{
-		TagSelector* Current = parseTerm(Expression, idx);
-		if (!Current)
-			break;
-		Terms.push_back(Current);
-		if (!canParseLiteral(Expression,idx,"or"))
-			break;
-	}
-	if (Terms.size() == 1)
-		return Terms[0];
-	else if (Terms.size() > 1)
-		return new TagSelectorOr(Terms);
-	return 0;
+    QList<TagSelector*> Terms;
+    while (idx < Expression.length())
+    {
+        TagSelector* Current = parseTerm(Expression, idx);
+        if (!Current)
+            break;
+        Terms.push_back(Current);
+        if (!canParseLiteral(Expression,idx,"or"))
+            break;
+    }
+    if (Terms.size() == 1)
+        return Terms[0];
+    else if (Terms.size() > 1)
+        return new TagSelectorOr(Terms);
+    return 0;
 }
 
 TagSelector* TagSelector::parse(const QString& Expression)
 {
-	int idx = 0;
-	return parseTagSelector(Expression,idx);
+    int idx = 0;
+    return parseTagSelector(Expression,idx);
 }
 
 TagSelector::~TagSelector()
@@ -258,44 +257,44 @@ TagSelector::~TagSelector()
 TagSelectorIs::TagSelectorIs(const QString& key, const QString& value)
 : Key(key), Value(value), MatchEmpty(false), UseRegExp(false)
 {
-	if (value == "_NULL_") {
-		MatchEmpty = true;
-	} else if (value.contains(QRegExp("[][*?]"))) {
-		UseRegExp = true;
-		rx = QRegExp(value);
-		rx.setPatternSyntax(QRegExp::Wildcard);
-	}
-	// Else exact match against ->Value only
+    if (value == "_NULL_") {
+        MatchEmpty = true;
+    } else if (value.contains(QRegExp("[][*?]"))) {
+        UseRegExp = true;
+        rx = QRegExp(value);
+        rx.setPatternSyntax(QRegExp::Wildcard);
+    }
+    // Else exact match against ->Value only
 }
 
 TagSelector* TagSelectorIs::copy() const
 {
-	return new TagSelectorIs(Key,Value);
+    return new TagSelectorIs(Key,Value);
 }
 
 static const QString emptyString("__EMPTY__");
 
 TagSelectorMatchResult TagSelectorIs::matches(const Feature* F) const
 {
-	QString val = F->tagValue(Key, emptyString);
-	if (MatchEmpty) {
-		return val == emptyString ? TagSelect_Match : TagSelect_NoMatch;
-	} else if (UseRegExp) {
-		return rx.exactMatch(val) ? TagSelect_Match : TagSelect_NoMatch;
-	} else {
-		return (val == Value) ? TagSelect_Match : TagSelect_NoMatch;
-	}
-	return rx.exactMatch(F->tagValue(Key, "")) ? TagSelect_Match : TagSelect_NoMatch;
+    QString val = F->tagValue(Key, emptyString);
+    if (MatchEmpty) {
+        return val == emptyString ? TagSelect_Match : TagSelect_NoMatch;
+    } else if (UseRegExp) {
+        return rx.exactMatch(val) ? TagSelect_Match : TagSelect_NoMatch;
+    } else {
+        return (val == Value) ? TagSelect_Match : TagSelect_NoMatch;
+    }
+    return rx.exactMatch(F->tagValue(Key, "")) ? TagSelect_Match : TagSelect_NoMatch;
 }
 
 QString TagSelectorIs::asExpression(bool) const
 {
-	QString R;
-	R += "[";
-	R += Key;
-	R += "] is ";
-	R += Value;
-	return R;
+    QString R;
+    R += "[";
+    R += Key;
+    R += "] is ";
+    R += Value;
+    return R;
 }
 
 /* TAGSELECTORISONEOF */
@@ -303,54 +302,54 @@ QString TagSelectorIs::asExpression(bool) const
 TagSelectorIsOneOf::TagSelectorIsOneOf(const QString& key, const QList<QString>& values)
 : Key(key), Values(values), MatchEmpty(false)
 {
-	for (int i=0; i<values.size(); ++i)
-	{
-		if (values[i] == "_NULL_") {
-			MatchEmpty = true;
-		} else if (values[i].contains(QRegExp("[][*?]"))) {
-			QRegExp rx(values[i]);
-			rx.setPatternSyntax(QRegExp::Wildcard);
-			rxv.append(rx);
-		} else {
-			exactMatchv.append(values[i]);
-		}
-	}
+    for (int i=0; i<values.size(); ++i)
+    {
+        if (values[i] == "_NULL_") {
+            MatchEmpty = true;
+        } else if (values[i].contains(QRegExp("[][*?]"))) {
+            QRegExp rx(values[i]);
+            rx.setPatternSyntax(QRegExp::Wildcard);
+            rxv.append(rx);
+        } else {
+            exactMatchv.append(values[i]);
+        }
+    }
 }
 
 TagSelector* TagSelectorIsOneOf::copy() const
 {
-	return new TagSelectorIsOneOf(Key,Values);
+    return new TagSelectorIsOneOf(Key,Values);
 }
 
 TagSelectorMatchResult TagSelectorIsOneOf::matches(const Feature* F) const
 {
-	QString V = F->tagValue(Key, emptyString);
-	if (MatchEmpty && V.isEmpty()) {
-		return TagSelect_Match;
-	}
-	foreach (QString pattern, exactMatchv) {
-		if (V == pattern) return TagSelect_Match;
-	}
-	foreach (QRegExp pattern, rxv) {
-		if (pattern.exactMatch(V)) return TagSelect_Match;
-	}
-	return TagSelect_NoMatch;
+    QString V = F->tagValue(Key, emptyString);
+    if (MatchEmpty && V.isEmpty()) {
+        return TagSelect_Match;
+    }
+    foreach (QString pattern, exactMatchv) {
+        if (V == pattern) return TagSelect_Match;
+    }
+    foreach (QRegExp pattern, rxv) {
+        if (pattern.exactMatch(V)) return TagSelect_Match;
+    }
+    return TagSelect_NoMatch;
 }
 
 QString TagSelectorIsOneOf::asExpression(bool) const
 {
-	QString R;
-	R += "[";
-	R += Key;
-	R += "] isoneof (";
-	for (int i=0; i<Values.size(); ++i)
-	{
-		if (i)
-			R += " , ";
-		R += Values[i];
-	}
-	R += ")";
-	return R;
+    QString R;
+    R += "[";
+    R += Key;
+    R += "] isoneof (";
+    for (int i=0; i<Values.size(); ++i)
+    {
+        if (i)
+            R += " , ";
+        R += Values[i];
+    }
+    R += ")";
+    return R;
 }
 
 /* TAGSELECTORTYPEIS */
@@ -362,28 +361,28 @@ TagSelectorTypeIs::TagSelectorTypeIs(const QString& type)
 
 TagSelector* TagSelectorTypeIs::copy() const
 {
-	return new TagSelectorTypeIs(Type);
+    return new TagSelectorTypeIs(Type);
 }
 
 TagSelectorMatchResult TagSelectorTypeIs::matches(const Feature* F) const
 {
-	if (F->getClass() == Type)
-		return TagSelect_Match;
-	else
-		if (Type.toLower() == "area")
-			if (Way* R = dynamic_cast<Way*>((Feature*)F))
-				if (R->area() > 0.0)
-					return TagSelect_Match;
+    if (F->getClass() == Type)
+        return TagSelect_Match;
+    else
+        if (Type.toLower() == "area")
+            if (Way* R = dynamic_cast<Way*>((Feature*)F))
+                if (R->area() > 0.0)
+                    return TagSelect_Match;
 
-	return TagSelect_NoMatch;
+    return TagSelect_NoMatch;
 }
 
 QString TagSelectorTypeIs::asExpression(bool) const
 {
-	QString R;
-	R += "Type is ";
-	R += Type;
-	return R;
+    QString R;
+    R += "Type is ";
+    R += Type;
+    return R;
 }
 
 /* TAGSELECTORHASTAGS */
@@ -394,19 +393,19 @@ TagSelectorHasTags::TagSelectorHasTags()
 
 TagSelector* TagSelectorHasTags::copy() const
 {
-	return new TagSelectorHasTags();
+    return new TagSelectorHasTags();
 }
 
 TagSelectorMatchResult TagSelectorHasTags::matches(const Feature* F) const
 {
-	return (F->tagSize()==0 || (F->tagSize()==1 && F->tagKey(0)=="created_by" )) ? TagSelect_NoMatch : TagSelect_Match;
+    return (F->tagSize()==0 || (F->tagSize()==1 && F->tagKey(0)=="created_by" )) ? TagSelect_NoMatch : TagSelect_Match;
 }
 
 QString TagSelectorHasTags::asExpression(bool) const
 {
-	QString R;
-	R += "HasTags";
-	return R;
+    QString R;
+    R += "HasTags";
+    return R;
 }
 
 /* TAGSELECTOROR */
@@ -418,40 +417,40 @@ TagSelectorOr::TagSelectorOr(const QList<TagSelector*> terms)
 
 TagSelectorOr::~TagSelectorOr()
 {
-	for (int i=0; i<Terms.size(); ++i)
-		delete Terms[i];
+    for (int i=0; i<Terms.size(); ++i)
+        delete Terms[i];
 }
 
 TagSelector* TagSelectorOr::copy() const
 {
-	QList<TagSelector*> Copied;
-	for (int i=0; i<Terms.size(); ++i)
-		Copied.push_back(Terms[i]->copy());
-	return new TagSelectorOr(Copied);
+    QList<TagSelector*> Copied;
+    for (int i=0; i<Terms.size(); ++i)
+        Copied.push_back(Terms[i]->copy());
+    return new TagSelectorOr(Copied);
 }
 
 TagSelectorMatchResult TagSelectorOr::matches(const Feature* F) const
 {
-	for (int i=0; i<Terms.size(); ++i)
-		if (Terms[i]->matches(F) == TagSelect_Match)
-			return TagSelect_Match;
-	return TagSelect_NoMatch;
+    for (int i=0; i<Terms.size(); ++i)
+        if (Terms[i]->matches(F) == TagSelect_Match)
+            return TagSelect_Match;
+    return TagSelect_NoMatch;
 }
 
 QString TagSelectorOr::asExpression(bool Precedence) const
 {
-	QString R;
-	if (Precedence)
-		R += "(";
-	for (int i=0; i<Terms.size(); ++i)
-	{
-		if (i)
-			R += " or ";
-		R += Terms[i]->asExpression(false);
-	}
-	if (Precedence)
-		R += ")";
-	return R;
+    QString R;
+    if (Precedence)
+        R += "(";
+    for (int i=0; i<Terms.size(); ++i)
+    {
+        if (i)
+            R += " or ";
+        R += Terms[i]->asExpression(false);
+    }
+    if (Precedence)
+        R += ")";
+    return R;
 }
 
 
@@ -464,36 +463,36 @@ TagSelectorAnd::TagSelectorAnd(const QList<TagSelector*> terms)
 
 TagSelectorAnd::~TagSelectorAnd()
 {
-	for (int i=0; i<Terms.size(); ++i)
-		delete Terms[i];
+    for (int i=0; i<Terms.size(); ++i)
+        delete Terms[i];
 }
 
 TagSelector* TagSelectorAnd::copy() const
 {
-	QList<TagSelector*> Copied;
-	for (int i=0; i<Terms.size(); ++i)
-		Copied.push_back(Terms[i]->copy());
-	return new TagSelectorAnd(Copied);
+    QList<TagSelector*> Copied;
+    for (int i=0; i<Terms.size(); ++i)
+        Copied.push_back(Terms[i]->copy());
+    return new TagSelectorAnd(Copied);
 }
 
 TagSelectorMatchResult TagSelectorAnd::matches(const Feature* F) const
 {
-	for (int i=0; i<Terms.size(); ++i)
-		if (Terms[i]->matches(F) == TagSelect_NoMatch)
-			return TagSelect_NoMatch;
-	return TagSelect_Match;
+    for (int i=0; i<Terms.size(); ++i)
+        if (Terms[i]->matches(F) == TagSelect_NoMatch)
+            return TagSelect_NoMatch;
+    return TagSelect_Match;
 }
 
 QString TagSelectorAnd::asExpression(bool /* Precedence */) const
 {
-	QString R;
-	for (int i=0; i<Terms.size(); ++i)
-	{
-		if (i)
-			R += " and ";
-		R += Terms[i]->asExpression(true);
-	}
-	return R;
+    QString R;
+    for (int i=0; i<Terms.size(); ++i)
+    {
+        if (i)
+            R += " and ";
+        R += Terms[i]->asExpression(true);
+    }
+    return R;
 }
 
 /* TAGSELECTORNOT */
@@ -505,31 +504,31 @@ TagSelectorNot::TagSelectorNot(TagSelector* term)
 
 TagSelectorNot::~TagSelectorNot()
 {
-	delete Term;
+    delete Term;
 }
 
 TagSelector* TagSelectorNot::copy() const
 {
-	if (!Term)
-		return NULL;
-	return new TagSelectorNot(Term->copy());
+    if (!Term)
+        return NULL;
+    return new TagSelectorNot(Term->copy());
 }
 
 TagSelectorMatchResult TagSelectorNot::matches(const Feature* F) const
 {
-	if (!Term)
-		return TagSelect_NoMatch;
-	return (Term->matches(F) == TagSelect_Match) ? TagSelect_NoMatch : TagSelect_Match;
+    if (!Term)
+        return TagSelect_NoMatch;
+    return (Term->matches(F) == TagSelect_Match) ? TagSelect_NoMatch : TagSelect_Match;
 }
 
 QString TagSelectorNot::asExpression(bool /* Precedence */) const
 {
-	if (!Term)
-		return "";
-	QString R;
-	R += " not ";
-	R += Term->asExpression(true);
-	return R;
+    if (!Term)
+        return "";
+    QString R;
+    R += " not ";
+    R += Term->asExpression(true);
+    return R;
 }
 
 /* TAGSELECTORFALSE */
@@ -540,19 +539,19 @@ TagSelectorFalse::TagSelectorFalse()
 
 TagSelector* TagSelectorFalse::copy() const
 {
-	return new TagSelectorFalse();
+    return new TagSelectorFalse();
 }
 
 TagSelectorMatchResult TagSelectorFalse::matches(const Feature* /* F */) const
 {
-	return TagSelect_NoMatch;
+    return TagSelect_NoMatch;
 }
 
 QString TagSelectorFalse::asExpression(bool /* Precedence */) const
 {
-	QString R;
-	R += " false ";
-	return R;
+    QString R;
+    R += " false ";
+    return R;
 }
 
 /* TAGSELECTORTRUE */
@@ -563,19 +562,19 @@ TagSelectorTrue::TagSelectorTrue()
 
 TagSelector* TagSelectorTrue::copy() const
 {
-	return new TagSelectorFalse();
+    return new TagSelectorFalse();
 }
 
 TagSelectorMatchResult TagSelectorTrue::matches(const Feature* /* F */) const
 {
-	return TagSelect_Match;
+    return TagSelect_Match;
 }
 
 QString TagSelectorTrue::asExpression(bool /* Precedence */) const
 {
-	QString R;
-	R += " true ";
-	return R;
+    QString R;
+    R += " true ";
+    return R;
 }
 
 /* TAGSELECTORDEFAULT */
@@ -587,28 +586,28 @@ TagSelectorDefault::TagSelectorDefault(TagSelector* term)
 
 TagSelectorDefault::~TagSelectorDefault()
 {
-	delete Term;
+    delete Term;
 }
 
 TagSelector* TagSelectorDefault::copy() const
 {
-	return new TagSelectorDefault(Term->copy());
+    return new TagSelectorDefault(Term->copy());
 }
 
 TagSelectorMatchResult TagSelectorDefault::matches(const Feature* F) const
 {
-	//return (Term->matches(F) == TagSelect_Match) ? TagSelect_DefaultMatch : TagSelect_NoMatch;
-	if (Term->matches(F) == TagSelect_Match)
-		return TagSelect_DefaultMatch;
-	else
-		return TagSelect_NoMatch;
+    //return (Term->matches(F) == TagSelect_Match) ? TagSelect_DefaultMatch : TagSelect_NoMatch;
+    if (Term->matches(F) == TagSelect_Match)
+        return TagSelect_DefaultMatch;
+    else
+        return TagSelect_NoMatch;
 }
 
 QString TagSelectorDefault::asExpression(bool /* Precedence */) const
 {
-	QString R;
-	R += " [Default] ";
-	R += Term->asExpression(true);
-	return R;
+    QString R;
+    R += " [Default] ";
+    R += Term->asExpression(true);
+    return R;
 }
 
diff --git a/src/Preferences/MerkaartorPreferences.cpp b/src/Preferences/MerkaartorPreferences.cpp
index b81dceb..8f4dc4f 100644
--- a/src/Preferences/MerkaartorPreferences.cpp
+++ b/src/Preferences/MerkaartorPreferences.cpp
@@ -804,12 +804,13 @@ void MerkaartorPreferences::initialPosition(MapView* vw)
     const Coord bottomLeft(ip[0].toDouble(), ip[1].toDouble());
     const Coord topRight(ip[2].toDouble(),ip[3].toDouble());
 
-    if (!Sets->contains("MainWindow/ViewRect"))
-        vw->setViewport(CoordBox(bottomLeft, topRight), vw->rect());
-    else {
-        QRect rt = Sets->value("MainWindow/ViewRect").toRect();
-        vw->setViewport(CoordBox(bottomLeft, topRight), rt);
-    }
+    vw->setViewport(CoordBox(bottomLeft, topRight), vw->rect());
+//    if (!Sets->contains("MainWindow/ViewRect"))
+//        vw->setViewport(CoordBox(bottomLeft, topRight), vw->rect());
+//    else {
+//        QRect rt = Sets->value("MainWindow/ViewRect").toRect();
+//        vw->setViewport(CoordBox(bottomLeft, topRight), rt);
+//    }
 }
 
 #ifndef _MOBILE
@@ -820,7 +821,7 @@ void MerkaartorPreferences::setProjectionType(ProjectionType theValue)
 
 ProjectionType MerkaartorPreferences::getProjectionType()
 {
-    return (ProjectionType)Sets->value("projection/Type", "EPSG:3785").toString();
+    return (ProjectionType)Sets->value("projection/Type", "Mercator").toString();
 }
 
 ProjectionsList* MerkaartorPreferences::getProjectionsList()
diff --git a/src/Preferences/ProjPreferencesDialog.cpp b/src/Preferences/ProjPreferencesDialog.cpp
index 2fc2cfa..29e2c7f 100644
--- a/src/Preferences/ProjPreferencesDialog.cpp
+++ b/src/Preferences/ProjPreferencesDialog.cpp
@@ -64,12 +64,14 @@ void ProjPreferencesDialog::on_btAdd_clicked(void)
 
 void ProjPreferencesDialog::on_btDel_clicked(void)
 {
-    int idx = static_cast<int>(lvProjections->currentItem()->data(Qt::UserRole).toInt());
+    QListWidgetItem* it = lvProjections->item(lvProjections->currentRow());
+
+    int idx = it->data(Qt::UserRole).toInt();
     if (idx >= theItems.size())
         return;
 
     theItems[idx].deleted = true;
-    delete lvProjections->takeItem(idx);
+    delete lvProjections->takeItem(lvProjections->currentRow());
     on_lvProjections_itemSelectionChanged();
 }
 
diff --git a/src/Preferences/ProjectionsList.cpp b/src/Preferences/ProjectionsList.cpp
index f9c0091..bae2ea4 100644
--- a/src/Preferences/ProjectionsList.cpp
+++ b/src/Preferences/ProjectionsList.cpp
@@ -106,6 +106,9 @@ ProjectionItem ProjectionsList::getProjection(QString name) const
         while (it.hasNext()) {
             it.next();
 
+            if (it.value().deleted)
+                continue;
+
             if (it.key().contains(name, Qt::CaseInsensitive))
                 return it.value();
         }
diff --git a/src/QMapControl.pri b/src/QMapControl.pri
index cc6ef16..164d07c 100644
--- a/src/QMapControl.pri
+++ b/src/QMapControl.pri
@@ -1,31 +1,31 @@
 # Input
 HEADERS += \
-		   IImageManager.h \
-		   QMapControl/imagemanager.h \
-		   QMapControl/mapadapter.h \
-		   QMapControl/mapnetwork.h \
-		   QMapControl/wmsmapadapter.h \
-		   QMapControl/WmscMapadapter.h \
-		   QMapControl/tilemapadapter.h
+           IImageManager.h \
+           QMapControl/imagemanager.h \
+           QMapControl/mapadapter.h \
+           QMapControl/mapnetwork.h \
+           QMapControl/wmsmapadapter.h \
+           QMapControl/WmscMapAdapter.h \
+           QMapControl/tilemapadapter.h
 
 SOURCES += \
-		   QMapControl/IImageManager.cpp \
-		   QMapControl/imagemanager.cpp \
-		   QMapControl/mapadapter.cpp \
-		   QMapControl/mapnetwork.cpp \
-		   QMapControl/wmsmapadapter.cpp \
-		   QMapControl/WmscMapadapter.cpp \
-		   QMapControl/tilemapadapter.cpp
+           QMapControl/IImageManager.cpp \
+           QMapControl/imagemanager.cpp \
+           QMapControl/mapadapter.cpp \
+           QMapControl/mapnetwork.cpp \
+           QMapControl/wmsmapadapter.cpp \
+           QMapControl/WmscMapAdapter.cpp \
+           QMapControl/tilemapadapter.cpp
 
 QT += network
 
 !contains(NOUSEWEBKIT,1) {
-	greaterThan(QT_VER_MAJ, 3) : greaterThan(QT_VER_MIN, 3) {
-		DEFINES += USE_WEBKIT
-		SOURCES += QMapControl/browserimagemanager.cpp
-		HEADERS += QMapControl/browserimagemanager.h
-		QT += webkit
-		contains(THREADED_BROWSERIMAGEMANAGER,1): DEFINES += BROWSERIMAGEMANAGER_IS_THREADED
-	}
+    greaterThan(QT_VER_MAJ, 3) : greaterThan(QT_VER_MIN, 3) {
+        DEFINES += USE_WEBKIT
+        SOURCES += QMapControl/browserimagemanager.cpp
+        HEADERS += QMapControl/browserimagemanager.h
+        QT += webkit
+        contains(THREADED_BROWSERIMAGEMANAGER,1): DEFINES += BROWSERIMAGEMANAGER_IS_THREADED
+    }
 }
 
diff --git a/src/QMapControl/tilemapadapter.cpp b/src/QMapControl/tilemapadapter.cpp
index bf515a8..d499533 100644
--- a/src/QMapControl/tilemapadapter.cpp
+++ b/src/QMapControl/tilemapadapter.cpp
@@ -128,7 +128,7 @@ void TileMapAdapter::zoom_out()
 QString TileMapAdapter::getQuery		(int x, int y, int z) const
 {
     if (BlOrigin)
-        y = getTilesNS(current_zoom) - y;
+        y = getTilesNS(current_zoom)-1 - y;
     int a[3] = {z, x, y};
     return QString(serverPath).replace(order[2][0],2, loc.toString(a[order[2][1]]))
                                       .replace(order[1][0],2, loc.toString(a[order[1][1]]))
diff --git a/src/Render/MapRenderer.cpp b/src/Render/MapRenderer.cpp
index 210f9a9..a8464be 100644
--- a/src/Render/MapRenderer.cpp
+++ b/src/Render/MapRenderer.cpp
@@ -200,76 +200,96 @@ void MapRenderer::render(
     theView = aView;
 
     QMap<RenderPriority, QSet<Feature*> >::const_iterator itm;
+    QMap<RenderPriority, QSet<Feature*> >::const_iterator itmCur;
     QSet<Feature*>::const_iterator it;
 
-#if 0
+    bool bgLayerVisible = M_PREFS->getBackgroundVisible();
+    bool fgLayerVisible = M_PREFS->getForegroundVisible();
+    bool tchpLayerVisible = M_PREFS->getTouchupVisible();
+    bool lblLayerVisible = M_PREFS->getNamesVisible();
+
+#if 1
     P->setRenderHint(QPainter::Antialiasing);
     thePainter = P;
 
-    if (M_PREFS->getBackgroundVisible())
+    itm = theFeatures.constBegin();
+    while (itm != theFeatures.constEnd())
     {
-        BackgroundStyleLayer layer(this);
-        P->save();
-
-        for (itm = theFeatures.constBegin() ;itm != theFeatures.constEnd(); ++itm)
-            for (it = itm.value().constBegin(); it != itm.value().constEnd(); ++it) {
-                P->setOpacity((*it)->layer()->getAlpha());
-                if (Way * R = dynamic_cast < Way * >(*it))
-                    layer.draw(R);
-                else if (Node * Pt = dynamic_cast < Node * >(*it))
-                    layer.draw(Pt);
-                else if (Relation * RR = dynamic_cast < Relation * >(*it))
-                    layer.draw(RR);
+        int curLayer = (itm.key()).layer();
+        itmCur = itm;
+        while (itm != theFeatures.constEnd() && (itm.key()).layer() == curLayer)
+        {
+            if (bgLayerVisible)
+            {
+                for (it = itm.value().constBegin(); it != itm.value().constEnd(); ++it) {
+                    P->save();
+                    P->setOpacity((*it)->layer()->getAlpha());
+                    if (Way * R = CAST_WAY(*it)) {
+                        for (int i=0; i<R->sizeParents(); ++i)
+                            if (!R->getParent(i)->isDeleted() && R->getParent(i)->getEditPainter(theView->pixelPerM()))
+                                continue;
+                        bglayer.draw(R);
+                    } else if (Node * Pt = CAST_NODE(*it))
+                        bglayer.draw(Pt);
+                    else if (Relation * RR = CAST_RELATION(*it))
+                        bglayer.draw(RR);
+                    P->restore();
+                }
             }
-        P->restore();
-    }
-    if (M_PREFS->getForegroundVisible())
-    {
-        ForegroundStyleLayer layer(this);
-        P->save();
-
-        for (itm = theFeatures.constBegin() ;itm != theFeatures.constEnd(); ++itm)
-            for (it = itm.value().constBegin(); it != itm.value().constEnd(); ++it) {
-                P->setOpacity((*it)->layer()->getAlpha());
-                if (Way * R = dynamic_cast < Way * >(*it))
-                    layer.draw(R);
-                else if (Node * Pt = dynamic_cast < Node * >(*it))
-                    layer.draw(Pt);
-                else if (Relation * RR = dynamic_cast < Relation * >(*it))
-                    layer.draw(RR);
+            ++itm;
+        }
+        itm = itmCur;
+        while (itm != theFeatures.constEnd() && (itm.key()).layer() == curLayer)
+        {
+            if (fgLayerVisible)
+            {
+                for (it = itm.value().constBegin(); it != itm.value().constEnd(); ++it) {
+                    P->save();
+                    P->setOpacity((*it)->layer()->getAlpha());
+                    if (Way * R = CAST_WAY(*it)) {
+                        for (int i=0; i<R->sizeParents(); ++i)
+                            if (!R->getParent(i)->isDeleted() && R->getParent(i)->getEditPainter(theView->pixelPerM()))
+                                continue;
+                        fglayer.draw(R);
+                    } else if (Node * Pt = CAST_NODE(*it))
+                        fglayer.draw(Pt);
+                    else if (Relation * RR = CAST_RELATION(*it))
+                        fglayer.draw(RR);
+                    P->restore();
+                }
             }
-        P->restore();
+            ++itm;
+        }
     }
-    if (M_PREFS->getTouchupVisible())
+
+    if (tchpLayerVisible)
     {
-        TouchupStyleLayer layer(this);
         P->save();
 
         for (itm = theFeatures.constBegin() ;itm != theFeatures.constEnd(); ++itm)
             for (it = itm.value().constBegin(); it != itm.value().constEnd(); ++it) {
                 P->setOpacity((*it)->layer()->getAlpha());
                 if (Way * R = dynamic_cast < Way * >(*it))
-                    layer.draw(R);
+                    tchuplayer.draw(R);
                 else if (Node * Pt = dynamic_cast < Node * >(*it))
-                    layer.draw(Pt);
+                    tchuplayer.draw(Pt);
                 else if (Relation * RR = dynamic_cast < Relation * >(*it))
-                    layer.draw(RR);
+                    tchuplayer.draw(RR);
             }
         P->restore();
     }
-    if (M_PREFS->getNamesVisible()) {
-        LabelStyleLayer layer(this);
+    if (lblLayerVisible) {
         P->save();
 
         for (itm = theFeatures.constBegin() ;itm != theFeatures.constEnd(); ++itm)
             for (it = itm.value().constBegin(); it != itm.value().constEnd(); ++it) {
                 P->setOpacity((*it)->layer()->getAlpha());
                 if (Way * R = dynamic_cast < Way * >(*it))
-                    layer.draw(R);
+                    lbllayer.draw(R);
                 else if (Node * Pt = dynamic_cast < Node * >(*it))
-                    layer.draw(Pt);
+                    lbllayer.draw(Pt);
                 else if (Relation * RR = dynamic_cast < Relation * >(*it))
-                    layer.draw(RR);
+                    lbllayer.draw(RR);
             }
         P->restore();
     }
@@ -285,11 +305,6 @@ void MapRenderer::render(
 
 #else
 
-    bool bgLayerVisible = M_PREFS->getBackgroundVisible();
-    bool fgLayerVisible = M_PREFS->getForegroundVisible();
-    bool tchpLayerVisible = M_PREFS->getTouchupVisible();
-    bool lblLayerVisible = M_PREFS->getNamesVisible();
-
     Way * R = NULL;
     Node * Pt = NULL;
     Relation * RR = NULL;
diff --git a/src/TagTemplate/TagTemplate.cpp b/src/TagTemplate/TagTemplate.cpp
index 705b5fc..2300572 100644
--- a/src/TagTemplate/TagTemplate.cpp
+++ b/src/TagTemplate/TagTemplate.cpp
@@ -690,12 +690,12 @@ TagSelectorMatchResult TagTemplate::matchesTag(const Feature* F)
 
     if (!theSelector) return TagSelect_NoMatch;
     // Special casing for multipolygon roads
-    if (const Way* R = dynamic_cast<const Way*>(F))
+    if (const Way* R = qobject_cast<const Way*>(F))
     {
         // TODO create a isPartOfMultiPolygon(R) function for this
         for (int i=0; i<R->sizeParents(); ++i)
         {
-            if (const Relation* Parent = dynamic_cast<const Relation*>(R->getParent(i)))
+            if (const Relation* Parent = qobject_cast<const Relation*>(R->getParent(i)))
                 if (!Parent->isDeleted())
                     if (Parent->tagValue("type","") == "multipolygon")
                         return TagSelect_NoMatch;
@@ -704,11 +704,14 @@ TagSelectorMatchResult TagTemplate::matchesTag(const Feature* F)
     if ((res = theSelector->matches(F)))
         return res;
     // Special casing for multipolygon relations
-    if (const Relation* R = dynamic_cast<const Relation*>(F))
+    if (const Relation* R = qobject_cast<const Relation*>(F))
     {
-        for (int i=0; i<R->size(); ++i)
-            if ((res = theSelector->matches(R->get(i))))
-                return res;
+        if (R->tagValue("type","") == "multipolygon") {
+            for (int i=0; i<R->size(); ++i)
+                if (!R->get(i)->isDeleted())
+                    if ((res = theSelector->matches(R->get(i))))
+                        return res;
+        }
     }
     return TagSelect_NoMatch;
 }

--- End Message ---
--- Begin Message ---
-- 
 Bernd Zeimetz                            Debian GNU/Linux Developer
 http://bzed.de                                http://www.debian.org
 GPG Fingerprints: 06C8 C9A2 EAAD E37E 5B2C BE93 067A AD04 C93B FF79
                   ECA1 E3F2 8E11 2432 D485 DD95 EB36 171A 6FF9 435F


--- End Message ---

Reply to: