Skip to content

Commit

Permalink
Merge pull request #2808 from HelioGuilherme66/aui_improvements
Browse files Browse the repository at this point in the history
Add parameter to set the style of notebooks tabs
  • Loading branch information
HelioGuilherme66 authored Jun 18, 2024
2 parents dc4fb8a + 3a22b32 commit c5f9942
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni

=== Added

- Added configurable style of the tabs in notebook pages, Edit, Text, Run, etc. Parameter <b>notebook theme</b>
takes values from 0 to 5. See wxPython, demo for agw.aui for details.
- Added UI localization and support for Japanese configured test suites, valid for Robot Framework version 7.0.1 or higher.
- Added to Grid Editor, changing Zoom In/Out with ``Ctrl-Mouse Wheel`` and setting at Preferences.
- Added actions on columns of Grid Editor: Double-Click or Right Mouse Click, allows to edit the column name for Data
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Likewise, the current version of wxPython, is 4.2.1, but RIDE is known to work w

`pip install -U robotframework-ride`

(3.8 < python &lt;= 3.12) Install current development version (**2.1dev50**) with:
(3.8 < python &lt;= 3.12) Install current development version (**2.1dev51**) with:

`pip install -U https://github.com/robotframework/RIDE/archive/master.zip`

Expand Down
5 changes: 5 additions & 0 deletions src/robotide/application/CHANGELOG.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Changelog</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /></head><body><div xml:lang="en" class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id1337"></a>Changelog</h2></div></div><hr /></div><p>All notable changes to this project will be documented in this file.</p><p>The format is based on <a class="ulink" href="http://keepachangelog.com/en/1.0.0/" target="_top">Keep a Changelog</a>
and this project adheres to <a class="ulink" href="http://semver.org/spec/v2.0.0.html" target="_top">Semantic Versioning</a>.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_ulink_url_https_github_com_robotframework_ride_unreleased_ulink"></a>1. <a class="ulink" href="https://github.com/robotframework/RIDE" target="_top">Unreleased</a></h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_added"></a>1.1. Added</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Added configurable style of the tabs in notebook pages, Edit, Text, Run, etc. Parameter &lt;b&gt;notebook theme&lt;/b&gt;
takes values from 0 to 5. See wxPython, demo for agw.aui for details.
</li><li class="listitem">
Added UI localization and support for Japanese configured test suites, valid for Robot Framework version 7.0.1 or higher.
</li><li class="listitem">
Added to Grid Editor, changing Zoom In/Out with ``Ctrl-Mouse Wheel`` and setting at Preferences.
</li><li class="listitem">
Added actions on columns of Grid Editor: Double-Click or Right Mouse Click, allows to edit the column name for Data
Expand Down
4 changes: 3 additions & 1 deletion src/robotide/application/releasenotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ def set_content(self, html_win, content):
</ul>
<p><strong>New Features and Fixes Highlights</strong></p>
<ul class="simple">
<li>Added configurable style of the tabs in notebook pages, Edit, Text, Run, etc. Parameter <b>notebook theme</b>
takes values from 0 to 5. See wxPython, demo for agw.aui for details.</li>
<li>Added UI localization and support for Japanese configured test suites, valid for Robot Framework version 7.0.1 or higher.</li>
<li>Fixed keywords Find Usages in Grid Editor not finding certain values when using Gherkin.</li>
<li>Improved selection of items from Tree in Text Editor. Now finds more items and selects whole line.</li>
Expand Down Expand Up @@ -301,7 +303,7 @@ def set_content(self, html_win, content):
<pre class="literal-block">
python -m robotide.postinstall -install
</pre>
<p>RIDE {VERSION} was released on 16/June/2024.</p>
<p>RIDE {VERSION} was released on 18/June/2024.</p>
<!-- <br/>
<h3>May The Fourth Be With You!</h3>
<h3>Celebrate the bank holiday, 10th June, Day of Portugal, Portuguese Communities and Camões!!</h3>
Expand Down
5 changes: 3 additions & 2 deletions src/robotide/preferences/settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ tasks = False
reformat = False
# doc language: Test Suites will have sections and parameters in the selected language
# doc language: Possible values are the ones from Robot Framework >= 6.0.
doc language = None

doc language = None
# the style of the tabs in notebook pages, Edit, Text, Run. Values from 0 to 5.
notebook theme = 0

[General]
font size = 11
Expand Down
28 changes: 26 additions & 2 deletions src/robotide/ui/mainframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def __init__(self, application, controller):
self.reformat = application.settings.get('reformat', False)
self.tasks = application.settings.get('tasks', False)
self.doc_language = application.settings.get('doc language', '')
self._notebook_theme = application.settings.get('notebook theme', 0)
self.general_settings = application.settings['General'] # .get_without_default('General')
self.color_background_help = self.general_settings.get('background help', (240, 242, 80))
self.color_foreground_text = self.general_settings.get('foreground text', (7, 0, 70))
Expand Down Expand Up @@ -215,8 +216,9 @@ def _init_ui(self):
if new_ui: # Only when creating UI we add panes
self.aui_mgr.AddPane(wx.Panel(self), aui.AuiPaneInfo().Name("right_pane").Right())
# set up default notebook style
self._notebook_style = (aui.AUI_NB_DEFAULT_STYLE | aui.AUI_NB_WINDOWLIST_BUTTON |
self._notebook_style = (aui.AUI_NB_DEFAULT_STYLE | aui.AUI_NB_WINDOWLIST_BUTTON | aui.AUI_NB_TAB_FLOAT |
aui.AUI_NB_TAB_EXTERNAL_MOVE | aui.AUI_NB_SUB_NOTEBOOK | aui.AUI_NB_SMART_TABS)
self._notebook_style ^= aui.AUI_NB_TAB_FIXED_WIDTH
# DEBUG: self._notebook_theme = 0 (allow to select themes for notebooks)
# DEBUG:self.notebook = NoteBook(self.splitter, self._application, self._notebook_style)
self.notebook = NoteBook(self, self._application, self._notebook_style)
Expand Down Expand Up @@ -295,10 +297,32 @@ def _init_ui(self):
self._status_bar.SetForegroundColour(Colour(self.color_foreground))
# set main frame icon
self.SetIcons(self._image_provider.PROGICONS)
# tell the manager to "commit" all the changes just made
# change notebook theme
self.set_notebook_theme()
# tell the manager to "commit" all the changes just made
self.aui_mgr.Update()
# wx.CallLater(2000, RideSettingsChanged(keys=("General", ''), old='', new='').publish)

def set_notebook_theme(self):
if not self.notebook:
return
try:
self._notebook_theme = int(self._notebook_theme)
except ValueError:
self._notebook_theme = 0
if self._notebook_theme == 1:
self.notebook.SetArtProvider(aui.AuiSimpleTabArt())
elif self._notebook_theme == 2:
self.notebook.SetArtProvider(aui.VC71TabArt())
elif self._notebook_theme == 3:
self.notebook.SetArtProvider(aui.FF2TabArt())
elif self._notebook_theme == 4:
self.notebook.SetArtProvider(aui.VC8TabArt())
elif self._notebook_theme == 5:
self.notebook.SetArtProvider(aui.ChromeTabArt())
else:
self.notebook.SetArtProvider(aui.AuiDefaultTabArt())

def get_selected_datafile(self):
return self.tree.get_selected_datafile()

Expand Down
2 changes: 1 addition & 1 deletion src/robotide/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
#
# Automatically generated by `tasks.py`.

VERSION = 'v2.1dev50'
VERSION = 'v2.1dev51'

0 comments on commit c5f9942

Please sign in to comment.