Changeset 140 for smplayer/vendor/current/src/mplayerwindow.cpp
- Timestamp:
- May 23, 2013, 5:06:17 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/src/mplayerwindow.cpp
r137 r140 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 2Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2013 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 48 48 setMinimumSize( QSize(0,0) ); 49 49 50 #if NEW_MOUSE_CHECK_POS51 50 mouse_last_position = QPoint(0,0); 52 #else53 cursor_pos = QPoint(0,0);54 last_cursor_pos = QPoint(0,0);55 #endif56 51 57 52 check_mouse_timer = new QTimer(this); 58 53 connect( check_mouse_timer, SIGNAL(timeout()), this, SLOT(checkMousePos()) ); 59 #if !NEW_MOUSE_CHECK_POS60 check_mouse_timer->start(2000);61 #endif62 54 63 55 // Change attributes … … 69 61 //setAttribute(Qt::WA_PaintOutsidePaintEvent); 70 62 71 #if NEW_MOUSE_CHECK_POS72 63 setAutoHideInterval(1000); 73 64 setAutoHideCursor(false); 74 #endif75 65 } 76 66 … … 85 75 } 86 76 87 #if NEW_MOUSE_CHECK_POS88 77 void Screen::setAutoHideCursor(bool b) { 89 78 qDebug("Screen::setAutoHideCursor: %d", b); … … 117 106 mouse_last_position = pos; 118 107 } 119 #else120 void Screen::checkMousePos() {121 //qDebug("Screen::checkMousePos");122 123 if ( cursor_pos == last_cursor_pos ) {124 //qDebug(" same pos");125 if (cursor().shape() != Qt::BlankCursor) {126 //qDebug(" hiding mouse cursor");127 setCursor(QCursor(Qt::BlankCursor));128 }129 } else {130 last_cursor_pos = cursor_pos;131 }132 }133 108 134 109 void Screen::mouseMoveEvent( QMouseEvent * e ) { 135 //qDebug("Screen::mouseMoveEvent");136 //qDebug(" pos: x: %d y: %d", e->pos().x(), e->pos().y() );137 cursor_pos = e->pos();138 139 110 if (cursor().shape() != Qt::ArrowCursor) { 140 111 //qDebug(" showing mouse cursor" ); … … 142 113 } 143 114 } 144 #endif145 115 146 116 void Screen::playingStarted() { 147 #if NEW_MOUSE_CHECK_POS148 117 qDebug("Screen::playingStarted"); 149 118 setAutoHideCursor(true); 150 #endif151 119 } 152 120 153 121 void Screen::playingStopped() { 154 #if NEW_MOUSE_CHECK_POS155 122 qDebug("Screen::playingStopped"); 156 123 setAutoHideCursor(false); 157 #endif158 124 } 159 125
Note:
See TracChangeset
for help on using the changeset viewer.