Fix bug destroying ShadeWidgets of Select type

We don't need to listen the ColorBar in shade widgets that are used
in the menu popup.
This commit is contained in:
David Capello 2015-11-26 20:09:53 -03:00
parent 8a7a585362
commit c33e63bed7

View File

@ -37,6 +37,7 @@
#include "app/ui/skin/style.h"
#include "app/ui_context.h"
#include "base/bind.h"
#include "base/connection.h"
#include "base/scoped_value.h"
#include "base/unique_ptr.h"
#include "doc/brush.h"
@ -536,8 +537,10 @@ class ContextBar::InkShadesField : public HBox {
switch (msg->type()) {
case kOpenMessage:
ColorBar::instance()->ChangeSelection.connect(
Bind<void>(&ShadeWidget::onChangeColorBarSelection, this));
if (m_click == DragAndDrop) {
m_conn = ColorBar::instance()->ChangeSelection.connect(
Bind<void>(&ShadeWidget::onChangeColorBarSelection, this));
}
break;
case kSetCursorMessage:
@ -710,6 +713,7 @@ class ContextBar::InkShadesField : public HBox {
int m_dragIndex;
bool m_dropBefore;
int m_boxSize;
ScopedConnection m_conn;
};
public: