r22805 by jghali - Refactor Hruler and Vruler classes

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 13 23:59:36 UTC 2019


Author: jghali
Date: Sun Jan 13 23:59:35 2019
New Revision: 22805

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22805
Log:
Refactor Hruler and Vruler classes

Modified:
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/ui/hruler.cpp
    trunk/Scribus/scribus/ui/hruler.h
    trunk/Scribus/scribus/ui/vruler.cpp
    trunk/Scribus/scribus/ui/vruler.h

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22805&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp	(original)
+++ trunk/Scribus/scribus/scribusview.cpp	Sun Jan 13 23:59:35 2019
@@ -694,8 +694,8 @@
 			//				redrawMarker->show();
 			emit MousePos(dragX, dragY); //+Doc->minCanvasCoordinate.x(), dragY+Doc->minCanvasCoordinate.y());
 			QPoint pos = m_canvas->canvasToLocal(dragPosDoc);
-			horizRuler->Draw(pos.x());
-			vertRuler->Draw(pos.y());
+			horizRuler->draw(pos.x());
+			vertRuler->draw(pos.y());
 			//			return;
 		}
 		/*		QUrl ur(text);
@@ -3408,8 +3408,8 @@
 		m_mousePointDoc=m_canvas->globalToCanvas(m->globalPos());
 		FPoint p = m_canvas->localToCanvas(QPoint(m->x(),m->y()));
 		emit MousePos(p.x(),p.y());
-		horizRuler->Draw(m->x() + qRound(Doc->minCanvasCoordinate.x() * m_canvas->scale())); //  - 2 * contentsX());
-		vertRuler->Draw(m->y() + qRound(Doc->minCanvasCoordinate.y() * m_canvas->scale()));
+		horizRuler->draw(m->x() + qRound(Doc->minCanvasCoordinate.x() * m_canvas->scale())); //  - 2 * contentsX());
+		vertRuler->draw(m->y() + qRound(Doc->minCanvasCoordinate.y() * m_canvas->scale()));
 		m_canvasMode->mouseMoveEvent(m);
 		return true;
 	}

Modified: trunk/Scribus/scribus/ui/hruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22805&path=/trunk/Scribus/scribus/ui/hruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/hruler.cpp	(original)
+++ trunk/Scribus/scribus/ui/hruler.cpp	Sun Jan 13 23:59:35 2019
@@ -471,7 +471,7 @@
 					setCursor(QCursor(Qt::SizeHorCursor));
 					break;
 			}
-			Draw(m->x());
+			draw(m->x());
 			double marker = localToTextPos(m->x());
 			emit MarkerMoved(textBase(), marker);
 			return;
@@ -859,7 +859,7 @@
 	return m_iter;
 }
 
-void Hruler::Draw(int where)
+void Hruler::draw(int where)
 {
 	// erase old marker
 	int currentCoor = where - m_view->contentsX();

Modified: trunk/Scribus/scribus/ui/hruler.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22805&path=/trunk/Scribus/scribus/ui/hruler.h
==============================================================================
--- trunk/Scribus/scribus/ui/hruler.h	(original)
+++ trunk/Scribus/scribus/ui/hruler.h	Sun Jan 13 23:59:35 2019
@@ -118,7 +118,7 @@
 public slots: // Public slots
 	/** \brief draw mark
 	\param where where to draw */
-	void Draw(int where);
+	void draw(int where);
 	void unitChange();
 
 signals:

Modified: trunk/Scribus/scribus/ui/vruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22805&path=/trunk/Scribus/scribus/ui/vruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/vruler.cpp	(original)
+++ trunk/Scribus/scribus/ui/vruler.cpp	Sun Jan 13 23:59:35 2019
@@ -222,7 +222,7 @@
 	return m_iter;
 }
 
-void Vruler::Draw(int where)
+void Vruler::draw(int where)
 {
 	// erase old marker
 	int currentCoor = where - m_view->contentsY();

Modified: trunk/Scribus/scribus/ui/vruler.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22805&path=/trunk/Scribus/scribus/ui/vruler.h
==============================================================================
--- trunk/Scribus/scribus/ui/vruler.h	(original)
+++ trunk/Scribus/scribus/ui/vruler.h	Sun Jan 13 23:59:35 2019
@@ -46,6 +46,8 @@
 	~Vruler() {}
 	
 	double ruleSpacing();
+	void   shift(double pos) { m_offset = pos; }
+	void   shiftRel(double dist) { m_offset += dist; }
 
 private: // Private attributes
 	virtual void paintEvent(QPaintEvent *e);
@@ -68,10 +70,8 @@
 public slots: // Public slots
 	/** \brief draw mark
 	\param where where to draw */
-	void Draw(int where);
+	void draw(int where);
 	void unitChange();
-	void shift(double pos) { m_offset = pos; }
-	void shiftRel(double dist) { m_offset += dist; }
 
 private:
 	PrefsManager *prefsManager;




More information about the scribus-commit mailing list