From b455031d2bf87d54afbe2ff5d3a2cbb352d26fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio=20Guilherme?= Date: Sat, 7 Oct 2023 15:13:35 +0100 Subject: [PATCH] Allows to use Ctrl-Mouse Wheel to Zoom IN/out in Log windows (#2650) --- CHANGELOG.adoc | 1 + src/robotide/application/CHANGELOG.html | 11 ++++++----- src/robotide/application/releasenotes.py | 3 ++- src/robotide/log/logwindow.py | 20 ++++++++++++++++---- src/robotide/version.py | 2 +- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 945e0e524..c5a8900aa 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -29,6 +29,7 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni === Changed +- Improved **RIDE Log** and **Parser Log** windows to allow Zoom In/Out with ``Ctrl-Mouse Wheel`` - Hide continuation markers in Project Tree - Improved content assistance in Text Editor by allowing to filter list as we type - Improved file changes detection to only consider valid formats diff --git a/src/robotide/application/CHANGELOG.html b/src/robotide/application/CHANGELOG.html index 03b5e8fce..df139036d 100644 --- a/src/robotide/application/CHANGELOG.html +++ b/src/robotide/application/CHANGELOG.html @@ -11,9 +11,7 @@
  • Added support for JSON variables, by using the installed Robot Framework import method
  • 1.2. Fixed

      -
    • Hide continuation markers in Project Tree -
    • Improved content assistance in Text Editor by allowing to filter list as we type -
    • Fixed resource files dissapearing from Project tree on Windows +
    • Fixed resource files dissapearing from Project tree on Windows
    • Fixed missing indication of link for User Keyword, when pressing ``Ctrl`` in Grid Editor
    • @@ -28,8 +26,11 @@ Position of cursor in Text Editor auto-suggestions when line contains multibyte characters
    • Drag and drop of variables defined with comments between resource files -

    1.3. Changed

    • -Improved file changes detection to only consider valid formats +

    1.3. Changed

      +
    • Improved RIDE Log and Parser Log windows to allow Zoom In/Out with ``Ctrl-Mouse Wheel`` +
    • Hide continuation markers in Project Tree +
    • Improved content assistance in Text Editor by allowing to filter list as we type +
    • Improved file changes detection to only consider valid formats
    • Improved keyword ``Find Usages`` to return more matches. Fails to find mixed spaces and ``_``
    • diff --git a/src/robotide/application/releasenotes.py b/src/robotide/application/releasenotes.py index df43956ce..4c467fcc6 100644 --- a/src/robotide/application/releasenotes.py +++ b/src/robotide/application/releasenotes.py @@ -168,6 +168,7 @@ def set_content(self, html_win, content):

    New Features and Fixes Highlights

      +
    • Improved RIDE Log and Parser Log windows to allow Zoom In/Out with Ctrl-Mouse Wheel
    • Hide continuation markers in Project Tree
    • Improved content assistance in Text Editor by allowing to filter list as we type
    • Fixed resource files dissapearing from Project tree on Windows
    • @@ -241,6 +242,6 @@ def set_content(self, html_win, content):
       python -m robotide.postinstall -install
       
      -

      RIDE {VERSION} was released on 6/Oct/2023.

      +

      RIDE {VERSION} was released on 7/Oct/2023.

    """ diff --git a/src/robotide/log/logwindow.py b/src/robotide/log/logwindow.py index 86654d509..b34f28608 100644 --- a/src/robotide/log/logwindow.py +++ b/src/robotide/log/logwindow.py @@ -18,6 +18,7 @@ from .. import widgets from ..widgets import RIDEDialog +from wx.stc import StyledTextCtrl def message_to_string(msg, parserlog=False): @@ -32,9 +33,13 @@ def __init__(self, notebook, title, log): self.dlg = RIDEDialog() self.title = title self._removetabs = self.title == 'Parser Log' - self._output = wx.TextCtrl(self, style=wx.TE_READONLY | wx.TE_MULTILINE | wx.TE_NOHIDESEL) - self._output.SetBackgroundColour(Colour(self.dlg.color_background)) - self._output.SetForegroundColour(Colour(self.dlg.color_foreground)) + self._output = StyledTextCtrl(self, wx.ID_ANY, style=wx.TE_READONLY | wx.TE_MULTILINE | wx.TE_NOHIDESEL) + fore = self.dlg.color_foreground + backg = self.dlg.color_background + self._output.SetBackgroundColour(Colour(backg)) + self._output.SetForegroundColour(Colour(fore)) + self._output.StyleSetSpec(wx.stc.STC_STYLE_DEFAULT, f"fore:{fore}, back:{backg}") + self._output.StyleSetBackground(wx.stc.STC_STYLE_DEFAULT, backg) self._output.Bind(wx.EVT_KEY_DOWN, self.on_key_down) self._log = log self._add_to_notebook(notebook) @@ -51,10 +56,17 @@ def _add_to_notebook(self, notebook): self._output.SetSize(self.Size) def close(self, notebook): + self._output.Close() notebook.delete_tab(self) def update_log(self): - self._output.SetValue(self._decode_log(self._log)) + content = self._decode_log(self._log) + text_size = len(content) + self._output.SetReadOnly(False) + self._output.SetText(content) + self._output.SetStyling(text_size, wx.stc.STC_STYLE_DEFAULT) + self._output.SetReadOnly(True) + self._output.Refresh() def _decode_log(self, log): result = '' diff --git a/src/robotide/version.py b/src/robotide/version.py index d932c29b5..3aa8ad401 100644 --- a/src/robotide/version.py +++ b/src/robotide/version.py @@ -14,4 +14,4 @@ # limitations under the License. # # Automatically generated by `tasks.py`. -VERSION = 'v2.0.8dev17' +VERSION = 'v2.0.8dev18'