From f0960e05c2f540c99062867236419c2a70c1160b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 19 May 2024 20:29:26 +0100 Subject: Resolves: tdf#155364 resize buttons and change widget font sizes on zoom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ied951e6c96881bd56a40ae01077cd7f76f9b7853 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168071 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- include/svx/gridctrl.hxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx index 27d7f25c7cf2..09c2a609a483 100644 --- a/include/svx/gridctrl.hxx +++ b/include/svx/gridctrl.hxx @@ -161,6 +161,7 @@ enum class DbGridControlNavigationBarState class FmXGridSourcePropListener; class DisposeListenerGridBridge; +class DbGridControl; // NavigationBar class NavigationBar final : public InterimItemWindow @@ -195,21 +196,26 @@ class NavigationBar final : public InterimItemWindow std::shared_ptr m_xPrevRepeater; std::shared_ptr m_xNextRepeater; + Size m_aLastAllocSize; + sal_Int32 m_nCurrentPos; bool m_bPositioning; // protect PositionDataSource against recursion public: - NavigationBar(vcl::Window* pParent); + NavigationBar(DbGridControl* pParent); virtual ~NavigationBar() override; virtual void dispose() override; + DECL_LINK(SizeAllocHdl, const Size&, void); + // Status methods for Controls void InvalidateAll(sal_Int32 nCurrentPos, bool bAll = false); void InvalidateState(DbGridControlNavigationBarState nWhich) {SetState(nWhich);} void SetState(DbGridControlNavigationBarState nWhich); bool GetState(DbGridControlNavigationBarState nWhich) const; - sal_uInt16 ArrangeControls(); + void SetPointFontAndZoom(const vcl::Font& rFont, const Fraction& rZoom); + sal_uInt16 GetPreferredWidth() const; private: @@ -278,6 +284,8 @@ private: osl::Mutex m_aDestructionSafety; osl::Mutex m_aAdjustSafety; + Idle m_aRearrangeIdle; + css::util::Date m_aNullDate; // NullDate of the Numberformatter; @@ -552,6 +560,8 @@ public: css::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnId ) override; + void RearrangeAtIdle(); + protected: void RecalcRows(sal_Int32 nNewTopRow, sal_uInt16 nLinesOnScreen, bool bUpdateCursor); bool SeekCursor(sal_Int32 nRow, bool bAbsolute = false); @@ -588,6 +598,7 @@ protected: protected: void ImplInitWindow( const InitWindowFacet _eInitWhat ); DECL_DLLPRIVATE_LINK(OnDelete, void*, void); + DECL_DLLPRIVATE_LINK(RearrangeHdl, Timer*, void); DECL_DLLPRIVATE_LINK(OnAsyncAdjust, void*, void); // if the param is != NULL, AdjustRows will be called, else AdjustDataSource -- cgit