Dialog.cpp   Dialog.cpp 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include <QDebug> #include <QDebug>
#include "Dialog.hpp" #include "Dialog.hpp"
#include "StelMainWindow.hpp" #include "StelMainView.hpp"
void BarFrame::mousePressEvent(QMouseEvent *event) void BarFrame::mousePressEvent(QMouseEvent *event)
{ {
mousePos = event->pos(); mousePos = event->pos();
moving = true; moving = true;
} }
void BarFrame::mouseReleaseEvent(QMouseEvent *) void BarFrame::mouseReleaseEvent(QMouseEvent *)
{ {
moving = false; moving = false;
} }
void BarFrame::mouseMoveEvent(QMouseEvent *event) void BarFrame::mouseMoveEvent(QMouseEvent *event)
{ {
if (!moving) return; if (!moving) return;
QPoint dpos = event->pos() - mousePos; QPoint dpos = event->pos() - mousePos;
QWidget* p = dynamic_cast<QWidget*>(QFrame::parent()); QWidget* p = dynamic_cast<QWidget*>(QFrame::parent());
QPoint targetPos = p->pos() + dpos; QPoint targetPos = p->pos() + dpos;
// Prevent the title bar from being dragged to an unreachable positi on. // Prevent the title bar from being dragged to an unreachable positi on.
StelMainWindow& mainWindow = StelMainWindow::getInstance(); QWidget& mainWindow = StelMainView::getInstance();
int leftBoundX = 10 - width(); int leftBoundX = 10 - width();
int rightBoundX = mainWindow.width() - 10; int rightBoundX = mainWindow.width() - 10;
if (targetPos.x() < leftBoundX) if (targetPos.x() < leftBoundX)
targetPos.setX(leftBoundX); targetPos.setX(leftBoundX);
else if (targetPos.x() > rightBoundX) else if (targetPos.x() > rightBoundX)
targetPos.setX(rightBoundX); targetPos.setX(rightBoundX);
int lowerBoundY = mainWindow.height() - height(); int lowerBoundY = mainWindow.height() - height();
if (targetPos.y() < 0) if (targetPos.y() < 0)
targetPos.setY(0); targetPos.setY(0);
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/