Skip to content

Commit c481ca9

Browse files
author
Miles Lucas
committed
change toggleSlider behavior so it can't be changed while sequencing but otherwise looks disabled
1 parent 8dc8e20 commit c481ca9

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

gui/widgets/hwpSequencer/hwpSequencer.hpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,20 @@ void hwpSequencer::updateGUI()
365365

366366
// disable things that we shouldn't change while sequencing
367367
ui.entryHwpAngle->setEnabled(!m_sequencing);
368-
ui.sliderTracking->setEnabled(!m_sequencing);
368+
// we actually don't want to disable the toggleSlider because it will appear "off" even if tracking is on
369+
if (m_sequencing)
370+
{
371+
ui.sliderTracking->setAttribute(Qt::WA_TransparentForMouseEvents, true);
372+
ui.sliderTracking->setFocusPolicy(Qt::NoFocus);
373+
}
374+
else
375+
{
376+
ui.sliderTracking->setAttribute(Qt::WA_TransparentForMouseEvents, false);
377+
ui.sliderTracking->setFocusPolicy(Qt::StrongFocus);
378+
}
379+
ui.sliderTracking->setLabelEnabled(!m_sequencing);
369380
ui.labelTracking->setVisible(m_tracking);
381+
ui.labelTracking->setEnabled(!m_sequencing);
370382
ui.entryNumCycles->setEnabled(!m_sequencing);
371383
ui.negOneLabel->setEnabled(!m_sequencing);
372384
ui.entryTimePerPos->setEnabled(!m_sequencing);

gui/widgets/xWidgets/toggleSlider.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ class toggleSlider : public xWidget
9999

100100
virtual void handleSetProperty( const pcf::IndiProperty & ipRecv /**< [in] the property which has changed*/);
101101

102+
103+
void setLabelEnabled(bool);
102104
//------------------------------------------------------
103105

104106
public slots:
@@ -198,6 +200,11 @@ std::string toggleSlider::label()
198200
return ui.label->text().toStdString();
199201
}
200202

203+
void toggleSlider::setLabelEnabled(bool onoff)
204+
{
205+
ui.label->setEnabled(onoff);
206+
}
207+
201208
void toggleSlider::setStretch( int sSpacer,
202209
int sLabel,
203210
int sSlider,

0 commit comments

Comments
 (0)