Skip to content

Commit 74de077

Browse files
committed
Blur disabled modules
1 parent 409e86a commit 74de077

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

src/Interface/Application/ModuleProxyWidget.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ ModuleProxyWidget::ModuleProxyWidget(ModuleWidget* module, QGraphicsItem* parent
118118
module_(module),
119119
grabbedByWidget_(false),
120120
isSelected_(false),
121-
pressedSubWidget_(0),
121+
pressedSubWidget_(nullptr),
122122
doHighlight_(false)
123123
{
124124
setWidget(module);
@@ -128,6 +128,7 @@ ModuleProxyWidget::ModuleProxyWidget(ModuleWidget* module, QGraphicsItem* parent
128128
connect(module, SIGNAL(noteUpdated(const Note&)), this, SLOT(updateNote(const Note&)));
129129
connect(module, SIGNAL(requestModuleVisible()), this, SLOT(ensureThisVisible()));
130130
connect(module, SIGNAL(deleteMeLater()), this, SLOT(deleteLater()));
131+
connect(module, SIGNAL(moduleDisabled(bool)), this, SLOT(disableModuleGUI(bool)));
131132

132133
stackDepth_ = 0;
133134
}
@@ -170,6 +171,14 @@ ModuleWidget* ModuleProxyWidget::getModuleWidget()
170171
return module_;
171172
}
172173

174+
void ModuleProxyWidget::disableModuleGUI(bool disabled)
175+
{
176+
if (disabled)
177+
setGraphicsEffect(blurEffect(3));
178+
else
179+
setGraphicsEffect(nullptr);
180+
}
181+
173182
void ModuleProxyWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)
174183
{
175184
auto taggingOn = data(TagLayerKey).toBool();

src/Interface/Application/ModuleProxyWidget.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace SCIRun
4444
Q_OBJECT
4545

4646
public:
47-
explicit ModuleProxyWidget(ModuleWidget* module, QGraphicsItem* parent = 0);
47+
explicit ModuleProxyWidget(ModuleWidget* module, QGraphicsItem* parent = nullptr);
4848
~ModuleProxyWidget();
4949
ModuleWidget* getModuleWidget();
5050
void createStartupNote();
@@ -71,6 +71,7 @@ namespace SCIRun
7171
private Q_SLOTS:
7272
void updateNote(const Note& note);
7373
void ensureThisVisible();
74+
void disableModuleGUI(bool disabled);
7475
private:
7576
void ensureItemVisible(QGraphicsItem* item);
7677
bool isSubwidget(QWidget* alienWidget) const;

src/Interface/Application/ModuleWidget.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,11 +1498,7 @@ void ModuleWidget::incomingConnectionStateChanged(bool disabled)
14981498
}
14991499
qDebug() << "MODULE DISABLED SET " << getModuleId().c_str() << " to " << disabled_;
15001500

1501-
//TODO: need to set this on proxy widget
1502-
if (disabled_)
1503-
setGraphicsEffect(blurEffect(3));
1504-
else
1505-
setGraphicsEffect(nullptr);
1501+
Q_EMIT moduleDisabled(disabled_);
15061502

15071503
for (const auto& output : ports().outputs())
15081504
{

src/Interface/Application/ModuleWidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ public Q_SLOTS:
194194
void disableWidgetDisabling();
195195
void reenableWidgetDisabling();
196196
void executeAgain();
197+
void moduleDisabled(bool disabled);
197198
private Q_SLOTS:
198199
void updateBackgroundColorForModuleState(int moduleState);
199200
void updateBackgroundColor(const QString& color);

0 commit comments

Comments
 (0)