summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorRafael Lima <rafael.palma.lima@gmail.com>2024-01-09 23:01:02 +0100
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2024-01-11 19:49:28 +0100
commitc0075bf84ecb64186f42c861985af43e120101f9 (patch)
tree75bc1f422f1ddc61f78141234940f2f176e32755 /basctl
parenta207d7ab26fe0324e1074ffb96d6385b3781b391 (diff)
tdf#155381 Remember the visibility of UI components in the Basic IDE
This patch remembers the visibility of the Object Catalog, Watched Expressions and Stack Window in the Basic IDE. Change-Id: I2fea038ffc56af45cd6570feeb14ab84307f8cef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161852 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/baside2.cxx10
-rw-r--r--basctl/source/basicide/basides1.cxx27
-rw-r--r--basctl/source/basicide/basidesh.cxx6
3 files changed, 38 insertions, 5 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 8eebbdb44e8d..a36cec6fe245 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -1458,6 +1458,16 @@ ModulWindowLayout::ModulWindowLayout (vcl::Window* pParent, ObjectCatalog& rObje
// Get active color scheme from the registry
m_sColorSchemeId = GetShell()->GetColorConfig()->GetCurrentColorSchemeName();
aSyntaxColors.ApplyColorScheme(m_sColorSchemeId, true);
+
+ // Initialize the visibility of the Stack Window
+ bool bStackVisible = ::officecfg::Office::BasicIDE::EditorSettings::StackWindow::get();
+ if (!bStackVisible)
+ aStackWindow->Show(bStackVisible);
+
+ // Initialize the visibility of the Watched Expressions window
+ bool bWatchVisible = ::officecfg::Office::BasicIDE::EditorSettings::WatchWindow::get();
+ if (!bWatchVisible)
+ aWatchWindow->Show(bWatchVisible);
}
ModulWindowLayout::~ModulWindowLayout()
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 507902a34d0a..8052845983f3 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -423,14 +423,21 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
break;
case SID_BASICIDE_OBJCAT:
- // toggling object catalog
- aObjectCatalog->Show(!aObjectCatalog->IsVisible());
+ {
+ // Toggle the visibility of the object catalog
+ bool bVisible = aObjectCatalog->IsVisible();
+ aObjectCatalog->Show(!bVisible);
if (pLayout)
pLayout->ArrangeWindows();
// refresh the button state
if (SfxBindings* pBindings = GetBindingsPtr())
pBindings->Invalidate(SID_BASICIDE_OBJCAT);
- break;
+
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+ officecfg::Office::BasicIDE::EditorSettings::ObjectCatalog::set(!bVisible, batch);
+ batch->commit();
+ }
+ break;
case SID_BASICIDE_WATCH:
{
@@ -438,9 +445,14 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
if (!dynamic_cast<ModulWindowLayout*>(pLayout.get()))
return;
- pModulLayout->ShowWatchWindow(!pModulLayout->IsWatchWindowVisible());
+ bool bVisible = pModulLayout->IsWatchWindowVisible();
+ pModulLayout->ShowWatchWindow(!bVisible);
if (SfxBindings* pBindings = GetBindingsPtr())
pBindings->Invalidate(SID_BASICIDE_WATCH);
+
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+ officecfg::Office::BasicIDE::EditorSettings::WatchWindow::set(!bVisible, batch);
+ batch->commit();
}
break;
@@ -450,9 +462,14 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
if (!dynamic_cast<ModulWindowLayout*>(pLayout.get()))
return;
- pModulLayout->ShowStackWindow(!pModulLayout->IsStackWindowVisible());
+ bool bVisible = pModulLayout->IsStackWindowVisible();
+ pModulLayout->ShowStackWindow(!bVisible);
if (SfxBindings* pBindings = GetBindingsPtr())
pBindings->Invalidate(SID_BASICIDE_STACK);
+
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+ officecfg::Office::BasicIDE::EditorSettings::StackWindow::set(!bVisible, batch);
+ batch->commit();
}
break;
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index e64e34e0ff59..420a51a2de8b 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -75,6 +75,7 @@
#include <vcl/svapp.hxx>
#include <cppuhelper/implbase.hxx>
#include <BasicColorConfig.hxx>
+#include <officecfg/Office/BasicIDE.hxx>
namespace basctl
{
@@ -211,6 +212,11 @@ void Shell::Init()
InitTabBar();
InitZoomLevel();
+ // Initialize the visibility of the Object Catalog
+ bool bObjCatVisible = ::officecfg::Office::BasicIDE::EditorSettings::ObjectCatalog::get();
+ if (!bObjCatVisible)
+ aObjectCatalog->Show(bObjCatVisible);
+
SetCurLib( ScriptDocument::getApplicationScriptDocument(), "Standard", false, false );
ShellCreated(this);