Gui: Add guidelines for input hints
This commit is contained in:
committed by
Benjamin Nauck
parent
e70fde5773
commit
cbf32cd77b
@@ -33,6 +33,36 @@
|
||||
|
||||
namespace Gui
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief Representation of one input hint.
|
||||
*
|
||||
* Each input is essentially a short message defining action with reference to inputs that will
|
||||
* trigger that action.
|
||||
*
|
||||
* For example,
|
||||
* @code{c++}
|
||||
* using enum InputHint::UserInput;
|
||||
*
|
||||
* // simple example of hint
|
||||
* InputHint selectPointHint {
|
||||
* .message = QWidget::tr("%1 select point"),
|
||||
* .sequences = { MouseLeft }
|
||||
* }
|
||||
*
|
||||
* // multiple sequences are also allowed in one hint
|
||||
* InputHint lockAxisHint {
|
||||
* .message = QWidget::tr("%1, %2 or %3 lock X, Y or Z axis"),
|
||||
* .sequences = { KeyX, KeyY, KeyZ }
|
||||
* }
|
||||
*
|
||||
* // hints can also use sequences consisting of multiple keys
|
||||
* InputHint exitProgramHint {
|
||||
* .message = QWidget::tr("%1 exit program"),
|
||||
* .sequences = { {KeyAlt, KeyF4} }
|
||||
* }
|
||||
* @endcode
|
||||
*/
|
||||
struct InputHint
|
||||
{
|
||||
enum class UserInput
|
||||
@@ -225,7 +255,20 @@ struct InputHint
|
||||
{}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Message associated with the hint.
|
||||
*
|
||||
* The message should confirm to rules stated in the documentation of the InputHint class.
|
||||
* Message can contain placeholders like %1, %2 etc. that will then be replaced with graphical
|
||||
* key representation from sequences field.
|
||||
*
|
||||
* @see https://freecad.github.io/DevelopersHandbook/designguide/input-hints.html
|
||||
*/
|
||||
QString message;
|
||||
|
||||
/**
|
||||
* @brief List of sequences to be substituted.
|
||||
*/
|
||||
std::list<InputSequence> sequences;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user