diff options
author | Rafael Lima <rafael.palma.lima@gmail.com> | 2022-11-23 22:35:59 +0100 |
---|---|---|
committer | Rafael Lima <rafael.palma.lima@gmail.com> | 2022-12-01 12:33:45 +0100 |
commit | 0d9231f2133def9254e0220b8033a46e5fc17658 (patch) | |
tree | f03197ee729ea02db19f3408ae0bf902a475e4d2 /basctl/source/inc | |
parent | d45d65559f11ecb34b14e3b5c838391c62c8c694 (diff) |
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 <heiko.tietze@documentfoundation.org>
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'basctl/source/inc')
-rw-r--r-- | basctl/source/inc/basidesh.hxx | 13 |
1 files changed, 13 insertions, 0 deletions
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<LocalizationMgr> m_pCurLocalizationMgr; + // Current value of the zoom slider + sal_uInt16 nCurrentZoomSliderValue; VclPtr<ScrollAdaptor> aHScrollBar; VclPtr<ScrollAdaptor> aVScrollBar; VclPtr<TabBar> 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 ); |