Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package heimer for openSUSE:Factory checked in at 2022-08-30 14:48:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/heimer (Old) and /work/SRC/openSUSE:Factory/.heimer.new.2083 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "heimer" Tue Aug 30 14:48:44 2022 rev:5 rq:999857 version:3.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/heimer/heimer.changes 2022-08-01 21:34:07.098296700 +0200 +++ /work/SRC/openSUSE:Factory/.heimer.new.2083/heimer.changes 2022-08-30 14:48:56.312037525 +0200 @@ -1,0 +2,8 @@ +Mon Aug 29 07:14:43 UTC 2022 - Michael Vetter <mvet...@suse.com> + +- Update to 3.6.0: + * Usability improvements: + + Show a dummy edge label with '...' when the actual label won't fit + + Stack edge text edits on top of nodes + +------------------------------------------------------------------- Old: ---- 3.5.0.tar.gz New: ---- 3.6.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ heimer.spec ++++++ --- /var/tmp/diff_new_pack.xi9XiA/_old 2022-08-30 14:48:56.984039240 +0200 +++ /var/tmp/diff_new_pack.xi9XiA/_new 2022-08-30 14:48:56.988039250 +0200 @@ -18,7 +18,7 @@ Name: heimer -Version: 3.5.0 +Version: 3.6.0 Release: 0 Summary: Mind map, diagram, and note-taking tool License: CC-BY-SA-3.0 AND GPL-3.0-only ++++++ 3.5.0.tar.gz -> 3.6.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.5.0/CHANGELOG new/Heimer-3.6.0/CHANGELOG --- old/Heimer-3.5.0/CHANGELOG 2022-07-30 20:14:08.000000000 +0200 +++ new/Heimer-3.6.0/CHANGELOG 2022-08-27 18:04:10.000000000 +0200 @@ -9,6 +9,19 @@ Other: +3.6.0 +===== + +Release date: + +Sat, 27 Aug 2022 19:03:46 +0300 + +New features: + +* Usability improvements: + - Show a dummy edge label with '...' when the actual label won't fit + - Stack edge text edits on top of nodes + 3.5.0 ===== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.5.0/CMakeLists.txt new/Heimer-3.6.0/CMakeLists.txt --- old/Heimer-3.5.0/CMakeLists.txt 2022-07-30 20:14:08.000000000 +0200 +++ new/Heimer-3.6.0/CMakeLists.txt 2022-08-27 18:04:10.000000000 +0200 @@ -26,7 +26,7 @@ # Global version set(VERSION_MAJOR 3) -set(VERSION_MINOR 5) +set(VERSION_MINOR 6) set(VERSION_PATCH 0) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.5.0/scripts/build-app-image new/Heimer-3.6.0/scripts/build-app-image --- old/Heimer-3.5.0/scripts/build-app-image 2022-07-30 20:14:08.000000000 +0200 +++ new/Heimer-3.6.0/scripts/build-app-image 2022-08-27 18:04:10.000000000 +0200 @@ -2,7 +2,7 @@ # Builds AppImage in Docker -HEIMER_VERSION=3.5.0 +HEIMER_VERSION=3.6.0 CMD="export LANG=en_US.UTF-8 && \ export LC_ALL=en_US.UTF-8 && \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.5.0/scripts/build-archive new/Heimer-3.6.0/scripts/build-archive --- old/Heimer-3.5.0/scripts/build-archive 2022-07-30 20:14:08.000000000 +0200 +++ new/Heimer-3.6.0/scripts/build-archive 2022-08-27 18:04:10.000000000 +0200 @@ -1 +1 @@ -git archive --format=tar.gz --prefix=heimer-3.5.0/ HEAD > heimer-3.5.0.tar.gz +git archive --format=tar.gz --prefix=heimer-3.6.0/ HEAD > heimer-3.6.0.tar.gz diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.5.0/scripts/build-windows-zip new/Heimer-3.6.0/scripts/build-windows-zip --- old/Heimer-3.5.0/scripts/build-windows-zip 2022-07-30 20:14:08.000000000 +0200 +++ new/Heimer-3.6.0/scripts/build-windows-zip 2022-08-27 18:04:10.000000000 +0200 @@ -2,7 +2,7 @@ # Builds ZIP archive for Windows in Docker -VERSION=3.5.0 +VERSION=3.6.0 CMAKE=/mxe/usr/bin/i686-w64-mingw32.static-cmake diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.5.0/snapcraft.yaml new/Heimer-3.6.0/snapcraft.yaml --- old/Heimer-3.5.0/snapcraft.yaml 2022-07-30 20:14:08.000000000 +0200 +++ new/Heimer-3.6.0/snapcraft.yaml 2022-08-27 18:04:10.000000000 +0200 @@ -1,5 +1,5 @@ name: heimer -version: '3.5.0' +version: '3.6.0' summary: Heimer is a simple cross-platform mind map tool. description: | Heimer is a simple cross-platform mind map creation tool. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.5.0/src/edge.cpp new/Heimer-3.6.0/src/edge.cpp --- old/Heimer-3.5.0/src/edge.cpp 2022-07-30 20:14:08.000000000 +0200 +++ new/Heimer-3.6.0/src/edge.cpp 2022-08-27 18:04:10.000000000 +0200 @@ -51,6 +51,7 @@ , m_sourceDot(enableAnimations ? new EdgeDot(this) : nullptr) , m_targetDot(enableAnimations ? new EdgeDot(this) : nullptr) , m_label(enableLabel ? new EdgeTextEdit(this) : nullptr) + , m_dummyLabel(enableLabel ? new EdgeTextEdit(this) : nullptr) , m_arrowheadL0(new QGraphicsLineItem(this)) , m_arrowheadR0(new QGraphicsLineItem(this)) , m_arrowheadL1(new QGraphicsLineItem(this)) @@ -77,6 +78,20 @@ connect(m_label, &TextEdit::undoPointRequested, this, &Edge::undoPointRequested); + m_dummyLabel->setZValue(static_cast<int>(Layers::EdgeDummyLabel)); + m_dummyLabel->setAcceptHoverEvents(false); + m_dummyLabel->setBackgroundColor(Constants::Edge::LABEL_COLOR); + m_dummyLabel->setText(tr("...")); + m_dummyLabel->setEnabled(false); + + connect(m_label, &EdgeTextEdit::hoverEntered, this, [=] { + setLabelVisible(true, EdgeTextEdit::VisibilityChangeReason::Focused); + }); + + connect(m_label, &EdgeTextEdit::visibilityTimeout, this, [=] { + setLabelVisible(false); + }); + m_labelVisibilityTimer.setSingleShot(true); m_labelVisibilityTimer.setInterval(Constants::Edge::LABEL_DURATION); @@ -107,7 +122,7 @@ { m_labelVisibilityTimer.stop(); - setLabelVisible(true); + setLabelVisible(true, EdgeTextEdit::VisibilityChangeReason::Focused); QGraphicsItem::hoverEnterEvent(event); } @@ -140,13 +155,14 @@ void Edge::changeFont(const QFont & font) { - if (m_label) { + if (m_enableLabel) { // Handle size and family separately to maintain backwards compatibility QFont newFont(font); if (m_label->font().pointSize() >= 0) { newFont.setPointSize(m_label->font().pointSize()); } m_label->setFont(newFont); + m_dummyLabel->setFont(newFont); } } @@ -195,8 +211,40 @@ void Edge::setLabelVisible(bool visible, EdgeTextEdit::VisibilityChangeReason vcr) { - if (m_label) { - m_label->setVisible(visible, vcr); + if (m_enableLabel) { + const bool isEnoughSpaceForLabel = !m_label->sceneBoundingRect().intersects(sourceNode().sceneBoundingRect()) && // + !m_label->sceneBoundingRect().intersects(targetNode().sceneBoundingRect()); + const bool dummyLabelTextIsShoterThanLabelText = m_dummyLabel->text().length() < m_label->text().length(); + const bool isEnoughSpaceForDummyLabel = !m_dummyLabel->sceneBoundingRect().intersects(sourceNode().sceneBoundingRect()) && // + !m_dummyLabel->sceneBoundingRect().intersects(targetNode().sceneBoundingRect()); + switch (vcr) { + case EdgeTextEdit::VisibilityChangeReason::AvailableSpaceChanged: { + // Toggle visibility according to space available if geometry changed + const bool isLabelVisible = isEnoughSpaceForLabel && !m_label->text().isEmpty(); + m_label->setVisible(isLabelVisible); + m_dummyLabel->setVisible(!isLabelVisible && isEnoughSpaceForDummyLabel && dummyLabelTextIsShoterThanLabelText); + } break; + case EdgeTextEdit::VisibilityChangeReason::Explicit: { + m_label->setVisible(visible); + m_dummyLabel->setVisible(visible); + } break; + case EdgeTextEdit::VisibilityChangeReason::Focused: { + if (visible) { + m_label->setVisible(true); + m_label->setParentItem(nullptr); + m_label->setGraphicsEffect(GraphicsFactory::createDropShadowEffect(false, SettingsProxy::instance().shadowEffect())); + m_dummyLabel->setVisible(false); + } + } break; + case EdgeTextEdit::VisibilityChangeReason::Timeout: { + if (!visible) { + if ((m_label->text().isEmpty() || (!m_label->text().isEmpty() && !isEnoughSpaceForLabel)) && !m_label->hasFocus()) { + m_label->setVisible(false); + m_dummyLabel->setVisible(isEnoughSpaceForDummyLabel && dummyLabelTextIsShoterThanLabelText); + } + } + } break; + } } } @@ -245,10 +293,10 @@ { m_text = text; if (!TestMode::enabled()) { - if (m_label) { + if (m_enableLabel) { m_label->setText(text); + setLabelVisible(!text.isEmpty()); } - setLabelVisible(!text.isEmpty()); } else { TestMode::logDisabledCode("Set label text"); } @@ -256,12 +304,9 @@ void Edge::setTextSize(int textSize) { - if (textSize <= 0) { - return; - } - - if (m_label) { + if (m_enableLabel && textSize > 0) { m_label->setTextSize(textSize); + m_dummyLabel->setTextSize(textSize); } } @@ -386,12 +431,12 @@ void Edge::updateLabel(LabelUpdateReason lur) { - if (m_label) { + if (m_enableLabel) { m_label->setPos((line().p1() + line().p2()) * 0.5 - QPointF(m_label->boundingRect().width(), m_label->boundingRect().height()) * 0.5); - + m_dummyLabel->setPos((line().p1() + line().p2()) * 0.5 - QPointF(m_dummyLabel->boundingRect().width(), m_dummyLabel->boundingRect().height()) * 0.5); // Toggle visibility according to space available if geometry changed if (lur == LabelUpdateReason::EdgeGeometryChanged) { - setLabelVisible(!m_label->sceneBoundingRect().intersects(sourceNode().sceneBoundingRect()) && !m_label->sceneBoundingRect().intersects(targetNode().sceneBoundingRect()), EdgeTextEdit::VisibilityChangeReason::AvailableSpaceChanged); + setLabelVisible(m_label->isVisible(), EdgeTextEdit::VisibilityChangeReason::AvailableSpaceChanged); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.5.0/src/edge.hpp new/Heimer-3.6.0/src/edge.hpp --- old/Heimer-3.5.0/src/edge.hpp 2022-07-30 20:14:08.000000000 +0200 +++ new/Heimer-3.6.0/src/edge.hpp 2022-08-27 18:04:10.000000000 +0200 @@ -123,7 +123,7 @@ void setArrowHeadPen(const QPen & pen); - void setLabelVisible(bool visible, EdgeTextEdit::VisibilityChangeReason vcr = EdgeTextEdit::VisibilityChangeReason::Default); + void setLabelVisible(bool visible, EdgeTextEdit::VisibilityChangeReason vcr = EdgeTextEdit::VisibilityChangeReason::Timeout); void updateArrowhead(); @@ -173,6 +173,8 @@ EdgeTextEdit * m_label; + EdgeTextEdit * m_dummyLabel; + QGraphicsLineItem * m_arrowheadL0; QGraphicsLineItem * m_arrowheadR0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.5.0/src/edge_text_edit.cpp new/Heimer-3.6.0/src/edge_text_edit.cpp --- old/Heimer-3.5.0/src/edge_text_edit.cpp 2022-07-30 20:14:08.000000000 +0200 +++ new/Heimer-3.6.0/src/edge_text_edit.cpp 2022-08-27 18:04:10.000000000 +0200 @@ -33,7 +33,7 @@ m_visibilityTimer.setInterval(Constants::Edge::TEXT_EDIT_DURATION); connect(&m_visibilityTimer, &QTimer::timeout, this, [=] { - setVisible(false); + emit visibilityTimeout(); }); } @@ -41,9 +41,9 @@ { m_visibilityTimer.stop(); - setVisible(true); - TextEdit::hoverEnterEvent(event); + + emit hoverEntered(); } void EdgeTextEdit::hoverLeaveEvent(QGraphicsSceneHoverEvent * event) @@ -69,20 +69,12 @@ } } -void EdgeTextEdit::setVisible(bool visible, VisibilityChangeReason vcr) +void EdgeTextEdit::setVisible(bool visible) { - switch (vcr) { - case VisibilityChangeReason::Default: - if (visible) { - setAnimationConfig(true); - } else if (text().isEmpty()) { - setAnimationConfig(false); - } - break; - case VisibilityChangeReason::AvailableSpaceChanged: - if (!text().isEmpty()) { - setAnimationConfig(visible); - } - break; - } + setAnimationConfig(visible); +} + +void EdgeTextEdit::updateDueToLostFocus() +{ + m_visibilityTimer.start(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.5.0/src/edge_text_edit.hpp new/Heimer-3.6.0/src/edge_text_edit.hpp --- old/Heimer-3.5.0/src/edge_text_edit.hpp 2022-07-30 20:14:08.000000000 +0200 +++ new/Heimer-3.6.0/src/edge_text_edit.hpp 2022-08-27 18:04:10.000000000 +0200 @@ -26,21 +26,33 @@ class EdgeTextEdit : public TextEdit { + Q_OBJECT + public: EdgeTextEdit(EdgeP parentItem); enum class VisibilityChangeReason { - Default, + Timeout, + Explicit, + Focused, AvailableSpaceChanged }; - void setVisible(bool visible, VisibilityChangeReason vcr = VisibilityChangeReason::Default); + void setVisible(bool visible); + + void updateDueToLostFocus(); virtual void hoverEnterEvent(QGraphicsSceneHoverEvent * event) override; virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent * event) override; +signals: + + void hoverEntered(); + + void visibilityTimeout(); + private: void setAnimationConfig(bool visible); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.5.0/src/editor_scene.cpp new/Heimer-3.6.0/src/editor_scene.cpp --- old/Heimer-3.5.0/src/editor_scene.cpp 2022-07-30 20:14:08.000000000 +0200 +++ new/Heimer-3.6.0/src/editor_scene.cpp 2022-08-27 18:04:10.000000000 +0200 @@ -17,6 +17,7 @@ #include "constants.hpp" #include "edge.hpp" +#include "edge_text_edit.hpp" #include "magic_zoom.hpp" #include "node.hpp" @@ -33,6 +34,12 @@ const auto rW = Constants::Scene::INITIAL_SIZE; const auto rH = Constants::Scene::INITIAL_SIZE; setSceneRect(-rW, -rH, rW * 2, rH * 2); + + connect(this, &QGraphicsScene::focusItemChanged, this, [](QGraphicsItem *, QGraphicsItem * oldFocus, Qt::FocusReason) { + if (const auto edgeTextEdit = dynamic_cast<EdgeTextEdit *>(oldFocus); edgeTextEdit) { + edgeTextEdit->updateDueToLostFocus(); + } + }); } void EditorScene::adjustSceneRect() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.5.0/src/layers.hpp new/Heimer-3.6.0/src/layers.hpp --- old/Heimer-3.5.0/src/layers.hpp 2022-07-30 20:14:08.000000000 +0200 +++ new/Heimer-3.6.0/src/layers.hpp 2022-08-27 18:04:10.000000000 +0200 @@ -20,7 +20,8 @@ { Edge = 1, EdgeDot = 20, - EdgeLabel = 25, + EdgeDummyLabel = 24, + EdgeLabel = 45, NodeHandle = 30, Node = 10 }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.5.0/src/layout_optimizer.cpp new/Heimer-3.6.0/src/layout_optimizer.cpp --- old/Heimer-3.5.0/src/layout_optimizer.cpp 2022-07-30 20:14:08.000000000 +0200 +++ new/Heimer-3.6.0/src/layout_optimizer.cpp 2022-08-27 18:04:10.000000000 +0200 @@ -58,19 +58,19 @@ { juzzlin::L().info() << "Initializing LayoutOptimizer: aspectRatio=" << aspectRatio << ", minEdgeLength=" << minEdgeLength; - if (!m_mindMapData->graph().numNodes()) { + const auto nodes = m_mindMapData->graph().getNodes(); + if (nodes.empty()) { juzzlin::L().info() << "No nodes"; return false; } double area = 0; - for (auto && node : m_mindMapData->graph().getNodes()) { + for (auto && node : nodes) { area += (node->size().width() + minEdgeLength) * (node->size().height() + minEdgeLength); } // Build initial layout - auto nodes = m_mindMapData->graph().getNodes(); const auto originalLayoutDimensions = calculateLayoutDimensions(nodes); juzzlin::L().info() << "Area: " << originalLayoutDimensions.height() * originalLayoutDimensions.width(); const double height = std::sqrt(area / aspectRatio);