[Libreoffice-commits] core.git: sw/source
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Fri Mar 22 18:13:48 UTC 2019
sw/source/core/layout/fly.cxx | 4 ++--
sw/source/uibase/docvw/FrameControlsManager.cxx | 4 ++--
sw/source/uibase/docvw/UnfloatTableButton.cxx | 9 ++++-----
sw/source/uibase/inc/FrameControlsManager.hxx | 2 +-
sw/source/uibase/inc/UnfloatTableButton.hxx | 2 +-
5 files changed, 10 insertions(+), 11 deletions(-)
New commits:
commit 743b0a92acc3d1850f4890efaa706098ebf9f558
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Mar 22 17:09:26 2019 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Mar 22 19:13:23 2019 +0100
Unfloat: Move the button to the top of the frame
User can find it easier in this position.
Change-Id: I38fd782485a180e0d5223b52cc2c6ee061661600
Reviewed-on: https://gerrit.libreoffice.org/69562
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 06410cedf750..9e061ebf754d 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -1869,8 +1869,8 @@ void SwFlyFrame::UpdateUnfloatButton(SwWrtShell* pWrtSh, bool bShow) const
SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin();
SwFrameControlsManager& rMngr = rEditWin.GetFrameControlsManager();
- Point aBottomRightPixel = rEditWin.LogicToPixel( getFrameArea().BottomRight() );
- rMngr.SetUnfloatTableButton(this, bShow, aBottomRightPixel);
+ Point aTopRightPixel = rEditWin.LogicToPixel( getFrameArea().TopRight() );
+ rMngr.SetUnfloatTableButton(this, bShow, aTopRightPixel);
}
SwTwips SwFlyFrame::Grow_( SwTwips nDist, bool bTst )
diff --git a/sw/source/uibase/docvw/FrameControlsManager.cxx b/sw/source/uibase/docvw/FrameControlsManager.cxx
index bd135c422cb5..eb816515ea07 100644
--- a/sw/source/uibase/docvw/FrameControlsManager.cxx
+++ b/sw/source/uibase/docvw/FrameControlsManager.cxx
@@ -139,7 +139,7 @@ void SwFrameControlsManager::SetPageBreakControl( const SwPageFrame* pPageFrame
pControl->ShowAll( true );
}
-void SwFrameControlsManager::SetUnfloatTableButton( const SwFlyFrame* pFlyFrame, bool bShow, Point aBottomRightPixel )
+void SwFrameControlsManager::SetUnfloatTableButton( const SwFlyFrame* pFlyFrame, bool bShow, Point aTopRightPixel )
{
if(pFlyFrame == nullptr)
return;
@@ -168,7 +168,7 @@ void SwFrameControlsManager::SetUnfloatTableButton( const SwFlyFrame* pFlyFrame,
UnfloatTableButton* pButton = dynamic_cast<UnfloatTableButton*>(pControl->GetWindow());
assert(pButton != nullptr);
- pButton->SetOffset(aBottomRightPixel);
+ pButton->SetOffset(aTopRightPixel);
pControl->ShowAll( bShow );
}
diff --git a/sw/source/uibase/docvw/UnfloatTableButton.cxx b/sw/source/uibase/docvw/UnfloatTableButton.cxx
index 0592378ec768..a4a92be08d33 100644
--- a/sw/source/uibase/docvw/UnfloatTableButton.cxx
+++ b/sw/source/uibase/docvw/UnfloatTableButton.cxx
@@ -49,7 +49,7 @@ UnfloatTableButton::UnfloatTableButton(SwEditWin* pEditWin, const SwFrame* pFram
UnfloatTableButton::~UnfloatTableButton() { disposeOnce(); }
-void UnfloatTableButton::SetOffset(Point aBottomRightPixel)
+void UnfloatTableButton::SetOffset(Point aTopRightPixel)
{
// Compute the text size and get the box position & size from it
tools::Rectangle aTextRect;
@@ -59,12 +59,11 @@ void UnfloatTableButton::SetOffset(Point aBottomRightPixel)
Size aBoxSize(aTextPxRect.GetWidth() + BUTTON_WIDTH + TEXT_PADDING * 2,
aFontMetric.GetLineHeight() + TEXT_PADDING * 2);
- Point aBoxPos(aBottomRightPixel.X() - aBoxSize.Width() - BOX_DISTANCE,
- aBottomRightPixel.Y() - aBoxSize.Height());
+ Point aBoxPos(aTopRightPixel.X() - aBoxSize.Width() - BOX_DISTANCE, aTopRightPixel.Y());
if (AllSettings::GetLayoutRTL())
{
- aBoxPos.setX(aBottomRightPixel.X() + BOX_DISTANCE);
+ aBoxPos.setX(aTopRightPixel.X() + BOX_DISTANCE);
}
// Set the position & Size of the window
@@ -163,7 +162,7 @@ void UnfloatTableButton::Paint(vcl::RenderContext& rRenderContext, const tools::
::tools::Rectangle(Point(0, 0), rRenderContext.PixelToLogic(GetSizePixel())));
// Create button
- SwFrameButtonPainter::PaintButton(aSeq, aRect, false);
+ SwFrameButtonPainter::PaintButton(aSeq, aRect, true);
// Create the text primitive
basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
diff --git a/sw/source/uibase/inc/FrameControlsManager.hxx b/sw/source/uibase/inc/FrameControlsManager.hxx
index 2b94b947fd53..e8b5e33f3806 100644
--- a/sw/source/uibase/inc/FrameControlsManager.hxx
+++ b/sw/source/uibase/inc/FrameControlsManager.hxx
@@ -47,7 +47,7 @@ class SwFrameControlsManager
// Helper methods
void SetHeaderFooterControl( const SwPageFrame* pPageFrame, FrameControlType eType, Point aOffset );
void SetPageBreakControl( const SwPageFrame* pPageFrame );
- void SetUnfloatTableButton( const SwFlyFrame* pFlyFrame, bool bShow, Point aTopLeftPixel = Point() );
+ void SetUnfloatTableButton( const SwFlyFrame* pFlyFrame, bool bShow, Point aTopRightPixel = Point() );
};
#endif
diff --git a/sw/source/uibase/inc/UnfloatTableButton.hxx b/sw/source/uibase/inc/UnfloatTableButton.hxx
index 94b4eb761ca0..cdf6eafb439d 100644
--- a/sw/source/uibase/inc/UnfloatTableButton.hxx
+++ b/sw/source/uibase/inc/UnfloatTableButton.hxx
@@ -30,7 +30,7 @@ public:
UnfloatTableButton(SwEditWin* pEditWin, const SwFrame* pFrame);
virtual ~UnfloatTableButton() override;
- void SetOffset(Point aBottomRightPixel);
+ void SetOffset(Point aTopRightPixel);
virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
More information about the Libreoffice-commits
mailing list