1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-18 17:40:48 +02:00

Hotkeys and multiselection

This commit is contained in:
nordsoft 2022-09-08 18:14:13 +04:00
parent aa1cf5e16c
commit ece811b508
2 changed files with 33 additions and 2 deletions

View File

@ -286,6 +286,9 @@
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
@ -763,21 +766,33 @@
<property name="text">
<string>Open</string>
</property>
<property name="shortcut">
<string>Ctrl+O</string>
</property>
</action>
<action name="actionSave">
<property name="text">
<string>Save</string>
</property>
<property name="shortcut">
<string>Ctrl+S</string>
</property>
</action>
<action name="actionNew">
<property name="text">
<string>New</string>
</property>
<property name="shortcut">
<string>Ctrl+N</string>
</property>
</action>
<action name="actionSave_as">
<property name="text">
<string>Save as</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+S</string>
</property>
</action>
<action name="actionLevel">
<property name="text">
@ -796,16 +811,25 @@
<property name="text">
<string>Cut</string>
</property>
<property name="shortcut">
<string>Ctrl+X</string>
</property>
</action>
<action name="actionCopy">
<property name="text">
<string>Copy</string>
</property>
<property name="shortcut">
<string>Ctrl+C</string>
</property>
</action>
<action name="actionPaste">
<property name="text">
<string>Paste</string>
</property>
<property name="shortcut">
<string>Ctrl+V</string>
</property>
</action>
<action name="actionFill">
<property name="text">

View File

@ -265,10 +265,17 @@ void MapView::mousePressEvent(QMouseEvent *event)
{
if(sc->selectionObjectsView.isSelected(obj))
{
if(qApp->keyboardModifiers() & Qt::ControlModifier)
{
sc->selectionObjectsView.deselectObject(obj);
sc->selectionObjectsView.selectionMode = 1;
}
else
sc->selectionObjectsView.selectionMode = 2;
}
else
{
if(!(qApp->keyboardModifiers() & Qt::ControlModifier))
sc->selectionObjectsView.clear();
sc->selectionObjectsView.selectionMode = 2;
sc->selectionObjectsView.selectObject(obj);