Kaydet (Commit) fdeada8c authored tarafından Caolán McNamara's avatar Caolán McNamara

tdf#124410 re-call SetScrollBarRange when aSymbolSet changes

and do the work that depends on size happen at size-changed
instead of first-draw

Change-Id: Ia2605ba9bb875be9248a009a6f26f01cbbbd4632
Reviewed-on: https://gerrit.libreoffice.org/69928
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 938e6d7a
......@@ -259,6 +259,7 @@ class SmShowSymbolSet : public weld::CustomWidgetController
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
virtual bool MouseButtonDown(const MouseEvent& rMEvt) override;
virtual bool KeyInput(const KeyEvent& rKEvt) override;
virtual void Resize() override;
DECL_LINK(ScrollHdl, weld::ScrolledWindow&, void);
......@@ -268,8 +269,11 @@ public:
virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override
{
CustomWidgetController::SetDrawingArea(pDrawingArea);
pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 27,
pDrawingArea->get_text_height() * 9);
m_aOldSize = Size(pDrawingArea->get_approximate_digit_width() * 27,
pDrawingArea->get_text_height() * 9);
pDrawingArea->set_size_request(m_aOldSize.Width(), m_aOldSize.Height());
SetOutputSizePixel(m_aOldSize);
calccols(pDrawingArea->get_ref_device());
}
void calccols(const vcl::RenderContext& rRenderContext);
......
......@@ -940,15 +940,19 @@ Point SmShowSymbolSet::OffsetPoint(const Point &rPoint) const
return Point(rPoint.X() + nXOffset, rPoint.Y() + nYOffset);
}
void SmShowSymbolSet::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
void SmShowSymbolSet::Resize()
{
CustomWidgetController::Resize();
Size aWinSize(GetOutputSizePixel());
if (aWinSize != m_aOldSize)
{
calccols(rRenderContext);
calccols(GetDrawingArea()->get_ref_device());
m_aOldSize = aWinSize;
}
}
void SmShowSymbolSet::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
Color aBackgroundColor;
Color aTextColor;
lclGetSettingColors(aBackgroundColor, aTextColor);
......@@ -1088,6 +1092,7 @@ void SmShowSymbolSet::calccols(const vcl::RenderContext& rRenderContext)
void SmShowSymbolSet::SetSymbolSet(const SymbolPtrVec_t& rSymbolSet)
{
aSymbolSet = rSymbolSet;
SetScrollBarRange();
Invalidate();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment