Skip to content

Commit

Permalink
Switcher: Make all text in items have the interface font size
Browse files Browse the repository at this point in the history
Also, show the item's description in italics to distinguish it from its
title.
  • Loading branch information
ccordoba12 committed Jul 8, 2024
1 parent f348359 commit 85cc5ba
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions spyder/plugins/switcher/widgets/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,21 @@ class SwitcherItem(SwitcherBaseItem):
<td valign="middle">
<span style="color:{title_color};font-size:{title_font_size}pt">
{title}
</span>&nbsp;
<small
style="color:{description_color};font-size:{description_font_size}pt">
<span>{description}</span>
</small>
</span>
&nbsp;&nbsp;
<em>
<span
style="color:{description_color};font-size:{description_font_size}pt">
<span>{description}</span>
</span>
</em>
</td>
<td valign="middle" align="right" float="right">
<span style="color:{shortcut_color};font-size:{shortcut_font_size}pt">
<small><code><i>{shortcut}</i></code></small>
<code><i>{shortcut}</i></code>
</span>&nbsp;
<span style="color:{section_color};font-size:{section_font_size}pt">
<small>{section}</small>
{section}
</span>
</td>
</tr>
Expand Down Expand Up @@ -274,24 +277,6 @@ def _set_styles(self):
if attr not in self._styles:
self._styles[attr] = self._STYLES[attr]

rich_font = self._styles['title_font_size']

if sys.platform == 'darwin':
title_font_size = rich_font
description_font_size = title_font_size + 2
elif os.name == 'nt':
title_font_size = rich_font
description_font_size = title_font_size + 1
elif is_ubuntu():
title_font_size = rich_font - 2
description_font_size = title_font_size + 1
else:
title_font_size = rich_font - 2
description_font_size = title_font_size + 1

self._styles['description_font_size'] = description_font_size
self._styles['section_font_size'] = description_font_size

def _get_height(self):
"""
Return the expected height of this item's text, including
Expand Down

0 comments on commit 85cc5ba

Please sign in to comment.