comparison view/Pane.cpp @ 165:793df5f0c6cb

* Make the thumbwheel widget much smoother to use, and fix a bug in positioning
author Chris Cannam
date Thu, 12 Oct 2006 15:47:38 +0000
parents 30d624900564
children d0b95a8cac96
comparison
equal deleted inserted replaced
164:11949d0b2739 165:793df5f0c6cb
86 m_hthumb = new Thumbwheel(Qt::Horizontal); 86 m_hthumb = new Thumbwheel(Qt::Horizontal);
87 layout->addWidget(m_hthumb, 1, 0); 87 layout->addWidget(m_hthumb, 1, 0);
88 m_hthumb->setFixedWidth(70); 88 m_hthumb->setFixedWidth(70);
89 m_hthumb->setFixedHeight(16); 89 m_hthumb->setFixedHeight(16);
90 m_hthumb->setDefaultValue(0); 90 m_hthumb->setDefaultValue(0);
91 m_hthumb->setSpeed(0.6);
91 connect(m_hthumb, SIGNAL(valueChanged(int)), this, 92 connect(m_hthumb, SIGNAL(valueChanged(int)), this,
92 SLOT(horizontalThumbwheelMoved(int))); 93 SLOT(horizontalThumbwheelMoved(int)));
93 94
94 m_vthumb = new Thumbwheel(Qt::Vertical); 95 m_vthumb = new Thumbwheel(Qt::Vertical);
95 layout->addWidget(m_vthumb, 0, 1); 96 layout->addWidget(m_vthumb, 0, 1);
186 } 187 }
187 } 188 }
188 189
189 if (m_manager && m_manager->getZoomWheelsEnabled() && 190 if (m_manager && m_manager->getZoomWheelsEnabled() &&
190 width() > 120 && height() > 100) { 191 width() > 120 && height() > 100) {
192 if (!m_headsUpDisplay->isVisible()) {
193 m_headsUpDisplay->show();
194 connect(m_manager, SIGNAL(zoomLevelChanged()),
195 this, SLOT(zoomLevelChanged()));
196 }
191 if (m_vthumb->isVisible()) { 197 if (m_vthumb->isVisible()) {
192 m_headsUpDisplay->move(width() - 86, height() - 86); 198 m_headsUpDisplay->move(width() - 86, height() - 86);
193 } else { 199 } else {
194 m_headsUpDisplay->move(width() - 86, height() - 51); 200 m_headsUpDisplay->move(width() - 86, height() - 51);
195 }
196 if (!m_headsUpDisplay->isVisible()) {
197 m_headsUpDisplay->show();
198 connect(m_manager, SIGNAL(zoomLevelChanged()),
199 this, SLOT(zoomLevelChanged()));
200 } 201 }
201 } else { 202 } else {
202 m_headsUpDisplay->hide(); 203 m_headsUpDisplay->hide();
203 if (m_manager) { 204 if (m_manager) {
204 disconnect(m_manager, SIGNAL(zoomLevelChanged()), 205 disconnect(m_manager, SIGNAL(zoomLevelChanged()),