mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-22 06:14:14 +02:00
Report jump: show the target's whole folio, shade its texts too
Feedback on a real plan: zooming in on the end jumped to was too much. A jump now shows the target's folio whole, as a page (the view's fit), selects the target and shades it and its texts blue for three seconds, so that the eye finds the label too. One function, Element::jumpTo(), serves the double click on the arrow and on the text. The mouse pointer is not moved onto the target: Wayland does not let a program move the pointer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
// A linked folio report shows a pointing hand under the mouse, on its
|
||||
// arrow and on the text that shows its label, and a double click on
|
||||
// either goes to the other end. The end jumped to is highlighted for a
|
||||
// moment, independently of the hover highlight, which the mouse leaving
|
||||
// moment, its texts too, independently of the hover highlight, which the mouse leaving
|
||||
// the end jumped from would clear at once. An unlinked report shows no
|
||||
// hand and has nowhere to jump to.
|
||||
#include <QApplication>
|
||||
@@ -112,10 +112,22 @@ int main(int argc, char **argv)
|
||||
doubleClick(one, going);
|
||||
check(coming->isSelected(), "the end jumped to is selected");
|
||||
check(coming->isShownAsJumpTarget(), "the end jumped to is highlighted");
|
||||
{
|
||||
bool texts_shaded = !coming->dynamicTextItems().isEmpty();
|
||||
for (DynamicElementTextItem *text : coming->dynamicTextItems())
|
||||
texts_shaded &= text->isJumpHighlighted();
|
||||
check(texts_shaded, "and its texts are shaded too");
|
||||
}
|
||||
hover(one, going, QEvent::GraphicsSceneHoverLeave);
|
||||
check(coming->isShownAsJumpTarget(), "leaving the report keeps the jump highlight");
|
||||
wait(2300);
|
||||
wait(3300);
|
||||
check(!coming->isShownAsJumpTarget(), "the jump highlight goes after a moment");
|
||||
{
|
||||
bool texts_plain = true;
|
||||
for (DynamicElementTextItem *text : coming->dynamicTextItems())
|
||||
texts_plain &= !text->isJumpHighlighted();
|
||||
check(texts_plain, "and so does the shading of its texts");
|
||||
}
|
||||
|
||||
// The text showing the label: a pointing hand, and a double click
|
||||
// jumps back.
|
||||
|
||||
Reference in New Issue
Block a user