summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2018-04-15 11:19:38 +0300
committerAleks Kissinger <aleks0@gmail.com>2018-04-15 11:19:38 +0300
commit10d739ce2ac904501a6f78b127f91c944a774a18 (patch)
tree93efc2ecefceb408acd774a007563432484c530d
parenteac7dee2d8ba86001afbc61c4e9d7baae7341cb8 (diff)
added icon and fixed edge handle bug
-rw-r--r--images/logo.icobin0 -> 14347 bytes
-rw-r--r--src/gui/tikzscene.cpp11
-rw-r--r--tikzit.pro2
3 files changed, 8 insertions, 5 deletions
diff --git a/images/logo.ico b/images/logo.ico
new file mode 100644
index 0000000..ef92c90
--- /dev/null
+++ b/images/logo.ico
Binary files differ
diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp
index 9b6c2d6..345d02c 100644
--- a/src/gui/tikzscene.cpp
+++ b/src/gui/tikzscene.cpp
@@ -97,7 +97,7 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event)
//views()[0]->setDragMode(QGraphicsView::NoDrag);
// radius of a control point for bezier edges, in scene coordinates
- qreal cpR = GLOBAL_SCALEF * (0.05);
+ qreal cpR = GLOBAL_SCALEF * (0.1);
qreal cpR2 = cpR * cpR;
switch (_tools->currentTool()) {
@@ -511,13 +511,13 @@ void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
if (!_enabled) return;
QPointF mousePos = event->scenePos();
- auto sel = items(mousePos);
- if (!sel.isEmpty()) {
- if (EdgeItem *ei = dynamic_cast<EdgeItem*>(sel[0])) {
+ foreach (QGraphicsItem *it, items(mousePos)) {
+ if (EdgeItem *ei = dynamic_cast<EdgeItem*>(it)) {
ChangeEdgeModeCommand *cmd = new ChangeEdgeModeCommand(this, ei->edge());
_tikzDocument->undoStack()->push(cmd);
- } else if (NodeItem *ni = dynamic_cast<NodeItem*>(sel[0])) {
+ break;
+ } else if (NodeItem *ni = dynamic_cast<NodeItem*>(it)) {
bool ok;
QString newLabel = QInputDialog::getText(views()[0], tr("Node label"),
tr("Label:"), QLineEdit::Normal,
@@ -528,6 +528,7 @@ void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
ChangeLabelCommand *cmd = new ChangeLabelCommand(this, graph(), oldLabels, newLabel);
_tikzDocument->undoStack()->push(cmd);
}
+ break;
}
}
}
diff --git a/tikzit.pro b/tikzit.pro
index 33a9ef3..c30d173 100644
--- a/tikzit.pro
+++ b/tikzit.pro
@@ -10,6 +10,8 @@ CONFIG += testcase
TARGET = tikzit
TEMPLATE = app
+win32:RC_ICONS += images/logo.ico
+
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the