Skip to content

Commit a09ea90

Browse files
committed
enh: fix block matrix element sizes
1 parent 55f9d29 commit a09ea90

5 files changed

Lines changed: 69 additions & 139 deletions

File tree

dcscope/gui/matrix/dm_dataset.ui

Lines changed: 33 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
<property name="spacing">
3333
<number>0</number>
3434
</property>
35+
<property name="sizeConstraint">
36+
<enum>QLayout::SizeConstraint::SetDefaultConstraint</enum>
37+
</property>
3538
<property name="leftMargin">
3639
<number>0</number>
3740
</property>
@@ -150,6 +153,36 @@
150153
</item>
151154
</layout>
152155
</item>
156+
<item>
157+
<widget class="QToolButton" name="toolButton_modify">
158+
<property name="sizePolicy">
159+
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
160+
<horstretch>0</horstretch>
161+
<verstretch>0</verstretch>
162+
</sizepolicy>
163+
</property>
164+
<property name="font">
165+
<font>
166+
<pointsize>9</pointsize>
167+
</font>
168+
</property>
169+
<property name="toolTip">
170+
<string>Modify this dataset in Analysis View</string>
171+
</property>
172+
<property name="text">
173+
<string>edit</string>
174+
</property>
175+
<property name="icon">
176+
<iconset theme="tools-wizard"/>
177+
</property>
178+
<property name="toolButtonStyle">
179+
<enum>Qt::ToolButtonStyle::ToolButtonTextBesideIcon</enum>
180+
</property>
181+
<property name="autoRaise">
182+
<bool>true</bool>
183+
</property>
184+
</widget>
185+
</item>
153186
<item>
154187
<widget class="Line" name="line">
155188
<property name="styleSheet">
@@ -166,52 +199,6 @@
166199
</property>
167200
</widget>
168201
</item>
169-
<item>
170-
<layout class="QHBoxLayout" name="horizontalLayout_2">
171-
<property name="leftMargin">
172-
<number>0</number>
173-
</property>
174-
<property name="topMargin">
175-
<number>0</number>
176-
</property>
177-
<property name="rightMargin">
178-
<number>0</number>
179-
</property>
180-
<property name="bottomMargin">
181-
<number>0</number>
182-
</property>
183-
<item alignment="Qt::AlignmentFlag::AlignLeft">
184-
<widget class="QToolButton" name="toolButton_modify">
185-
<property name="sizePolicy">
186-
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
187-
<horstretch>0</horstretch>
188-
<verstretch>0</verstretch>
189-
</sizepolicy>
190-
</property>
191-
<property name="font">
192-
<font>
193-
<pointsize>9</pointsize>
194-
</font>
195-
</property>
196-
<property name="toolTip">
197-
<string>Modify this dataset in Analysis View</string>
198-
</property>
199-
<property name="text">
200-
<string>edit</string>
201-
</property>
202-
<property name="icon">
203-
<iconset theme="tools-wizard"/>
204-
</property>
205-
<property name="toolButtonStyle">
206-
<enum>Qt::ToolButtonStyle::ToolButtonTextBesideIcon</enum>
207-
</property>
208-
<property name="autoRaise">
209-
<bool>true</bool>
210-
</property>
211-
</widget>
212-
</item>
213-
</layout>
214-
</item>
215202
<item>
216203
<layout class="QHBoxLayout" name="horizontalLayout">
217204
<property name="spacing">

dcscope/gui/matrix/dm_filter.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ def __init__(self, pipeline, filt_index, *args, **kwargs):
3030
menu.addAction('duplicate', self.action_duplicate)
3131
menu.addAction('remove', self.action_remove)
3232
self.toolButton_opt.setMenu(menu)
33-
tbw = self.toolButton_toggle.sizeHint().width()
34-
self.toolButton_opt.setMaximumWidth(tbw)
33+
34+
self.setFixedWidth(int(65))
35+
self.setMinimumWidth(int(65))
36+
self.setMaximumWidth(int(65))
37+
self.adjustSize()
3538

3639
# toggle all active, all inactive, semi state
3740
self.toolButton_toggle.clicked.connect(self.on_active_toggled)

dcscope/gui/matrix/dm_filter.ui

Lines changed: 12 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<x>0</x>
1111
<y>0</y>
1212
<width>94</width>
13-
<height>110</height>
13+
<height>111</height>
1414
</rect>
1515
</property>
1616
<property name="sizePolicy">
@@ -19,17 +19,6 @@
1919
<verstretch>0</verstretch>
2020
</sizepolicy>
2121
</property>
22-
<property name="maximumSize">
23-
<size>
24-
<width>120</width>
25-
<height>120</height>
26-
</size>
27-
</property>
28-
<property name="font">
29-
<font>
30-
<pointsize>9</pointsize>
31-
</font>
32-
</property>
3322
<property name="windowTitle">
3423
<string>Form</string>
3524
</property>
@@ -44,7 +33,7 @@
4433
<number>0</number>
4534
</property>
4635
<property name="sizeConstraint">
47-
<enum>QLayout::SizeConstraint::SetFixedSize</enum>
36+
<enum>QLayout::SizeConstraint::SetDefaultConstraint</enum>
4837
</property>
4938
<property name="leftMargin">
5039
<number>0</number>
@@ -61,17 +50,11 @@
6150
<item>
6251
<widget class="QWidget" name="widget" native="true">
6352
<property name="sizePolicy">
64-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
53+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
6554
<horstretch>0</horstretch>
6655
<verstretch>0</verstretch>
6756
</sizepolicy>
6857
</property>
69-
<property name="minimumSize">
70-
<size>
71-
<width>80</width>
72-
<height>80</height>
73-
</size>
74-
</property>
7558
<property name="maximumSize">
7659
<size>
7760
<width>16777215</width>
@@ -85,9 +68,6 @@
8568
<property name="spacing">
8669
<number>2</number>
8770
</property>
88-
<property name="sizeConstraint">
89-
<enum>QLayout::SizeConstraint::SetFixedSize</enum>
90-
</property>
9171
<property name="leftMargin">
9272
<number>2</number>
9373
</property>
@@ -124,7 +104,7 @@
124104
<item>
125105
<widget class="QToolButton" name="toolButton_modify">
126106
<property name="sizePolicy">
127-
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
107+
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
128108
<horstretch>0</horstretch>
129109
<verstretch>0</verstretch>
130110
</sizepolicy>
@@ -152,10 +132,13 @@
152132
</widget>
153133
</item>
154134
<item>
155-
<layout class="QHBoxLayout" name="horizontalLayout">
135+
<layout class="QHBoxLayout" name="horizontalLayout_2">
156136
<property name="spacing">
157137
<number>0</number>
158138
</property>
139+
<property name="sizeConstraint">
140+
<enum>QLayout::SizeConstraint::SetDefaultConstraint</enum>
141+
</property>
159142
<property name="leftMargin">
160143
<number>0</number>
161144
</property>
@@ -165,7 +148,10 @@
165148
<property name="rightMargin">
166149
<number>0</number>
167150
</property>
168-
<item alignment="Qt::AlignmentFlag::AlignVCenter">
151+
<property name="bottomMargin">
152+
<number>0</number>
153+
</property>
154+
<item>
169155
<widget class="QCheckBox" name="checkBox">
170156
<property name="sizePolicy">
171157
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
@@ -190,19 +176,6 @@
190176
</property>
191177
</widget>
192178
</item>
193-
<item>
194-
<spacer name="horizontalSpacer">
195-
<property name="orientation">
196-
<enum>Qt::Orientation::Horizontal</enum>
197-
</property>
198-
<property name="sizeHint" stdset="0">
199-
<size>
200-
<width>0</width>
201-
<height>20</height>
202-
</size>
203-
</property>
204-
</spacer>
205-
</item>
206179
<item>
207180
<widget class="QToolButton" name="toolButton_toggle">
208181
<property name="sizePolicy">
@@ -225,19 +198,6 @@
225198
</property>
226199
</widget>
227200
</item>
228-
<item>
229-
<spacer name="horizontalSpacer_2">
230-
<property name="orientation">
231-
<enum>Qt::Orientation::Horizontal</enum>
232-
</property>
233-
<property name="sizeHint" stdset="0">
234-
<size>
235-
<width>0</width>
236-
<height>20</height>
237-
</size>
238-
</property>
239-
</spacer>
240-
</item>
241201
<item>
242202
<widget class="QToolButton" name="toolButton_opt">
243203
<property name="sizePolicy">

dcscope/gui/matrix/pm_plot.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ def __init__(self, pipeline, plot_index, *args, **kwargs):
2727
menu = QtWidgets.QMenu()
2828
menu.addAction('duplicate', self.action_duplicate)
2929
menu.addAction('remove', self.action_remove)
30-
tbw = self.toolButton_toggle.sizeHint().width()
31-
self.toolButton_opt.setMaximumWidth(tbw)
30+
31+
self.setFixedWidth(int(65))
32+
self.setMinimumWidth(int(65))
33+
self.setMaximumWidth(int(65))
34+
self.adjustSize()
3235

3336
# toggle all active, all inactive, semi state
3437
self.toolButton_toggle.clicked.connect(self.on_active_toggled)

0 commit comments

Comments
 (0)