Commit 810265fe authored by Jan Möbius's avatar Jan Möbius

Fixed jumping between different cursors

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8204 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 16f0e579
Icons/cursor_light.png

2.36 KB | W: | H:

Icons/cursor_light.png

1.81 KB | W: | H:

Icons/cursor_light.png
Icons/cursor_light.png
Icons/cursor_light.png
Icons/cursor_light.png
  • 2-up
  • Swipe
  • Onion skin
Icons/cursor_move.png

2.4 KB | W: | H:

Icons/cursor_move.png

1.91 KB | W: | H:

Icons/cursor_move.png
Icons/cursor_move.png
Icons/cursor_move.png
Icons/cursor_move.png
  • 2-up
  • Swipe
  • Onion skin
Icons/cursor_whatsthis.png

2.3 KB | W: | H:

Icons/cursor_whatsthis.png

1.95 KB | W: | H:

Icons/cursor_whatsthis.png
Icons/cursor_whatsthis.png
Icons/cursor_whatsthis.png
Icons/cursor_whatsthis.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -76,31 +76,17 @@ void CoreWidget::setActionMode(const Viewer::ActionMode _am){
switch (_am)
{
case Viewer::ExamineMode:
{
moveButton_->setDown(true);
break;
}
case Viewer::LightMode:
{
lightButton_->setDown(true);
break;
}
case Viewer::PickingMode:
{
pickButton_->setDown(true);
break;
}
case Viewer::QuestionMode:
{
questionButton_->setDown(true);
break;
}
}
// update cursor
......@@ -113,7 +99,7 @@ void CoreWidget::setActionMode(const Viewer::ActionMode _am){
cursorPainter_->setCursor(QCursor( QPixmap( OpenFlipper::Options::iconDirStr() + QDir::separator() + "cursor_light.png" )));
break;
case Viewer::PickingMode:
cursorPainter_->setCursor(Qt::ArrowCursor);
cursorPainter_->setCursor(QCursor( QPixmap( OpenFlipper::Options::iconDirStr() + QDir::separator() + "cursor_arrow.png" )));
if (pick_mode_idx_ != -1) {
cursorPainter_->setCursor(pick_modes_[pick_mode_idx_].cursor);
}
......@@ -128,34 +114,27 @@ void CoreWidget::setActionMode(const Viewer::ActionMode _am){
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
examiner_widgets_[i]->sceneGraph( PluginFunctions::getSceneGraphRootNode() );
examiner_widgets_[i]->trackMouse(false);
switch ( _am )
{
case Viewer::ExamineMode:
{
pickToolbar_->detachToolbar ();
break;
}
case Viewer::PickingMode:
{
if (pick_mode_idx_ != -1) {
examiner_widgets_[i]->trackMouse(pick_modes_[pick_mode_idx_].tracking);
// Show the pickMode Toolbar for this picking mode if it is set
if (pick_modes_[pick_mode_idx_].toolbar)
pickToolbar_->attachToolbar (pick_modes_[pick_mode_idx_].toolbar);
else
pickToolbar_->detachToolbar ();
}
break;
}
default:
break;
}
}
......@@ -164,7 +143,6 @@ void CoreWidget::setActionMode(const Viewer::ActionMode _am){
emit(signalPickModeChanged(pick_mode_name_));
else
emit(signalPickModeChanged(""));
}
}
......
......@@ -243,26 +243,27 @@ void CursorPainter::cursorToTexture()
hasCursor_ = false;
// Initialize hotspot with default position in the upper left corner of the cursor
xOff_ = 0;
yOff_ = 0;
///\todo Possibly switch all cursors to bitmap cursors and check there Hotspots!!
switch (nativeCursor_.shape())
{
case Qt::ArrowCursor:
cImg.load (OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"cursor_arrow.png");
xOff_ = 0;
yOff_ = 0;
break;
case Qt::PointingHandCursor:
cImg.load (OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"cursor_move.png");
xOff_ = 7;
yOff_ = 1;
break;
case Qt::WhatsThisCursor:
cImg.load (OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"cursor_whatsthis.png");
xOff_ = 7;
yOff_ = 1;
break;
case Qt::BitmapCursor:
// Get the image of the cursor
cImg = QImage(( nativeCursor_.pixmap().toImage() ) );
// get the hotspot from the cursor
xOff_ = nativeCursor_.hotSpot().x();
yOff_ = nativeCursor_.hotSpot().y();
break;
......@@ -271,6 +272,7 @@ void CursorPainter::cursorToTexture()
return;
}
// Check if the cursor dimension is matching our requirements
if (cImg.width () != 32 || cImg.height () != 32) {
std::cerr << "cursorToTexture: Dimension error" << nativeCursor_.shape() << std::endl;
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment