summaryrefslogtreecommitdiffstats
path: root/src/widgets/fill-style.cpp
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-08-01 07:53:08 +0000
committerJohn Smith <john.smith7545@yahoo.com>2012-08-01 07:53:08 +0000
commitbc8ef04f993b3f17c55dbcbeac7d942994eb05d1 (patch)
treef3dcaef08b8b5cf62297e5be71af05efda6992af /src/widgets/fill-style.cpp
parentFix for 512247 : Show the direction in Object/Transform/Rotate (diff)
downloadinkscape-bc8ef04f993b3f17c55dbcbeac7d942994eb05d1.tar.gz
inkscape-bc8ef04f993b3f17c55dbcbeac7d942994eb05d1.zip
Fix for 1029302 : Fill/Stroke dialog does not update on tool change
(bzr r11579)
Diffstat (limited to 'src/widgets/fill-style.cpp')
-rw-r--r--src/widgets/fill-style.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp
index fe24d0165..32619de1f 100644
--- a/src/widgets/fill-style.cpp
+++ b/src/widgets/fill-style.cpp
@@ -84,6 +84,7 @@ private:
static void fillruleChangedCB( SPPaintSelector *psel, SPPaintSelector::FillRule mode, FillNStroke *self );
void selectionModifiedCB(guint flags);
+ void eventContextCB(SPDesktop *desktop, SPEventContext *eventcontext);
void dragFromPaint();
void updateFromPaint();
@@ -99,6 +100,7 @@ private:
sigc::connection selectChangedConn;
sigc::connection subselChangedConn;
sigc::connection selectModifiedConn;
+ sigc::connection eventContextConn;
};
} // namespace Inkscape
@@ -133,7 +135,8 @@ FillNStroke::FillNStroke( FillOrStroke kind ) :
update(false),
selectChangedConn(),
subselChangedConn(),
- selectModifiedConn()
+ selectModifiedConn(),
+ eventContextConn()
{
// Add and connect up the paint selector widget:
psel = sp_paint_selector_new(kind);
@@ -169,6 +172,7 @@ FillNStroke::~FillNStroke()
selectModifiedConn.disconnect();
subselChangedConn.disconnect();
selectChangedConn.disconnect();
+ eventContextConn.disconnect();
}
/**
@@ -197,11 +201,13 @@ void FillNStroke::setDesktop(SPDesktop *desktop)
selectModifiedConn.disconnect();
subselChangedConn.disconnect();
selectChangedConn.disconnect();
+ eventContextConn.disconnect();
}
this->desktop = desktop;
if (desktop && desktop->selection) {
selectChangedConn = desktop->selection->connectChanged(sigc::hide(sigc::mem_fun(*this, &FillNStroke::performUpdate)));
subselChangedConn = desktop->connectToolSubselectionChanged(sigc::hide(sigc::mem_fun(*this, &FillNStroke::performUpdate)));
+ eventContextConn = desktop->connectEventContextChanged(sigc::hide(sigc::bind(sigc::mem_fun(*this, &FillNStroke::eventContextCB), (SPEventContext *)NULL)));
// Must check flags, so can't call performUpdate() directly.
selectModifiedConn = desktop->selection->connectModified(sigc::hide<0>(sigc::mem_fun(*this, &FillNStroke::selectionModifiedCB)));
@@ -211,6 +217,16 @@ void FillNStroke::setDesktop(SPDesktop *desktop)
}
/**
+ * Listen to this "change in tool" event, in case a subselection tool (such as Gradient or Node) selection
+ * is changed back to a selection tool - especially needed for selected gradient stops.
+ */
+void FillNStroke::eventContextCB(SPDesktop *desktop, SPEventContext *eventcontext)
+{
+ performUpdate();
+}
+
+
+/**
* Gets the active fill or stroke style property, then sets the appropriate
* color, alpha, gradient, pattern, etc. for the paint-selector.
*