Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
835786e1
Commit
835786e1
authored
4 years ago
by
Srikanth Ravipati
Committed by
Peterson, Peter
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Set maximum height for the memory widget
and removed the height-fractions and width-fractions
parent
9d8196e9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
qt/applications/workbench/workbench/app/mainwindow.py
+2
-24
2 additions, 24 deletions
qt/applications/workbench/workbench/app/mainwindow.py
with
2 additions
and
24 deletions
qt/applications/workbench/workbench/app/mainwindow.py
+
2
−
24
View file @
835786e1
...
...
@@ -177,6 +177,7 @@ class MainWindow(QMainWindow):
from
workbench.plugins.memorywidget
import
MemoryWidget
self
.
memorywidget
=
MemoryWidget
(
self
)
self
.
memorywidget
.
register_plugin
()
self
.
memorywidget
.
setMaximumHeight
(
70
)
self
.
widgets
.
append
(
self
.
memorywidget
)
# set the link between the algorithm and workspace widget
...
...
@@ -478,11 +479,9 @@ class MainWindow(QMainWindow):
plot_selector
=
self
.
plot_selector
# If more than two rows are needed in a column,
# arrange_layout function needs to be revisited for
# the hegiht_fractions to be applied correctly.
# arrange_layout function needs to be revisited.
# In the first column, there are three widgets in two rows
# as the algorithm_selector and plot_selector are tabified.
# Currently, the arrange_layout function does not use width-fraction.
default_layout
=
{
'
widgets
'
:
[
# column 0
...
...
@@ -492,16 +491,6 @@ class MainWindow(QMainWindow):
# column 2
[[
memorywidget
],
[
logmessages
]]
],
# 'width-fraction': [
# 0.25, # column 0 width
# 0.50, # column 1 width
# 0.25
# ], # column 2 width
'
height-fraction
'
:
[
[
0.5
,
0.5
],
# column 0 row heights
[
1.0
],
# column 1 row heights
[
0.05
,
0.95
]
]
# column 2 row heights
}
size
=
self
.
size
()
# Preserve size on reset
...
...
@@ -512,7 +501,6 @@ class MainWindow(QMainWindow):
"""
Arrange the layout of the child widgets according to the supplied layout
"""
self
.
prep_window_for_reset
()
widgets_layout
=
layout
[
'
widgets
'
]
widgets_height_fractions
=
layout
[
'
height-fraction
'
]
with
widget_updates_disabled
(
self
):
# flatten list
widgets
=
[
item
for
column
in
widgets_layout
for
row
in
column
for
item
in
row
]
...
...
@@ -524,21 +512,11 @@ class MainWindow(QMainWindow):
first
,
second
=
widgets
[
i
],
widgets
[
i
+
1
]
self
.
splitDockWidget
(
first
.
dockwidget
,
second
.
dockwidget
,
Qt
.
Horizontal
)
# now arrange the rows
idx_column
=
-
1
for
column
in
widgets_layout
:
idx_column
+=
1
height_fractions
=
widgets_height_fractions
[
idx_column
]
for
i
in
range
(
len
(
column
)
-
1
):
first_row
,
second_row
=
column
[
i
],
column
[
i
+
1
]
height_fraction_first_row
,
height_fraction_second_row
=
height_fractions
[
i
],
\
height_fractions
[
i
+
1
]
self
.
splitDockWidget
(
first_row
[
0
].
dockwidget
,
second_row
[
0
].
dockwidget
,
Qt
.
Vertical
)
height
=
first_row
[
0
].
dockwidget
.
rect
().
height
()
self
.
resizeDocks
((
first_row
[
0
].
dockwidget
,
second_row
[
0
].
dockwidget
),
\
(
height_fraction_first_row
*
height
,
height_fraction_second_row
*
height
),
\
Qt
.
Vertical
)
# and finally tabify those in the same position
for
column
in
widgets_layout
:
...
...
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