From 0d9231f2133def9254e0220b8033a46e5fc17658 Mon Sep 17 00:00:00 2001 From: Rafael Lima Date: Wed, 23 Nov 2022 22:35:59 +0100 Subject: tdf#152078 Add a Zoom slider to the Basic IDE This patch adds a ZoomSlider to thee Basic IDE. It has the following characteristics: - The Zoom varies from 50% to 400% considering that 100% is the font size defined in Tools - Options - Fonts dialog. - All open editor windows use the same Zoom factor - The zoom level is saved and restored across sessions Change-Id: I63df02d0dc828fca4360d61b8aa2c7af6610d4db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143159 Tested-by: Jenkins Tested-by: Heiko Tietze Reviewed-by: Heiko Tietze --- basctl/source/inc/basidesh.hxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'basctl/source/inc') diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx index 3df158ed01e5..89e22c1cfd93 100644 --- a/basctl/source/inc/basidesh.hxx +++ b/basctl/source/inc/basidesh.hxx @@ -40,6 +40,12 @@ class StarBASIC; namespace basctl { + +// Used to control zoom level +constexpr sal_uInt16 MIN_ZOOM_LEVEL = 50; +constexpr sal_uInt16 DEFAULT_ZOOM_LEVEL = 100; +constexpr sal_uInt16 MAX_ZOOM_LEVEL = 400; + class Layout; class ModulWindow; class ModulWindowLayout; @@ -68,6 +74,8 @@ private: OUString m_aCurLibName; std::shared_ptr m_pCurLocalizationMgr; + // Current value of the zoom slider + sal_uInt16 nCurrentZoomSliderValue; VclPtr aHScrollBar; VclPtr aVScrollBar; VclPtr pTabBar; // basctl::TabBar @@ -92,6 +100,7 @@ private: void Init(); void InitTabBar(); void InitScrollBars(); + void InitZoomLevel(); void CheckWindows(); void RemoveWindows( const ScriptDocument& rDocument, std::u16string_view rLibName ); void UpdateWindows(); @@ -163,6 +172,10 @@ public: SfxUndoManager* GetUndoManager() override; + sal_uInt16 GetCurrentZoomSliderValue() { return nCurrentZoomSliderValue; } + static sal_uInt16 GetMinZoom() { return MIN_ZOOM_LEVEL; } + static sal_uInt16 GetMaxZoom() { return MAX_ZOOM_LEVEL; } + virtual css::uno::Reference< css::view::XRenderable > GetRenderable() override; // virtual sal_uInt16 Print( SfxProgress &rProgress, sal_Bool bIsAPI, PrintDialog *pPrintDialog = 0 ); -- cgit