diff --git a/include/graphlogic.h b/include/graphlogic.h index 10442b0..9646fd8 100644 --- a/include/graphlogic.h +++ b/include/graphlogic.h @@ -62,8 +62,8 @@ private: void moveRight(); void move(const int &x, const int &y); /// @todo Rewrite as an undo action - void setNodeColor(const QColor &color); /// @todo Rewrite as an undo action - void setNodeTextColor(const QColor &color); /// @todo Rewrite as an undo action + void setNodeColor(const QColor &color, const bool &subtree = false); /// @todo Rewrite as an undo action + void setNodeTextColor(const QColor &color, const bool &subtree = false); /// @todo Rewrite as an undo action // hint mode void appendNumber(const int &unm); diff --git a/other/create_deb.sh b/other/create_deb.sh index 7efbd9c..74197d2 100755 --- a/other/create_deb.sh +++ b/other/create_deb.sh @@ -42,7 +42,7 @@ Version: 0.2 Section: base Priority: optional Architecture: all -Depends: qt (>= 4.5) +Depends: libqtcore4 (>= 4.6), libqtgui4 (>= 4.6), libqt4-svg (>= 4.6), libqt4-xml (>= 4.6) Maintainer: Dénes Mátételki Homepage: https://gitorious.org/qtmindmap Description: Mindmap software in Qt." > $packagedir/DEBIAN/control diff --git a/src/graphlogic.cpp b/src/graphlogic.cpp index 85f9b03..f14342b 100644 --- a/src/graphlogic.cpp +++ b/src/graphlogic.cpp @@ -412,6 +412,9 @@ void GraphLogic::nodeColor() return; } + bool subtree(QApplication::keyboardModifiers() & Qt::ControlModifier && + QApplication::keyboardModifiers() & Qt::ShiftModifier); + // popup a color selector dialogm def color is the curr one. QColorDialog dialog(m_graphWidget); dialog.setWindowTitle(tr("Select node color")); @@ -419,7 +422,7 @@ void GraphLogic::nodeColor() if (!dialog.exec()) return; - setNodeColor(dialog.selectedColor()); + setNodeColor(dialog.selectedColor(), subtree); } void GraphLogic::nodeTextColor() @@ -430,6 +433,9 @@ void GraphLogic::nodeTextColor() return; } + bool subtree(QApplication::keyboardModifiers() & Qt::ControlModifier && + QApplication::keyboardModifiers() & Qt::ShiftModifier); + // popup a color selector dialogm def color is the curr one. QColorDialog dialog(m_graphWidget); dialog.setWindowTitle(tr("Select text color")); @@ -437,7 +443,7 @@ void GraphLogic::nodeTextColor() if (!dialog.exec()) return; - setNodeTextColor(dialog.selectedColor()); + setNodeTextColor(dialog.selectedColor(), subtree); } void GraphLogic::addEdge() @@ -599,11 +605,10 @@ void GraphLogic::move(const int &x, const int &y) } } -void GraphLogic::setNodeColor(const QColor &color) +void GraphLogic::setNodeColor(const QColor &color, const bool &subtree) { QList nodeList; - if (QApplication::keyboardModifiers() & Qt::ControlModifier && - QApplication::keyboardModifiers() & Qt::ShiftModifier) + if (subtree) { nodeList = m_activeNode->subtree(); } @@ -620,11 +625,10 @@ void GraphLogic::setNodeColor(const QColor &color) } } -void GraphLogic::setNodeTextColor(const QColor &color) +void GraphLogic::setNodeTextColor(const QColor &color, const bool &subtree) { QList nodeList; - if (QApplication::keyboardModifiers() & Qt::ControlModifier && - QApplication::keyboardModifiers() & Qt::ShiftModifier) + if (subtree) { nodeList = m_activeNode->subtree(); }