Skip to content

Add shortcuts for increasing and decreasing the time scale

KStars currently has default shortcuts set for stepping forward and back in time, which is convenient. But it lacks shortcuts for increasing or decreasing the time scale; you need to use a mouse or touchpad for this.

This commit adds shortcuts for those actions: Shift+Minus and Shift+Plus. This lets you keep one finger on the shift button and press those keys to increase or decrease the time scale, and then once you've got that adjusted, you simply keep a finger on the shift button and move your other finger over the the pointy bracket keys to step forwards and backwards.

To accomplish this, a little bit of refactoring needed to be done: the stepper buttons are ported to use QActions internally, and the increase and decrease actions are made publicly accessible so that they can be added to the global action collection with default shortcuts in kstarsinit.cpp. This avoids code duplication, allows the buttons' tooltips to display their keyboard shortcuts, and also lets them disable themselves when the time scale is at its maximum or minimum amounts.

New actions+shortcuts visible in the shortcuts config window:

In_shortcuts_window

Time step control in the toolbar showing tooltip with shortcut, and decrease button disabled because the time scale is already at its minimum amount:

Screenshot_20210626_093826

Merge request reports