Skip to content

Commit

Permalink
Enable hover effect on items when items not selected. #11
Browse files Browse the repository at this point in the history
  • Loading branch information
DamirPorobic committed Jun 5, 2018
1 parent 531dc66 commit 8ad035d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/annotations/core/AnnotationArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ AnnotationArea::AnnotationArea()
connect(mKeyHelper, &KeyHelper::deleteReleased, this, &AnnotationArea::deleteSelectedItems);
connect(mKeyHelper, &KeyHelper::escapeReleased, mItemModifier, &AnnotationItemModifier::clearSelection);

connect(mConfig, &Config::toolChanged, this, &AnnotationArea::setCursorForTool);
connect(mConfig, &Config::toolChanged, this, &AnnotationArea::setItemDecorationForTool);

connect(mKeyHelper, &KeyHelper::undoPressed, mUndoStack, &UndoStack::undo);
connect(mKeyHelper, &KeyHelper::redoPressed, mUndoStack, &UndoStack::redo);
Expand Down Expand Up @@ -184,13 +184,15 @@ void AnnotationArea::addPointToCurrentItem(const QPointF &position)
mCurrentItem->addPoint(position, mKeyHelper->isControlPressed());
}

void AnnotationArea::setCursorForTool(ToolTypes tool)
void AnnotationArea::setItemDecorationForTool(ToolTypes tool)
{
for (auto item : *mItems) {
if (tool == ToolTypes::Select) {
item->setCursor(CursorHelper::movableCursor());
item->setHoverEffectEnabled(true);
} else {
item->unsetCursor();
item->setHoverEffectEnabled(false);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/annotations/core/AnnotationArea.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public slots:

void addItemAtPosition(const QPointF& position);
void addPointToCurrentItem(const QPointF& position);
void setCursorForTool(ToolTypes tool);
void setItemDecorationForTool(ToolTypes tool);

private slots:
void deleteSelectedItems();
Expand Down

0 comments on commit 8ad035d

Please sign in to comment.