Files
Sourcetrail/testing/keyboard_controls/data/history_tests.cpp
T
Eberhard GrätherandGitHub b0616778f3 ui: Keyboard controls (#935)
* switch focus between views with Tab
* move focus within views with WASD/HJKL/Arrows
* move focus between graph edges by holding Shift
* move focus between code references by holding Shift
* removed graph panning with WASD and moved zooming to Alt + W/S
* removed graph navigation by pressing starting character in graph view lists
* changed local reference and custom trail shortcuts
* updated Keyboard Shortcuts window
* use common back and forward shortcuts and YZ & Shift + YZ
* fix macOS issue where widgets don't get proper focus after creating a new tab
* don't use shared_ptr in QtMainView

fixes #486, #327, #214, #210
2020-03-02 14:48:03 +01:00

60 lines
1.4 KiB
C++

#define HISTORY_TESTS
// TEST: Graph focus restored on back
// START ----------------------------------------------------------------------
class HistoryTest // <- ACTION: activate
{
public:
int member;
int member2;
};
int func()
{
HistoryTest h;
h.member = 0;
}
// ACTION: Focus and activate 'func' in graph
// ACTION: Navigate 'back' in history
// RESULT: The graph for 'HistoryTest' is restored with focus at 'func'
// END ------------------------------------------------------------------------
// TEST: Graph aggregation focus restored on back
// START ----------------------------------------------------------------------
class HistoryTestUser
{
public:
int process()
{
h.member = 2;
h.member2 = 4;
}
HistoryTest h;
};
// ACTION: Focus and activate aggregation 'HistoryTestUser -> HistoryTest'
// ACTION: Navigate 'back' in history
// RESULT: The graph for 'HistoryTest' is restored with focus at aggregation edge
// END ------------------------------------------------------------------------
// TEST: Code focus restored on back
// START ----------------------------------------------------------------------
HistoryTest createTest(); // <- ACTION: focus and activate 'createTest' from code
// ACTION: Navigate 'back' in history
// RESULT: The code view is restored with focus at 'createTest'
// END ------------------------------------------------------------------------