From 799a3a7915e6285c8072f92c63ba7149223ac443 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Fri, 14 Oct 2016 19:13:05 +0900 Subject: tdf#103209 Apply application color settings to Basic IDE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes the text and background colors in the editor window follow the custom colors "Font color" and "Document background" respectively in Options > LibreOffice > Applications Colors. ... for those who think BASIC looks cooler when written in green text on black background. Change-Id: I82647865f7c2915341249c2fd5ebc9bd8d617bd1 Reviewed-on: https://gerrit.libreoffice.org/29815 Tested-by: Jenkins Reviewed-by: jan iversen Tested-by: jan iversen Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- basctl/source/basicide/baside2.hxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'basctl/source/basicide/baside2.hxx') diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx index 9a5156072e1e..6770ffbdf9a2 100644 --- a/basctl/source/basicide/baside2.hxx +++ b/basctl/source/basicide/baside2.hxx @@ -94,8 +94,6 @@ private: class ProgressInfo; std::unique_ptr pProgress; - virtual void DataChanged(DataChangedEvent const & rDCEvt) override; - using Window::Notify; virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; @@ -156,6 +154,7 @@ public: bool CanModify() { return ImpCanModify(); } + void ChangeFontColor( Color aColor ); void UpdateSyntaxHighlighting (); bool GetProcedureName(OUString& rLine, OUString& rProcType, OUString& rProcName) const; @@ -428,6 +427,8 @@ public: public: void BasicAddWatch (OUString const&); void BasicRemoveWatch (); + Color GetBackgroundColor () const { return aSyntaxColors.GetBackgroundColor(); } + Color GetFontColor () const { return aSyntaxColors.GetFontColor(); } Color GetSyntaxColor (TokenType eType) const { return aSyntaxColors.GetColor(eType); } protected: @@ -443,9 +444,7 @@ private: VclPtr aWatchWindow; VclPtr aStackWindow; ObjectCatalog& rObjectCatalog; -private: - virtual void DataChanged (DataChangedEvent const& rDCEvt) override; -private: + // SyntaxColors -- stores Basic syntax highlighting colors class SyntaxColors : public utl::ConfigurationListener { @@ -454,8 +453,9 @@ private: virtual ~SyntaxColors () override; public: void SetActiveEditor (EditorWindow* pEditor_) { pEditor = pEditor_; } - void SettingsChanged (); public: + Color GetBackgroundColor () const { return m_aBackgroundColor; }; + Color GetFontColor () const { return m_aFontColor; } Color GetColor (TokenType eType) const { return aColors[eType]; } private: @@ -463,6 +463,8 @@ private: void NewConfig (bool bFirst); private: + Color m_aBackgroundColor; + Color m_aFontColor; // the color values (the indexes are TokenType, see comphelper/syntaxhighlight.hxx) o3tl::enumarray aColors; // the configuration -- cgit