question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pane toolbar buttons are not sized properly

See original GitHub issue

Problem Description

The icon size is scaled as expected, but not the tool buttons size. We thus end up with “big” tool buttons with small icons. Enabling or disabling auto high dpi scaling does not change anything.

image

Paste Traceback/Error Below (if applicable)

I suspect that this due to the fact that we are setting the icon size for the panes with Qt, but are setting a fixed size for the toolbuttons in the stylesheet.

In MainWidgetToolbar.set_icon_size, we are using the QToolbar.setIconSize method to set the icon size of the toolbars. This effectively scale the icons as expected.

https://github.com/spyder-ide/spyder/blob/0bebf0f181af88c26a057268f604268619fc7294/spyder/api/widgets/toolbars.py#L185-L187

However, the size of the buttons remains unchanged because it is fixed in the stylesheet.

https://github.com/spyder-ide/spyder/blob/0bebf0f181af88c26a057268f604268619fc7294/spyder/utils/stylesheet.py#L231-L235

Versions

  • Spyder version: 5.1.0.dev0 5648cfa74
  • Python version: 3.7.6 64-bit
  • Qt version: 5.12.5
  • PyQt5 version: 5.12.3
  • Operating System: Windows 10

Dependencies

Mandatory:

atomicwrites >=1.2.0 : 1.4.0 (OK) chardet >=2.0.0 : 3.0.4 (OK) cloudpickle >=0.5.0 : 1.5.0 (OK) cookiecutter >=1.6.0 : 1.7.2 (OK) diff_match_patch >=20181111 : 20200713 (OK) intervaltree >=3.0.2 : 3.0.2 (OK) IPython >=7.6.0 : 7.16.1 (OK) jedi =0.17.2 : 0.17.2 (OK) jsonschema >=3.2.0 : 3.2.0 (OK) keyring >=17.0.0 : 21.2.1 (OK) nbconvert >=4.0 : 5.6.1 (OK) numpydoc >=0.6.0 : 1.1.0 (OK) paramiko >=2.4.0 : 2.7.1 (OK) parso =0.7.0 : 0.7.0 (OK) pexpect >=4.4.0 : 4.8.0 (OK) pickleshare >=0.4 : 0.7.5 (OK) psutil >=5.3 : 5.7.2 (OK) pygments >=2.0 : 2.6.1 (OK) pylint >=1.0 : 2.5.3 (OK) pyls >=0.36.2;<1.0.0 : v5.0.0+75.g5648cfa74 (OK) pyls_black >=0.4.6 : 0.4.6 (OK) pyls_spyder >=0.3.2 : 0.3.2 (OK) qdarkstyle =3.0.2 : 3.0.dev (OK) qstylizer >=0.1.10 : 0.1.10 (OK) qtawesome >=1.0.2 : 1.1.0.dev0 (OK) qtconsole >=5.0.3 : 5.0.3 (OK) qtpy >=1.5.0 : 1.9.0 (OK) rtree >=0.8.3 : 0.9.4 (OK) setuptools >=39.0.0 : 49.6.0.post20210108 (OK) sphinx >=0.6.6 : 3.1.2 (OK) spyder_kernels >=2.0.1;<2.1.0 : 2.1.0.dev0 (OK) textdistance >=4.2.0 : 4.2.0 (OK) three_merge >=0.1.1 : 0.1.1 (OK) watchdog >=0.10.3;<2.0.0 : 0.10.3 (OK) zmq >=17 : 19.0.1 (OK)

Optional:

cython >=0.21 : 0.29.21 (OK) matplotlib >=2.0.0 : 3.2.1 (OK) numpy >=1.7 : 1.20.2 (OK) pandas >=1.1.1 : 1.1.4 (OK) scipy >=0.17.0 : 1.5.3 (OK) sympy >=0.7.3 : None (NOK)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
jnsebgosselincommented, Apr 15, 2021

You clearly put a lot of work and thoughts into this, this is really impressive.

I am willing to help adding a new option in the preferences that would allow users to make the toolbar of the panes more compact.

I used the “Find” and “Outline” panes to illustrate what I would like this option to do. What do you think?

image

1reaction
dalthvizcommented, Apr 14, 2021

Hi @jnsebgosselin thanks for the feedback! Pinging @ccordoba12 @juanis2112 @steff456 just in case

Read more comments on GitHub >

github_iconTop Results From Across the Web

Office Ribbon Too Big -- not a display resolution issue
All Office application display the menus, ribbons, sidebars as way too large. It is not an issue where going to Settings->Display->Scale ...
Read more >
ToolBar is not in correct size after adding buttons in JavaFX
I am adding 5 buttons on ToolBar. ToolBar's color is lightcyan, this is because I just wanted to highlight so to see the...
Read more >
responsive panel toggle button does not behave properly ...
If the TOGGLE button is not in a toolbar, it is hidden in option 1 and you need to move the splitter between...
Read more >
Toolbar or windows layout not working - Knowledge Base
Right click on the "broken" toolbar, select "customize", press the "Restore Default Set" button, and press the Done button. If you are using...
Read more >
Changing the Toolbar Button Size in Home Designer
Select Edit> Preferences if you're on a Windows computer, or Home Designer> Preferences if you're on a Mac. · On the Appearance panel,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found