]> git.lyx.org Git - features.git/commitdiff
cosmetics
authorAndré Pönitz <poenitz@gmx.net>
Sun, 22 Oct 2006 17:58:09 +0000 (17:58 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sun, 22 Oct 2006 17:58:09 +0000 (17:58 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15487 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiWorkArea.C
src/frontends/qt4/GuiWorkArea.h
src/frontends/qt4/QLPainter.C
src/frontends/qt4/iconpalette.C

index 67d1289636b45cea01e27a2e53c6718de58afe2e..dfb154f61b854ec34f4d3dd44109ee2ff4f78007 100644 (file)
@@ -170,11 +170,6 @@ GuiWorkArea::GuiWorkArea(int w, int h, LyXView & lyx_view)
 }
 
 
-GuiWorkArea::~GuiWorkArea()
-{
-}
-
-
 void GuiWorkArea::setScrollbarParams(int h, int scroll_pos, int scroll_line_step)
 {
        verticalScrollBar()->setTracking(false);
@@ -431,6 +426,10 @@ void GuiWorkArea::update(int x, int y, int w, int h)
 
 void GuiWorkArea::paintEvent(QPaintEvent * e)
 {
+       lyxerr << "paintEvent begin: x: " << e->rect().x()
+               << " y: " << e->rect().y()
+               << " w: " << e->rect().width()
+               << " h: " << e->rect().height() << endl;
        /*
        lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
                << "\n QWidget width\t" << this->width()
@@ -454,32 +453,31 @@ void GuiWorkArea::paintEvent(QPaintEvent * e)
 
        if (show_hcursor_)
                q.drawPixmap(cursor_x_, cursor_y_ + cursor_h_ - 1, hcursor_);
+
+       lyxerr << "paintEvent end" << endl;
 }
 
 
 QPixmap GuiWorkArea::copyScreen(int x, int y, int w, int h) const
 {
+       lyxerr << "copyScreen begin: x: " << x << " y: " << y << endl; 
        return paint_device_.copy(x, y, w, h);
+       lyxerr << "copyScreen end " << endl; 
 }
 
 
-void GuiWorkArea::drawScreen(int x, int y, QPixmap pixmap)
+void GuiWorkArea::drawScreen(int x, int y, const QPixmap & pixmap)
 {
+       lyxerr << "drawScreen begin: x: " << x << " y: " << y << endl; 
        QPainter q(&paint_device_);
        q.drawPixmap(x, y, pixmap);
        update(x, y, pixmap.width(), pixmap.height());
+       lyxerr << "drawScreen end" << endl;
 }
 
 
 void GuiWorkArea::expose(int x, int y, int w, int h)
 {
-       /*
-       if (x == 0 && y == 0 && w == viewport()->width() && h == viewport()->height()) {
-               viewport()->repaint(x, y, w, h);
-               return;
-       }
-       */
-
        update(x, y, w, h);
 }
 
index 2f96ff7a6c448a96581087c54dd23bdf85d11e34..84aa093224b3b68b43f08a7cbb904dcc98ea0d4a 100644 (file)
 
 #include <QAbstractScrollArea>
 #include <QMouseEvent>
-#include <QWheelEvent>
 #include <QResizeEvent>
 #include <QKeyEvent>
-#include <QPaintEvent>
 #include <QTimer>
-#include <QImage>
 #include <QPixmap>
 
 #include <queue>
 
-class Painter;
-
 class QWidget;
 class QDragEnterEvent;
 class QDropEvent;
-class QMouseEvent;
+class QWheelEvent;
+class QPaintEvent;
 
 namespace lyx {
+
+class Painter;
+
 namespace frontend {
 
 class GuiView;
@@ -95,13 +94,11 @@ class GuiWorkArea: public QAbstractScrollArea, public WorkArea
        Q_OBJECT
 
 public:
-
+       ///
        GuiWorkArea(int width, int height, LyXView & lyx_view);
 
-       virtual ~GuiWorkArea();
        /// return the width of the content pane
        virtual int width() const { return viewport()->width(); }
-
        /// return the height of the content pane
        virtual int height() const { return viewport()->height(); }
        ///
@@ -126,10 +123,7 @@ public:
        QPixmap copyScreen(int x, int y, int w, int h) const;
 
        /// Draw a pixmap onto the backing pixmap.
-       /**
-       QPixmap is implicitely shared so no need to pass by reference.
-       */
-       void drawScreen(int x, int y, QPixmap pixmap);
+       void drawScreen(int x, int y, const QPixmap & pixmap);
 
        /// copies specified area of pixmap to screen
        virtual void expose(int x, int y, int exp_width, int exp_height);
index ca6aebcbb38b2a4b779f6335fe8f65792387dda0..1742085d23301a6951781547b2f528e72ea61fdf 100644 (file)
@@ -55,6 +55,7 @@ QLPainter::QLPainter(GuiWorkArea * qwa)
 
 void QLPainter::start()
 {
+       lyxerr << "QLPainter::start()" << endl;
        qp_.reset(new QPainter(qwa_->paintDevice()));
        // new QPainter has default QPen:
        current_color_ = LColor::black;
@@ -66,6 +67,7 @@ void QLPainter::start()
 void QLPainter::end()
 {
        qp_->end();
+       lyxerr << "QLPainter::end()" << endl;
 }
 
 
index 7e3508c05a8d24981910a18b2fda799412fcd7e4..6d9fd5330682189beab974b082713cd81b75a5f4 100644 (file)
@@ -34,7 +34,7 @@ using std::vector;
 
 namespace lyx {
 
-int const button_size = 40;
+int const button_size = 32;
 
 
 IconPalette::IconPalette(QWidget * parent)
@@ -63,11 +63,11 @@ void IconPalette::add(QPixmap const & pixmap, string name, string tooltip)
 
 void IconPalette::clicked()
 {
-       vector<Button>::const_iterator it(buttons_.begin());
-       vector<Button>::const_iterator const end(buttons_.end());
+       vector<Button>::const_iterator it = buttons_.begin();
+       vector<Button>::const_iterator const end = buttons_.end();
        for (; it != end; ++it) {
                if (sender() == it->first) {
-                        // emit signal
+                       // emit signal
                        button_clicked(it->second);
                        return;
                }