@@ -41,10 +41,10 @@ def __init__(self, in_mantid=False):
41
41
}
42
42
43
43
self .buttons_to_enable = {
44
- TAB_2D : [self .btnAdd , self .btnSubtract , self .composeFrame ],
44
+ TAB_2D : [self .btnAdd , self .btnSubtract , self .btnCompose ],
45
45
TAB_EVENT : [self .btnMerge ],
46
46
TAB_HISTO : [self .btnPlot , self .btnOverplot ],
47
- TAB_NONPSD : [self .btnAdd , self .btnSubtract , self .composeFrame ],
47
+ TAB_NONPSD : [self .btnAdd , self .btnSubtract , self .btnCompose ],
48
48
}
49
49
if in_mantid :
50
50
self .buttons_to_enable [TAB_HISTO ] += [self .btnSaveToADS ]
@@ -151,15 +151,10 @@ def setup_save(self):
151
151
self .btnSave .setMenu (menu )
152
152
153
153
def setup_compose_button (self ):
154
- self .stackLayout = QStackedLayout (self .stackFrame )
155
- self .stackLayout .addWidget (self .btnSaveToADS )
156
- self .stackLayout .addWidget (self .composeFrame )
157
- self .stackFrame .setLayout (self .stackLayout )
158
- menu = QMenu (self .btnComposeMenu )
154
+ menu = QMenu (self .btnCompose )
159
155
menu .addAction ("Scale" , lambda : self .button_compose ("Scale" ))
160
156
menu .addAction ("Bose" , lambda : self .button_compose ("Bose" ))
161
- self .btnComposeMenu .setMenu (menu )
162
- self .btnComposeMenu .setMaximumWidth (10 )
157
+ self .btnCompose .setMenu (menu )
163
158
164
159
def change_main_tab (self , tab ):
165
160
self .tabWidget .setCurrentIndex (tab )
@@ -183,15 +178,14 @@ def enable_widget_tabs(self, workspace_tab):
183
178
184
179
def enable_buttons (self , tab ):
185
180
"""Enables correct buttons based on workspace tab"""
186
- self .stackLayout .setCurrentIndex (self .stack_to_show [tab ])
187
181
variable_buttons = [
188
182
self .btnAdd ,
189
183
self .btnSubtract ,
190
184
self .btnMerge ,
191
185
self .btnPlot ,
192
186
self .btnOverplot ,
193
187
self .btnSaveToADS ,
194
- self .composeFrame ,
188
+ self .btnCompose ,
195
189
]
196
190
for button in variable_buttons :
197
191
button .hide ()
@@ -227,12 +221,8 @@ def button_overplot(self):
227
221
def button_savetoads (self ):
228
222
self .workspace_presenter .notify (ws_command .SaveToADS )
229
223
230
- def button_compose (self , value = False ):
231
- if value :
232
- self .btnCompose .setText (value )
233
- self .workspace_presenter .notify (
234
- self .composeCommand [str (self .btnCompose .text ())]
235
- )
224
+ def button_compose (self , compose_type ):
225
+ self .workspace_presenter .notify (self .composeCommand [str (compose_type )])
236
226
237
227
def init_ui (self ):
238
228
self .setup_ipython ()
0 commit comments