From 10d739ce2ac904501a6f78b127f91c944a774a18 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sun, 15 Apr 2018 11:19:38 +0300 Subject: added icon and fixed edge handle bug --- images/logo.ico | Bin 0 -> 14347 bytes src/gui/tikzscene.cpp | 11 ++++++----- tikzit.pro | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 images/logo.ico diff --git a/images/logo.ico b/images/logo.ico new file mode 100644 index 0000000..ef92c90 Binary files /dev/null and b/images/logo.ico 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(sel[0])) { + foreach (QGraphicsItem *it, items(mousePos)) { + if (EdgeItem *ei = dynamic_cast(it)) { ChangeEdgeModeCommand *cmd = new ChangeEdgeModeCommand(this, ei->edge()); _tikzDocument->undoStack()->push(cmd); - } else if (NodeItem *ni = dynamic_cast(sel[0])) { + break; + } else if (NodeItem *ni = dynamic_cast(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 -- cgit v1.2.3