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
d2b6e572
Commit
d2b6e572
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
inline fcts
parent
c6a2a32c
No related branches found
No related tags found
1 merge request
!2294
mv functionality to model; mask toolbar separator now using setStyleSheet
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/View/Setup/MaskEditorActions.cpp
+7
-26
7 additions, 26 deletions
GUI/View/Setup/MaskEditorActions.cpp
GUI/View/Setup/MaskEditorActions.h
+0
-2
0 additions, 2 deletions
GUI/View/Setup/MaskEditorActions.h
with
7 additions
and
28 deletions
GUI/View/Setup/MaskEditorActions.cpp
+
7
−
26
View file @
d2b6e572
...
...
@@ -83,11 +83,14 @@ void MaskEditorActions::onItemContextMenuRequest(const QPoint& point)
ASSERT
(
m_mask_list_model
);
ASSERT
(
m_selection_model
);
if
(
m_selection_model
->
selectedIndexes
().
isEmpty
())
QModelIndexList
indexes
=
m_selection_model
->
selectedIndexes
();
if
(
indexes
.
isEmpty
())
setAllActionsEnabled
(
false
);
m_send_to_back_action
->
setEnabled
(
canBringToBack
());
m_bring_to_front_action
->
setEnabled
(
canBringToFront
());
const
bool
canBringToBack
=
(
indexes
.
front
().
row
()
!=
0
);
m_send_to_back_action
->
setEnabled
(
canBringToBack
);
const
bool
canBringToFront
=
(
indexes
.
front
().
row
()
!=
m_mask_list_model
->
maskContItem
()
->
size
()
-
1
);
m_bring_to_front_action
->
setEnabled
(
canBringToFront
);
QMenu
menu
;
menu
.
addAction
(
m_toggle_mask_value_action
);
...
...
@@ -152,28 +155,6 @@ void MaskEditorActions::changeMaskStackingOrder(bool move_up)
gDoc
->
setModified
();
}
//! Returns true if at least one of MaskItems in the selection can be moved one level up
//! (Naturally, it is always true, if selection contains more than one item. If selection contains
//! only one item, the result will depend on position of item on the stack.
//! Top item cannot be moved up. Used to disable corresponding context menu line.)
bool
MaskEditorActions
::
canBringToFront
()
const
{
QModelIndexList
indexes
=
m_selection_model
->
selectedIndexes
();
if
(
indexes
.
size
()
==
1
&&
indexes
.
front
().
row
()
!=
0
)
return
true
;
return
false
;
}
//! Returns true if at least one of MaskItems in the selection can be moved one level down.
bool
MaskEditorActions
::
canBringToBack
()
const
{
QModelIndexList
indexes
=
m_selection_model
->
selectedIndexes
();
if
(
indexes
.
size
()
==
1
&&
indexes
.
front
().
row
()
!=
m_mask_list_model
->
maskContItem
()
->
size
()
-
1
)
return
true
;
return
false
;
}
void
MaskEditorActions
::
setAllActionsEnabled
(
bool
value
)
{
m_send_to_back_action
->
setEnabled
(
value
);
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Setup/MaskEditorActions.h
+
0
−
2
View file @
d2b6e572
...
...
@@ -53,8 +53,6 @@ private slots:
private
:
void
changeMaskStackingOrder
(
bool
move_up
);
bool
canBringToFront
()
const
;
bool
canBringToBack
()
const
;
void
setAllActionsEnabled
(
bool
value
);
QAction
*
m_toggle_mask_value_action
;
...
...
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