summaryrefslogtreecommitdiff
path: root/sw/source/uibase/docvw
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-03-22 17:09:26 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-03-22 19:13:23 +0100
commit743b0a92acc3d1850f4890efaa706098ebf9f558 (patch)
treef0a25a383c73137db0145c80cfb79e46cad04b08 /sw/source/uibase/docvw
parent8308d6a38ff283a2feebf84a95198159887cd685 (diff)
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@collabora.com>
Diffstat (limited to 'sw/source/uibase/docvw')
-rw-r--r--sw/source/uibase/docvw/FrameControlsManager.cxx4
-rw-r--r--sw/source/uibase/docvw/UnfloatTableButton.cxx9
2 files changed, 6 insertions, 7 deletions
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();