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-09-22 16:59:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/heimer (Old) and /work/SRC/openSUSE:Factory/.heimer.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "heimer" Thu Sep 22 16:59:19 2022 rev:6 rq:1005391 version:3.6.1 Changes: -------- --- /work/SRC/openSUSE:Factory/heimer/heimer.changes 2022-08-30 14:48:56.312037525 +0200 +++ /work/SRC/openSUSE:Factory/.heimer.new.2275/heimer.changes 2022-09-22 16:59:20.838209983 +0200 @@ -1,0 +2,9 @@ +Thu Sep 22 11:09:46 UTC 2022 - Michael Vetter <mvet...@suse.com> + +- Update to 3.6.1: + * Fix shadow effect of edge label when edge is selected + * Fix edge label not deleted together with the edge + * Fix edge context menu not opening when edge text edit right-clicked + * constants.hpp: added to QVector so that the compiler wouldn't throw an error + +------------------------------------------------------------------- Old: ---- 3.6.0.tar.gz New: ---- 3.6.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ heimer.spec ++++++ --- /var/tmp/diff_new_pack.YikCj4/_old 2022-09-22 16:59:21.538211276 +0200 +++ /var/tmp/diff_new_pack.YikCj4/_new 2022-09-22 16:59:21.546211291 +0200 @@ -18,7 +18,7 @@ Name: heimer -Version: 3.6.0 +Version: 3.6.1 Release: 0 Summary: Mind map, diagram, and note-taking tool License: CC-BY-SA-3.0 AND GPL-3.0-only ++++++ 3.6.0.tar.gz -> 3.6.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/CHANGELOG new/Heimer-3.6.1/CHANGELOG --- old/Heimer-3.6.0/CHANGELOG 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/CHANGELOG 2022-09-21 20:29:41.000000000 +0200 @@ -9,6 +9,25 @@ Other: +3.6.1 +===== + +Release date: + +Wed, 21 Sep 2022 18:26:35 -0000 + +Bug fixes: + +* Fix shadow effect of edge label when edge is selected + +* Fix edge label not deleted together with the edge + +* Fix edge context menu not opening when edge text edit right-clicked + +Other: + +* constants.hpp: added <qreal> to QVector so that the compiler wouldn't throw an error + 3.6.0 ===== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/CMakeLists.txt new/Heimer-3.6.1/CMakeLists.txt --- old/Heimer-3.6.0/CMakeLists.txt 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/CMakeLists.txt 2022-09-21 20:29:41.000000000 +0200 @@ -27,7 +27,7 @@ # Global version set(VERSION_MAJOR 3) set(VERSION_MINOR 6) -set(VERSION_PATCH 0) +set(VERSION_PATCH 1) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") # Some common CPack variables diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/scripts/build-app-image new/Heimer-3.6.1/scripts/build-app-image --- old/Heimer-3.6.0/scripts/build-app-image 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/scripts/build-app-image 2022-09-21 20:29:41.000000000 +0200 @@ -2,7 +2,7 @@ # Builds AppImage in Docker -HEIMER_VERSION=3.6.0 +HEIMER_VERSION=3.6.1 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.6.0/scripts/build-archive new/Heimer-3.6.1/scripts/build-archive --- old/Heimer-3.6.0/scripts/build-archive 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/scripts/build-archive 2022-09-21 20:29:41.000000000 +0200 @@ -1 +1 @@ -git archive --format=tar.gz --prefix=heimer-3.6.0/ HEAD > heimer-3.6.0.tar.gz +git archive --format=tar.gz --prefix=heimer-3.6.1/ HEAD > heimer-3.6.1.tar.gz diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/scripts/build-windows-zip new/Heimer-3.6.1/scripts/build-windows-zip --- old/Heimer-3.6.0/scripts/build-windows-zip 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/scripts/build-windows-zip 2022-09-21 20:29:41.000000000 +0200 @@ -2,7 +2,7 @@ # Builds ZIP archive for Windows in Docker -VERSION=3.6.0 +VERSION=3.6.1 CMAKE=/mxe/usr/bin/i686-w64-mingw32.static-cmake diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/snapcraft.yaml new/Heimer-3.6.1/snapcraft.yaml --- old/Heimer-3.6.0/snapcraft.yaml 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/snapcraft.yaml 2022-09-21 20:29:41.000000000 +0200 @@ -1,5 +1,5 @@ name: heimer -version: '3.6.0' +version: '3.6.1' 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.6.0/src/CMakeLists.txt new/Heimer-3.6.1/src/CMakeLists.txt --- old/Heimer-3.6.0/src/CMakeLists.txt 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/src/CMakeLists.txt 2022-09-21 20:29:41.000000000 +0200 @@ -23,6 +23,7 @@ alz_serializer.cpp application.cpp constants.hpp + control_strategy.cpp copy_context.cpp edge.cpp edge_context_menu.cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/src/constants.hpp new/Heimer-3.6.1/src/constants.hpp --- old/Heimer-3.6.0/src/constants.hpp 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/src/constants.hpp 2022-09-21 20:29:41.000000000 +0200 @@ -65,7 +65,7 @@ static const double CORNER_RADIUS_SCALE = 0.3; -static const QVector DASH_PATTERN { qreal(5), qreal(5) }; +static const QVector<qreal> DASH_PATTERN { qreal(5), qreal(5) }; static const QColor DOT_COLOR { 255, 0, 0, 192 }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/src/control_strategy.cpp new/Heimer-3.6.1/src/control_strategy.cpp --- old/Heimer-3.6.0/src/control_strategy.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/Heimer-3.6.1/src/control_strategy.cpp 2022-09-21 20:29:41.000000000 +0200 @@ -0,0 +1,53 @@ +// This file is part of Heimer. +// Copyright (C) 2022 Jussi Lind <jussi.l...@iki.fi> +// +// Heimer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// Heimer is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Heimer. If not, see <http://www.gnu.org/licenses/>. + +#include "control_strategy.hpp" + +#include <QGuiApplication> +#include <QMouseEvent> + +ControlStrategy::ControlStrategy() +{ +} + +bool ControlStrategy::isModifierPressed() const +{ + return QGuiApplication::queryKeyboardModifiers().testFlag(Qt::ControlModifier) || QGuiApplication::queryKeyboardModifiers().testFlag(Qt::ShiftModifier); +} + +bool ControlStrategy::backgroundDragInitiated(QMouseEvent & event) const +{ + return event.button() == Qt::LeftButton; +} + +bool ControlStrategy::rubberBandInitiated(QMouseEvent & event) const +{ + return (event.button() == Qt::LeftButton && isModifierPressed()) || event.button() == Qt::MiddleButton; +} + +bool ControlStrategy::primaryButtonClicked(QMouseEvent & event) const +{ + return event.button() == Qt::LeftButton; +} + +bool ControlStrategy::secondaryButtonClicked(QMouseEvent & event) const +{ + return event.button() == Qt::RightButton; +} + +void ControlStrategy::setInvertedMode(bool invertedMode) +{ + m_invertedMode = invertedMode; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/src/control_strategy.hpp new/Heimer-3.6.1/src/control_strategy.hpp --- old/Heimer-3.6.0/src/control_strategy.hpp 1970-01-01 01:00:00.000000000 +0100 +++ new/Heimer-3.6.1/src/control_strategy.hpp 2022-09-21 20:29:41.000000000 +0200 @@ -0,0 +1,42 @@ +// This file is part of Heimer. +// Copyright (C) 2022 Jussi Lind <jussi.l...@iki.fi> +// +// Heimer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// Heimer is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Heimer. If not, see <http://www.gnu.org/licenses/>. + +#ifndef CONTROL_STRATEGY_HPP +#define CONTROL_STRATEGY_HPP + +class QMouseEvent; + +class ControlStrategy +{ +public: + ControlStrategy(); + + bool backgroundDragInitiated(QMouseEvent & event) const; + + bool rubberBandInitiated(QMouseEvent & event) const; + + bool primaryButtonClicked(QMouseEvent & event) const; + + bool secondaryButtonClicked(QMouseEvent & event) const; + + void setInvertedMode(bool invertedMode); + +private: + bool isModifierPressed() const; + + bool m_invertedMode = false; +}; + +#endif // CONTROL_STRATEGY_HPP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/src/edge.cpp new/Heimer-3.6.1/src/edge.cpp --- old/Heimer-3.6.0/src/edge.cpp 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/src/edge.cpp 2022-09-21 20:29:41.000000000 +0200 @@ -70,7 +70,6 @@ if (m_enableLabel) { m_label->setZValue(static_cast<int>(Layers::EdgeLabel)); m_label->setBackgroundColor(Constants::Edge::LABEL_COLOR); - connect(m_label, &TextEdit::textChanged, this, [=](const QString & text) { updateLabel(); m_text = text; @@ -321,12 +320,18 @@ { m_selected = selected; GraphicsFactory::updateDropShadowEffect(graphicsEffect(), selected, SettingsProxy::instance().shadowEffect()); + if (m_label && m_label->parentItem() != this) { + GraphicsFactory::updateDropShadowEffect(m_label->graphicsEffect(), selected, SettingsProxy::instance().shadowEffect()); + } update(); } void Edge::setShadowEffect(const ShadowEffectParams & params) { GraphicsFactory::updateDropShadowEffect(graphicsEffect(), m_selected, params); + if (m_label && m_label->parentItem() != this) { + GraphicsFactory::updateDropShadowEffect(m_label->graphicsEffect(), m_selected, SettingsProxy::instance().shadowEffect()); + } update(); } @@ -456,6 +461,13 @@ return m_reversed; } +void Edge::restoreLabelParent() +{ + if (m_label) { + m_label->setParentItem(this); + } +} + Edge::ArrowMode Edge::arrowMode() const { return m_arrowMode; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/src/edge.hpp new/Heimer-3.6.1/src/edge.hpp --- old/Heimer-3.6.0/src/edge.hpp 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/src/edge.hpp 2022-09-21 20:29:41.000000000 +0200 @@ -70,6 +70,8 @@ bool reversed() const; + void restoreLabelParent(); + NodeR sourceNode() const; NodeR targetNode() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/src/edge_text_edit.cpp new/Heimer-3.6.1/src/edge_text_edit.cpp --- old/Heimer-3.6.0/src/edge_text_edit.cpp 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/src/edge_text_edit.cpp 2022-09-21 20:29:41.000000000 +0200 @@ -20,6 +20,7 @@ EdgeTextEdit::EdgeTextEdit(EdgeP parentItem) : TextEdit(parentItem) + , m_edge(parentItem) , m_opacityAnimation(this, "opacity") { setAcceptHoverEvents(true); @@ -37,6 +38,11 @@ }); } +EdgeP EdgeTextEdit::edge() const +{ + return m_edge; +} + void EdgeTextEdit::hoverEnterEvent(QGraphicsSceneHoverEvent * event) { m_visibilityTimer.stop(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/src/edge_text_edit.hpp new/Heimer-3.6.1/src/edge_text_edit.hpp --- old/Heimer-3.6.0/src/edge_text_edit.hpp 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/src/edge_text_edit.hpp 2022-09-21 20:29:41.000000000 +0200 @@ -31,6 +31,8 @@ public: EdgeTextEdit(EdgeP parentItem); + EdgeP edge() const; + enum class VisibilityChangeReason { Timeout, @@ -56,6 +58,8 @@ private: void setAnimationConfig(bool visible); + EdgeP m_edge; + QPropertyAnimation m_opacityAnimation; QTimer m_visibilityTimer; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/src/editor_data.cpp new/Heimer-3.6.1/src/editor_data.cpp --- old/Heimer-3.6.0/src/editor_data.cpp 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/src/editor_data.cpp 2022-09-21 20:29:41.000000000 +0200 @@ -521,6 +521,7 @@ void EditorData::removeEdgeFromScene(EdgeR edge) { + edge.restoreLabelParent(); edge.hide(); if (const auto scene = edge.scene()) { scene->removeItem(&edge); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/src/editor_view.cpp new/Heimer-3.6.1/src/editor_view.cpp --- old/Heimer-3.6.0/src/editor_view.cpp 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/src/editor_view.cpp 2022-09-21 20:29:41.000000000 +0200 @@ -27,6 +27,7 @@ #include "editor_view.hpp" #include "constants.hpp" +#include "control_strategy.hpp" #include "edge.hpp" #include "edge_context_menu.hpp" #include "edge_text_edit.hpp" @@ -52,6 +53,7 @@ : m_mediator(mediator) , m_edgeContextMenu(new EdgeContextMenu(this, m_mediator)) , m_mainContextMenu(new MainContextMenu(this, m_mediator, m_grid)) + , m_controlStrategy(std::make_unique<ControlStrategy>()) { setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -82,22 +84,19 @@ void EditorView::handleMousePressEventOnBackground(QMouseEvent & event) { - if ((event.button() == Qt::LeftButton && isModifierPressed()) || event.button() == Qt::MiddleButton) { + if (m_controlStrategy->rubberBandInitiated(event)) { initiateRubberBand(); - } else if (event.button() == Qt::LeftButton) { - m_mediator.setSelectedEdge(nullptr); - m_mediator.unselectText(); - m_mediator.mouseAction().setSourceNode(nullptr, MouseAction::Action::Scroll); - setDragMode(ScrollHandDrag); - } else if (event.button() == Qt::RightButton) { + } else if (m_controlStrategy->backgroundDragInitiated(event)) { + initiateBackgroundDrag(); + } else if (m_controlStrategy->secondaryButtonClicked(event)) { openMainContextMenu(MainContextMenu::Mode::Background); } } void EditorView::handleMousePressEventOnEdge(QMouseEvent & event, EdgeR edge) { - if (event.button() == Qt::RightButton) { - handleRightButtonClickOnEdge(edge); + if (m_controlStrategy->secondaryButtonClicked(event)) { + handleSecondaryButtonClickOnEdge(edge); } } @@ -105,10 +104,10 @@ { if (node.index() != -1) // Prevent right-click on the drag node { - if (event.button() == Qt::RightButton) { - handleRightButtonClickOnNode(node); - } else if (event.button() == Qt::LeftButton) { - handleLeftButtonClickOnNode(node); + if (m_controlStrategy->secondaryButtonClicked(event)) { + handleSecondaryButtonClickOnNode(node); + } else if (m_controlStrategy->primaryButtonClicked(event)) { + handlePrimaryButtonClickOnNode(node); } } } @@ -119,12 +118,12 @@ return; } - if (event.button() == Qt::LeftButton) { - handleLeftButtonClickOnNodeHandle(nodeHandle); + if (m_controlStrategy->primaryButtonClicked(event)) { + handlePrimaryButtonClickOnNodeHandle(nodeHandle); } } -void EditorView::handleLeftButtonClickOnNode(NodeR node) +void EditorView::handlePrimaryButtonClickOnNode(NodeR node) { if (isModifierPressed()) { // User is selecting a node @@ -140,7 +139,7 @@ } } -void EditorView::handleLeftButtonClickOnNodeHandle(NodeHandle & nodeHandle) +void EditorView::handlePrimaryButtonClickOnNodeHandle(NodeHandle & nodeHandle) { if (!nodeHandle.parentNode().selected()) { m_mediator.clearSelectionGroup(); @@ -164,14 +163,14 @@ } } -void EditorView::handleRightButtonClickOnEdge(EdgeR edge) +void EditorView::handleSecondaryButtonClickOnEdge(EdgeR edge) { m_mediator.setSelectedEdge(&edge); openEdgeContextMenu(); } -void EditorView::handleRightButtonClickOnNode(NodeR node) +void EditorView::handleSecondaryButtonClickOnNode(NodeR node) { if (!node.selected()) { m_mediator.clearSelectionGroup(); @@ -182,6 +181,17 @@ openMainContextMenu(MainContextMenu::Mode::Node); } +void EditorView::initiateBackgroundDrag() +{ + juzzlin::L().debug() << "Initiating background drag.."; + + m_mediator.setSelectedEdge(nullptr); + m_mediator.unselectText(); + m_mediator.mouseAction().setSourceNode(nullptr, MouseAction::Action::Scroll); + + setDragMode(ScrollHandDrag); +} + void EditorView::initiateRubberBand() { juzzlin::L().debug() << "Initiating rubber band.."; @@ -297,8 +307,8 @@ } // This hack enables edge context menu even if user clicks on the edge text edit. } else if (result.edgeTextEdit) { - if (event->button() == Qt::RightButton) { - if (const auto edge = dynamic_cast<EdgeP>(result.edgeTextEdit->parentItem()); edge) { + if (m_controlStrategy->secondaryButtonClicked(*event)) { + if (const auto edge = result.edgeTextEdit->edge(); edge) { juzzlin::L().debug() << "Edge text edit pressed"; handleMousePressEventOnEdge(*event, *edge); return; @@ -306,7 +316,7 @@ } // This hack enables node context menu even if user clicks on the node text edit. } else if (result.nodeTextEdit) { - if (event->button() == Qt::RightButton || (event->button() == Qt::LeftButton && isModifierPressed())) { + if (m_controlStrategy->secondaryButtonClicked(*event) || (m_controlStrategy->primaryButtonClicked(*event) && isModifierPressed())) { if (const auto node = dynamic_cast<NodeP>(result.nodeTextEdit->parentItem()); node) { juzzlin::L().debug() << "Node text edit pressed"; handleMousePressEventOnNode(*event, *node); @@ -333,7 +343,7 @@ default: break; } - } else if (event->button() == Qt::LeftButton) { + } else if (m_controlStrategy->primaryButtonClicked(*event)) { switch (m_mediator.mouseAction().action()) { case MouseAction::Action::None: // This can happen if the user deletes the drag node while connecting nodes or creating a new node. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Heimer-3.6.0/src/editor_view.hpp new/Heimer-3.6.1/src/editor_view.hpp --- old/Heimer-3.6.0/src/editor_view.hpp 2022-08-27 18:04:10.000000000 +0200 +++ new/Heimer-3.6.1/src/editor_view.hpp 2022-09-21 20:29:41.000000000 +0200 @@ -26,9 +26,11 @@ #include <QGraphicsView> #include <QMenu> +#include <memory> #include <optional> #include <set> +class ControlStrategy; class Edge; class EdgeContextMenu; class Node; @@ -113,13 +115,15 @@ void handleMousePressEventOnNodeHandle(QMouseEvent & event, NodeHandle & nodeHandle); - void handleLeftButtonClickOnNode(NodeR node); + void handlePrimaryButtonClickOnNode(NodeR node); - void handleLeftButtonClickOnNodeHandle(NodeHandle & nodeHandle); + void handlePrimaryButtonClickOnNodeHandle(NodeHandle & nodeHandle); - void handleRightButtonClickOnEdge(EdgeR edge); + void handleSecondaryButtonClickOnEdge(EdgeR edge); - void handleRightButtonClickOnNode(NodeR node); + void handleSecondaryButtonClickOnNode(NodeR node); + + void initiateBackgroundDrag(); void initiateRubberBand(); @@ -201,6 +205,8 @@ }; std::optional<ZoomParameters> m_savedZoom; + + std::unique_ptr<ControlStrategy> m_controlStrategy; }; #endif // EDITOR_VIEW_HPP