core.git: basctl/source officecfg/registry
basctl/source/basicide/BasicColorConfig.cxx | 31 -- basctl/source/basicide/baside2.cxx |1 basctl/source/basicide/baside2.hxx |7 + basctl/source/basicide/baside2b.cxx | 51 +++ basctl/source/basicide/linenumberwindow.cxx | 26 + basctl/source/basicide/linenumberwindow.hxx |1 basctl/source/inc/colorscheme.hxx|1 officecfg/registry/data/org/openoffice/Office/BasicIDE.xcu | 30 ++ officecfg/registry/schema/org/openoffice/Office/BasicIDE.xcs | 10 ++ 9 files changed, 149 insertions(+), 9 deletions(-) New commits: commit bf410be4502c2d78e38856c455833681c6b8a151 Author: Rafael Lima AuthorDate: Wed Jan 10 20:34:55 2024 +0100 Commit: Andreas Heinisch CommitDate: Thu Jan 11 19:56:08 2024 +0100 tdf#158750 Highlight the line where the cursor is positioned (Basic IDE) This patch implements support for highlighting the selected line in the code editor, similar to what Kate, VSCode, etc do. If the cursor is positioned in a single line and nothing is selected, then a highlight color is applied to the line. The line number window also highlights the selected line. Change-Id: I2047d79500cd783b122b6752bb00996de0a7c702 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161861 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/basctl/source/basicide/BasicColorConfig.cxx b/basctl/source/basicide/BasicColorConfig.cxx index 21ff95bc0f8e..ab17b164934b 100644 --- a/basctl/source/basicide/BasicColorConfig.cxx +++ b/basctl/source/basicide/BasicColorConfig.cxx @@ -49,13 +49,16 @@ ColorScheme BasicColorConfig::GetColorScheme(const OUString& rScheme) return GetAutomaticColorScheme(); } -std::vector aVecPropNames = { -OUString(rScheme + "/GenericColor/Color"), OUString(rScheme + "/IdentifierColor/Color"), -OUString(rScheme + "/NumberColor/Color"),OUString(rScheme + "/StringColor/Color"), -OUString(rScheme + "/CommentColor/Color"), OUString(rScheme + "/ErrorColor/Color"), -OUString(rScheme + "/OperatorColor/Color"), OUString(rScheme + "/KeywordColor/Color"), -OUString(rScheme + "/BackgroundColor/Color") -}; +std::vector aVecPropNames = { OUString(rScheme + "/GenericColor/Color"), +OUString(rScheme + "/IdentifierColor/Color"), +OUString(rScheme + "/NumberColor/Color"), +OUString(rScheme + "/StringColor/Color"), +OUString(rScheme + "/CommentColor/Color"), +OUString(rScheme + "/ErrorColor/Color"), +OUString(rScheme + "/OperatorColor/Color"), +OUString(rScheme + "/KeywordColor/Color"), +OUString(rScheme + "/BackgroundColor/Color"), +OUString(rScheme + "/LineHighlightColor/Color") }; css::uno::Sequence aPropNames(aVecPropNames.size()); OUString* pPropNames = aPropNames.getArray(); @@ -77,12 +80,22 @@ ColorScheme BasicColorConfig::GetColorScheme(const OUString& rScheme) aColors[6] >>= aColorScheme.m_aOperatorColor; aColors[7] >>= aColorScheme.m_aKeywordColor; aColors[8] >>= aColorScheme.m_aBackgroundColor; +aColors[9] >>= aColorScheme.m_aLineHighlightColor; return aColorScheme; } ColorScheme BasicColorConfig::GetAutomaticColorScheme() { +// Application Colors do not define a line highlight color, so here we adjust +// the background color to get a highlight color +Color aBackgroundColor = aColorConfig.GetColorValue(svtools::BASICEDITOR).nColor; +Color aHighlightColor(aBackgroundColor); +if (aBackgroundColor.IsDark()) +aHighlightColor.ApplyTintOrShade(1000); +else +aHighlightColor.ApplyTintOrShade(-1000); + ColorScheme aScheme = { DEFAULT_SCHEME, false, aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor, @@ -93,7 +106,9 @@ ColorScheme BasicColorConfig::GetAutomaticColorScheme() aColorConfig.GetColorValue(svtools::BASICERROR).nColor, aColorConfig.GetColorValue(svtools::BASICOPERATOR).nColor, aColorConfig.GetColorValue(svtools::BASICKEYWORD).nColor, - aColorConfig.GetColorValue(svtools::BASICEDITOR).nColor }; +aBackgroundColor, +aHighlightColor }; + return aScheme; } diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index
core.git: basctl/source officecfg/registry
basctl/source/basicide/baside2.cxx | 10 basctl/source/basicide/basides1.cxx | 27 --- basctl/source/basicide/basidesh.cxx |6 ++ officecfg/registry/schema/org/openoffice/Office/BasicIDE.xcs | 18 +++ 4 files changed, 56 insertions(+), 5 deletions(-) New commits: commit c0075bf84ecb64186f42c861985af43e120101f9 Author: Rafael Lima AuthorDate: Tue Jan 9 23:01:02 2024 +0100 Commit: Andreas Heinisch CommitDate: Thu Jan 11 19:49:28 2024 +0100 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 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 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(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 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(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 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 #include #include +#include namespace basctl { @@ -211,6 +212,11 @@ void Shell::Init() InitTabBar(); InitZoomLevel(); +// Initialize the visibility of the Object Catalog +bool bObjCatVisible =
[Libreoffice-commits] core.git: basctl/source officecfg/registry
basctl/source/basicide/baside2.cxx | 23 ++- officecfg/registry/schema/org/openoffice/Office/BasicIDE.xcs | 11 + 2 files changed, 24 insertions(+), 10 deletions(-) New commits: commit 3bdd04cd54a42a98f7f679e749f3da0f164ac18f Author: tageziDate: Wed May 24 23:56:57 2017 +0300 tdf#91913 Saving line numbering into setting It saves setting of the line numbering for next start Now the line numbering is enabled by default Change-Id: Ib658d417882996eb843fed9b236496fe2fb42166 Reviewed-on: https://gerrit.libreoffice.org/38013 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index fb9f3d11939f..f0070aa5fe01 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -23,6 +23,7 @@ #include "iderdll.hxx" #include "moduldlg.hxx" #include "docsignature.hxx" +#include "officecfg/Office/BasicIDE.hxx" #include "helpid.hrc" #include @@ -172,10 +173,6 @@ void lcl_ConvertTabsToSpaces( OUString& rLine ) } } -// until we have some configuration lets just keep -// persist this value for the process lifetime -bool bSourceLinesEnabled = false; - } // namespace ModulWindow::ModulWindow (ModulWindowLayout* pParent, ScriptDocument const& rDocument, @@ -985,8 +982,12 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq) case SID_SHOWLINES: { const SfxBoolItem* pItem = rReq.GetArg(rReq.GetSlot()); -bSourceLinesEnabled = pItem && pItem->GetValue(); -m_aXEditorWindow->SetLineNumberDisplay(bSourceLinesEnabled); +bool bLineNumbers = pItem && pItem->GetValue(); +m_aXEditorWindow->SetLineNumberDisplay(bLineNumbers); + +std::shared_ptr batch(comphelper::ConfigurationChanges::create()); + officecfg::Office::BasicIDE::EditorSettings::LineNumbering::set(bLineNumbers, batch); +batch->commit(); } break; case SID_BASICIDE_DELETECURRENT: @@ -1121,7 +1122,8 @@ void ModulWindow::GetState( SfxItemSet ) break; case SID_SHOWLINES: { -rSet.Put(SfxBoolItem(nWh, bSourceLinesEnabled)); +bool bLineNumbers = ::officecfg::Office::BasicIDE::EditorSettings::LineNumbering::get(); +rSet.Put(SfxBoolItem(nWh, bLineNumbers)); break; } case SID_SELECTALL: @@ -1188,7 +1190,8 @@ void ModulWindow::AssertValidEditEngine() void ModulWindow::Activating () { -m_aXEditorWindow->SetLineNumberDisplay(bSourceLinesEnabled); +bool bLineNumbers = ::officecfg::Office::BasicIDE::EditorSettings::LineNumbering::get(); +m_aXEditorWindow->SetLineNumberDisplay(bLineNumbers); Show(); } @@ -1370,7 +1373,8 @@ bool ModulWindow::IsPasteAllowed() void ModulWindow::OnNewDocument () { -m_aXEditorWindow->SetLineNumberDisplay(bSourceLinesEnabled); +bool bLineNumbers = ::officecfg::Office::BasicIDE::EditorSettings::LineNumbering::get(); +m_aXEditorWindow->SetLineNumberDisplay(bLineNumbers); } char const* ModulWindow::GetHid () const @@ -1566,7 +1570,6 @@ void ModulWindowLayout::SyntaxColors::NewConfig (bool bFirst) pEditor->UpdateSyntaxHighlighting(); } - } // namespace basctl /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/officecfg/registry/schema/org/openoffice/Office/BasicIDE.xcs b/officecfg/registry/schema/org/openoffice/Office/BasicIDE.xcs index 9bf9b3dfd238..94f108c179bf 100644 --- a/officecfg/registry/schema/org/openoffice/Office/BasicIDE.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/BasicIDE.xcs @@ -63,5 +63,16 @@ false + + +Contains user configuration. + + + +Sets the line numbering on/off. Default is true. + +true + + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits