[Libreoffice-commits] .: 4 commits - starmath/source

Ivan Timofeev ivantimofeev at kemper.freedesktop.org
Sun Aug 5 09:31:25 PDT 2012


 starmath/source/view.cxx |   65 ++++++++++-------------------------------------
 1 file changed, 14 insertions(+), 51 deletions(-)

New commits:
commit c4486f247891cefe6222262dae0f5ef6581ebdca
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Sun Aug 5 20:29:20 2012 +0400

    SmCmdBoxWindow: use single-line frame
    
    Change-Id: I527ae337a9e445d911dba956daf9d76f9d7572de

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index ad6c232..5707439 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -730,7 +730,7 @@ void SmCmdBoxWindow::Resize()
     aRect.Bottom() -= CMD_BOX_PADDING;
 
     DecorationView aView(this);
-    aRect = aView.DrawFrame( aRect, FRAME_DRAW_DOUBLEIN | FRAME_DRAW_NODRAW );
+    aRect = aView.DrawFrame( aRect, FRAME_DRAW_IN | FRAME_DRAW_NODRAW );
 
     aEdit.SetPosSizePixel(aRect.TopLeft(), aRect.GetSize());
     SfxDockingWindow::Resize();
@@ -747,7 +747,7 @@ void SmCmdBoxWindow::Paint(const Rectangle& /*rRect*/)
     aRect.Bottom() -= CMD_BOX_PADDING;
 
     DecorationView aView(this);
-    aView.DrawFrame( aRect, FRAME_DRAW_DOUBLEIN );
+    aView.DrawFrame( aRect, FRAME_DRAW_IN );
 }
 
 
commit d1501aa5e8f40b6016753f9fb34181a4f914a1d5
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Sun Aug 5 19:12:39 2012 +0400

    SmCmdBoxWindow: reduce padding from 8 to 4
    
    Change-Id: If87bc63b4bd3fd27eef665261667478d9284ff0b

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index a7af464..ad6c232 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -74,6 +74,9 @@
 #define MINZOOM         25
 #define MAXZOOM         800
 
+// space around the edit window, in pixels
+#define CMD_BOX_PADDING 4
+
 #define SmViewShell
 #include "smslots.hxx"
 
@@ -721,9 +724,12 @@ SmViewShell * SmCmdBoxWindow::GetView()
 void SmCmdBoxWindow::Resize()
 {
     Rectangle aRect = Rectangle(Point(0, 0), GetOutputSizePixel());
+    aRect.Left()   += CMD_BOX_PADDING;
+    aRect.Top()    += CMD_BOX_PADDING;
+    aRect.Right()  -= CMD_BOX_PADDING;
+    aRect.Bottom() -= CMD_BOX_PADDING;
+
     DecorationView aView(this);
-    aRect.Left() += 8; aRect.Top()   += 8;
-    aRect.Right()-= 8; aRect.Bottom()-= 8;
     aRect = aView.DrawFrame( aRect, FRAME_DRAW_DOUBLEIN | FRAME_DRAW_NODRAW );
 
     aEdit.SetPosSizePixel(aRect.TopLeft(), aRect.GetSize());
@@ -735,10 +741,13 @@ void SmCmdBoxWindow::Resize()
 void SmCmdBoxWindow::Paint(const Rectangle& /*rRect*/)
 {
     Rectangle aRect = Rectangle(Point(0, 0), GetOutputSizePixel());
+    aRect.Left()   += CMD_BOX_PADDING;
+    aRect.Top()    += CMD_BOX_PADDING;
+    aRect.Right()  -= CMD_BOX_PADDING;
+    aRect.Bottom() -= CMD_BOX_PADDING;
+
     DecorationView aView(this);
-    aRect.Left() += 8; aRect.Top()   += 8;
-    aRect.Right()-= 8; aRect.Bottom()-= 8;
-    aRect = aView.DrawFrame( aRect, FRAME_DRAW_DOUBLEIN );
+    aView.DrawFrame( aRect, FRAME_DRAW_DOUBLEIN );
 }
 
 
commit 20d4cd5e08c1400fcc5ae5eb45861f429b914969
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Sun Aug 5 18:54:52 2012 +0400

    SmCmdBoxWindow: no drawing in Resize()
    
    Change-Id: I7cd7bb2e1bf37e41c0bea81c3ac6ec74feaa87bf

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 798b998..a7af464 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -724,7 +724,7 @@ void SmCmdBoxWindow::Resize()
     DecorationView aView(this);
     aRect.Left() += 8; aRect.Top()   += 8;
     aRect.Right()-= 8; aRect.Bottom()-= 8;
-    aRect = aView.DrawFrame( aRect, FRAME_DRAW_DOUBLEIN );
+    aRect = aView.DrawFrame( aRect, FRAME_DRAW_DOUBLEIN | FRAME_DRAW_NODRAW );
 
     aEdit.SetPosSizePixel(aRect.TopLeft(), aRect.GetSize());
     SfxDockingWindow::Resize();
commit 79509fa629055cdfaca2011fddb4291ed8b3f7dd
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Sun Aug 5 18:51:49 2012 +0400

    SmCmdBoxWindow: too many frames...
    
    Change-Id: If93baa96c7eacdeae6ad2fdecbe33fc141934094

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index f1365b4..798b998 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -721,20 +721,6 @@ SmViewShell * SmCmdBoxWindow::GetView()
 void SmCmdBoxWindow::Resize()
 {
     Rectangle aRect = Rectangle(Point(0, 0), GetOutputSizePixel());
-
-    if (! IsFloatingMode())
-    {
-        switch (GetAlignment())
-        {
-            case SFX_ALIGN_TOP:     aRect.Bottom()--;   break;
-            case SFX_ALIGN_BOTTOM:  aRect.Top()++;      break;
-            case SFX_ALIGN_LEFT:    aRect.Right()--;    break;
-            case SFX_ALIGN_RIGHT:   aRect.Left()++;     break;
-            default:
-                break;
-        }
-    }
-
     DecorationView aView(this);
     aRect.Left() += 8; aRect.Top()   += 8;
     aRect.Right()-= 8; aRect.Bottom()-= 8;
@@ -750,38 +736,6 @@ void SmCmdBoxWindow::Paint(const Rectangle& /*rRect*/)
 {
     Rectangle aRect = Rectangle(Point(0, 0), GetOutputSizePixel());
     DecorationView aView(this);
-
-    if (! IsFloatingMode())
-    {
-        Point aFrom, aTo;
-        switch (GetAlignment())
-        {
-            case SFX_ALIGN_TOP:
-                aFrom = aRect.BottomLeft(); aTo = aRect.BottomRight();
-                aRect.Bottom()--;
-                break;
-
-            case SFX_ALIGN_BOTTOM:
-                aFrom = aRect.TopLeft(); aTo = aRect.TopRight();
-                aRect.Top()++;
-                break;
-
-            case SFX_ALIGN_LEFT:
-                aFrom = aRect.TopRight(); aTo = aRect.BottomRight();
-                aRect.Right()--;
-                break;
-
-            case SFX_ALIGN_RIGHT:
-                aFrom = aRect.TopLeft(); aTo = aRect.BottomLeft();
-                aRect.Left()++;
-                break;
-
-            default:
-                break;
-        }
-        DrawLine( aFrom, aTo );
-        aView.DrawFrame(aRect, FRAME_DRAW_OUT);
-    }
     aRect.Left() += 8; aRect.Top()   += 8;
     aRect.Right()-= 8; aRect.Bottom()-= 8;
     aRect = aView.DrawFrame( aRect, FRAME_DRAW_DOUBLEIN );


More information about the Libreoffice-commits mailing list