Files
qelectrotech-source-mirror/sources/gesturesettings.h
T
ispyisail 46e041fe01 Mouse gestures: own command list, 4 or 8 directions
The right-drag ring showed the shortcut bar's commands for the selection.
A new Preferences page, "Gestes de la souris", lets the user pick the
ring's commands per selection context, one per direction, and choose 4 or
8 directions. Commands are dropped from the list onto a slot of a ring
editor, or placed with a button; Delete empties a slot.

A context the user never edits keeps following the shortcut bar, and 8
directions stays the default, so nothing changes for anyone who does not
open the page. A picked list is positional: a direction left empty, or
holding a command this build lacks, stays empty instead of shifting the
others. Stored like ShortcutBarSettings: diagrameditor/gestures/<context>
id lists in QSettings, defaults not stored.

tst_gesturesettings covers the defaults, positional lists, the 4/8
setting, the overlay's sectors and empty slots, and the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 18:38:25 +13:00

48 lines
1.7 KiB
C++

/*
Copyright 2006-2026 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech 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 2 of the License, or
(at your option) any later version.
QElectroTech 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 QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GESTURESETTINGS_H
#define GESTURESETTINGS_H
#include "shortcutbarsettings.h"
#include <QStringList>
/**
@brief The commands on the mouse gesture ring (right-drag on a folio).
Until the user picks them, the ring shows the shortcut bar's commands
for the selection, as it always has. A picked list is stored in
QSettings, one key per context, and is positional: entry i is the
command in direction i, clockwise from the top, and an empty entry is
an empty direction. Pinned elements are never on the ring.
*/
class GestureSettings
{
public:
static int directions();
static void setDirections(int directions);
static bool isCustom(ShortcutBarSettings::Context context);
static QStringList ids(ShortcutBarSettings::Context context);
static QStringList defaultIds(ShortcutBarSettings::Context context);
static void setIds(ShortcutBarSettings::Context context, QStringList ids);
static void reset(ShortcutBarSettings::Context context);
};
#endif // GESTURESETTINGS_H