Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
f193150a
Commit
f193150a
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
flag -> bool
parent
a4af1ee1
No related branches found
No related tags found
1 merge request
!2230
rm hidden "previous mode" feature, and further simplify the MaskGraphicsScene code
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GUI/View/Canvas/MaskEditorActions.cpp
+12
-13
12 additions, 13 deletions
GUI/View/Canvas/MaskEditorActions.cpp
GUI/View/Canvas/MaskEditorActions.h
+1
-1
1 addition, 1 deletion
GUI/View/Canvas/MaskEditorActions.h
GUI/View/Scene/MaskFlags.h
+0
-4
0 additions, 4 deletions
GUI/View/Scene/MaskFlags.h
with
13 additions
and
18 deletions
GUI/View/Canvas/MaskEditorActions.cpp
+
12
−
13
View file @
f193150a
...
...
@@ -114,21 +114,29 @@ void MaskEditorActions::onToggleMaskValueAction()
void
MaskEditorActions
::
onBringToFrontAction
()
{
changeMaskStackingOrder
(
MaskFlags
::
BRING_TO_FRONT
);
changeMaskStackingOrder
(
true
);
}
void
MaskEditorActions
::
onSendToBackAction
()
{
changeMaskStackingOrder
(
MaskFlags
::
SEND_TO_BACK
);
changeMaskStackingOrder
(
false
);
}
//! Lower mask one level down or rise one level up in the masks stack
void
MaskEditorActions
::
changeMaskStackingOrder
(
MaskFlags
::
Stacking
value
)
void
MaskEditorActions
::
changeMaskStackingOrder
(
bool
move_up
)
{
if
(
!
m_maskContainerModel
||
!
m_selectionModel
)
return
;
if
(
value
==
MaskFlags
::
SEND_TO_BACK
)
{
if
(
move_up
)
{
QModelIndexList
indexes
=
m_selectionModel
->
selectedIndexes
();
for
(
const
QModelIndex
&
itemIndex
:
indexes
)
{
int
row
=
itemIndex
.
row
();
int
new_row
=
row
-
1
;
if
(
new_row
>=
0
&&
new_row
<
m_maskContainerModel
->
rowCount
({}))
m_maskContainerModel
->
moveMask
(
row
,
new_row
);
}
}
else
{
QModelIndexList
indexes
=
m_selectionModel
->
selectedIndexes
();
for
(
const
QModelIndex
&
itemIndex
:
indexes
)
{
int
row
=
itemIndex
.
row
();
...
...
@@ -140,15 +148,6 @@ void MaskEditorActions::changeMaskStackingOrder(MaskFlags::Stacking value)
}
}
}
if
(
value
==
MaskFlags
::
BRING_TO_FRONT
)
{
QModelIndexList
indexes
=
m_selectionModel
->
selectedIndexes
();
for
(
const
QModelIndex
&
itemIndex
:
indexes
)
{
int
row
=
itemIndex
.
row
();
int
new_row
=
row
-
1
;
if
(
new_row
>=
0
&&
new_row
<
m_maskContainerModel
->
rowCount
({}))
m_maskContainerModel
->
moveMask
(
row
,
new_row
);
}
}
gProjectDocument
.
value
()
->
setModified
();
}
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Canvas/MaskEditorActions.h
+
1
−
1
View file @
f193150a
...
...
@@ -57,7 +57,7 @@ private slots:
private
:
void
initItemContextMenu
(
QMenu
&
menu
);
void
changeMaskStackingOrder
(
MaskFlags
::
Stacking
value
);
void
changeMaskStackingOrder
(
bool
move_up
);
bool
isBringToFrontPossible
()
const
;
bool
isSendToBackPossible
()
const
;
void
setAllActionsEnabled
(
bool
value
);
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Scene/MaskFlags.h
+
0
−
4
View file @
f193150a
...
...
@@ -34,15 +34,11 @@ enum EActivityType {
};
Q_DECLARE_FLAGS
(
Activity
,
EActivityType
)
enum
EMoveType
{
BRING_TO_FRONT
,
SEND_TO_BACK
};
Q_DECLARE_FLAGS
(
Stacking
,
EMoveType
)
enum
EMaskValue
{
MASK_OFF
,
MASK_ON
};
Q_DECLARE_FLAGS
(
MaskValue
,
EMaskValue
)
};
// namespace MaskFlags
Q_DECLARE_OPERATORS_FOR_FLAGS
(
MaskFlags
::
Activity
)
Q_DECLARE_OPERATORS_FOR_FLAGS
(
MaskFlags
::
Stacking
)
Q_DECLARE_OPERATORS_FOR_FLAGS
(
MaskFlags
::
MaskValue
)
#endif // BORNAGAIN_GUI_VIEW_SCENE_MASKFLAGS_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment