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
2a4f426f
Commit
2a4f426f
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
rename member
parent
cc67530e
No related branches found
No related tags found
1 merge request
!2070
some View classes renamed -> Display or Listing
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/View/SampleDesigner/SampleView.cpp
+16
-18
16 additions, 18 deletions
GUI/View/SampleDesigner/SampleView.cpp
GUI/View/SampleDesigner/SampleView.h
+1
-1
1 addition, 1 deletion
GUI/View/SampleDesigner/SampleView.h
with
17 additions
and
19 deletions
GUI/View/SampleDesigner/SampleView.cpp
+
16
−
18
View file @
2a4f426f
...
...
@@ -54,21 +54,20 @@ SampleView::SampleView(QWidget* parent, ProjectDocument* document)
sampleSelectionLayout
->
setSpacing
(
0
);
auto
*
sampleSelectionToolbar
=
new
StyledToolbar
(
sampleSelectionPane
);
m_
sampleSelectionView
=
new
SampleListing
(
this
,
m_document
);
sampleSelectionToolbar
->
addAction
(
m_
sampleSelectionView
->
newSampleAction
());
m_
listing
=
new
SampleListing
(
this
,
m_document
);
sampleSelectionToolbar
->
addAction
(
m_
listing
->
newSampleAction
());
#ifdef BORNAGAIN_PYTHON
sampleSelectionToolbar
->
addAction
(
m_
sampleSelectionView
->
importSampleAction
());
sampleSelectionToolbar
->
addAction
(
m_
listing
->
importSampleAction
());
#endif
sampleSelectionToolbar
->
addAction
(
m_
sampleSelectionView
->
chooseFromLibraryAction
());
if
(
auto
*
btn
=
dynamic_cast
<
QToolButton
*>
(
sampleSelectionToolbar
->
widgetForAction
(
m_
sampleSelection
View
->
chooseFromLibraryAction
())))
sampleSelectionToolbar
->
addAction
(
m_
listing
->
chooseFromLibraryAction
());
if
(
auto
*
btn
=
dynamic_cast
<
QToolButton
*>
(
sampleSelection
Toolbar
->
widgetForAction
(
m_listing
->
chooseFromLibraryAction
())))
btn
->
setPopupMode
(
QToolButton
::
InstantPopup
);
sampleSelectionToolbar
->
setToolButtonStyle
(
Qt
::
ToolButtonTextBesideIcon
);
sampleSelectionLayout
->
addWidget
(
sampleSelectionToolbar
);
sampleSelectionLayout
->
addWidget
(
m_sampleSelectionView
);
m_sampleSelectionView
->
setSizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
MinimumExpanding
);
sampleSelectionLayout
->
addWidget
(
m_listing
);
m_listing
->
setSizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
MinimumExpanding
);
auto
*
scriptPanel
=
new
ScriptPanel
(
this
);
m_realspacePanel
=
new
RealspacePanel
(
this
);
...
...
@@ -79,26 +78,25 @@ SampleView::SampleView(QWidget* parent, ProjectDocument* document)
m_docks
->
addWidget
(
REALSPACEPANEL
,
m_realspacePanel
,
Qt
::
BottomDockWidgetArea
);
m_docks
->
addWidget
(
PYTHONPANEL
,
scriptPanel
,
Qt
::
BottomDockWidgetArea
);
connect
(
m_
sampleSelectionView
,
&
SampleListing
::
currentSampleChanged
,
editor
,
connect
(
m_
listing
,
&
SampleListing
::
currentSampleChanged
,
editor
,
&
SampleEditor
::
setCurrentSample
);
connect
(
m_
sampleSelectionView
,
&
SampleListing
::
currentSampleChanged
,
connect
(
m_
listing
,
&
SampleListing
::
currentSampleChanged
,
[
&
](
SampleItem
*
m
)
{
onRequestViewInRealspace
(
m
);
});
connect
(
m_
sampleSelectionView
,
&
SampleListing
::
currentSampleChanged
,
scriptPanel
,
connect
(
m_
listing
,
&
SampleListing
::
currentSampleChanged
,
scriptPanel
,
&
ScriptPanel
::
setCurrentSample
);
connect
(
editor
,
&
SampleEditor
::
modified
,
scriptPanel
,
&
ScriptPanel
::
onSampleModified
);
connect
(
editor
,
&
SampleEditor
::
modified
,
m_sampleSelectionView
,
&
SampleListing
::
onSampleModified
);
connect
(
editor
,
&
SampleEditor
::
modified
,
m_listing
,
&
SampleListing
::
onSampleModified
);
connect
(
editor
,
&
SampleEditor
::
requestViewInRealspace
,
this
,
&
SampleView
::
onRequestViewInRealspace
);
connect
(
editor
,
&
SampleEditor
::
aboutToRemoveItem
,
this
,
&
SampleView
::
onAboutToRemoveItem
);
connect
(
editor
,
&
SampleEditor
::
requestCreateNewSample
,
m_
sampleSelectionView
->
newSampleAction
(),
connect
(
editor
,
&
SampleEditor
::
requestCreateNewSample
,
m_
listing
->
newSampleAction
(),
&
QAction
::
trigger
,
Qt
::
QueuedConnection
);
connect
(
editor
,
&
SampleEditor
::
modified
,
m_realspacePanel
->
widget
(),
...
...
@@ -124,7 +122,7 @@ void SampleView::onRequestViewInRealspace(Item3D* item)
}
m_docks
->
setDockVisible
(
REALSPACEPANEL
);
m_realspacePanel
->
widget
()
->
setDisplayedItem
(
m_
sampleSelectionView
->
currentSampleItem
(),
item
);
m_realspacePanel
->
widget
()
->
setDisplayedItem
(
m_
listing
->
currentSampleItem
(),
item
);
}
void
SampleView
::
onAboutToRemoveItem
(
Item3D
*
item
)
...
...
@@ -183,8 +181,8 @@ void SampleView::fillViewMenu(QMenu* menu)
void
SampleView
::
showEvent
(
QShowEvent
*
)
{
if
(
!
m_
sampleSelectionView
->
currentSampleItem
())
m_
sampleSelectionView
->
restoreSelection
();
if
(
!
m_
listing
->
currentSampleItem
())
m_
listing
->
restoreSelection
();
}
void
SampleView
::
resetLayout
()
...
...
This diff is collapsed.
Click to expand it.
GUI/View/SampleDesigner/SampleView.h
+
1
−
1
View file @
2a4f426f
...
...
@@ -51,7 +51,7 @@ private:
DocksController
*
m_docks
=
nullptr
;
ProjectDocument
*
m_document
=
nullptr
;
RealspacePanel
*
m_realspacePanel
=
nullptr
;
SampleListing
*
m_
sampleSelectionView
=
nullptr
;
SampleListing
*
m_
listing
=
nullptr
;
};
#endif // BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_SAMPLEVIEW_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