# Change the left control panel size

**URL:** <https://discourse.slicer.org/t/change-the-left-control-panel-size/18072>\
**Category:** Development\
**Created:** [June 11, 2021, 4:38am UTC](https://discourse.slicer.org/t/change-the-left-control-panel-size/18072 "2021-06-11T04:38:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![full\_stack\_master](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/full_stack_master/32/9693_2.png) [@full\_stack\_master](https://discourse.slicer.org/u/full_stack_master)\
**Post date:** [June 11, 2021, 4:38am UTC](https://discourse.slicer.org/t/change-the-left-control-panel-size/18072/1 "2021-06-11T04:38:10Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/e/1e8284c5c0597c9867a5bbec1d7106cd6b5ac35a.png)  
I want to reduce the left control panel size in code  
can you help me

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 11, 2021, 8:42pm UTC](https://discourse.slicer.org/t/change-the-left-control-panel-size/18072/2 "2021-06-11T20:42:35Z")

</div>

The module panel is sized automatically based on constraints defined by the widgets that are displayed in it. You can set a maximum width for the module panel (see below), but it will break the layout (widgets will “stick out” from it) if you reduce it beyond the feasible size.

```python
mainWindow = slicer.util.mainWindow()
modulePanelDockWidget = mainWindow.findChildren('QDockWidget','PanelDockWidget')[0]
modulePanelDockWidget.setMaximumWidth(500)

```

If you want to make the module panel more compressible without breaking layouts, you can change the font size or screen scaling. See more information here:

> [@4.11 Module panel is too wide and won't resize](https://discourse.slicer.org/t/4-11-module-panel-is-too-wide-and-wont-resize/11394/6):
>
> You can scale the text/button sizes of Slicer many ways: Reduce font size in Slicer in menu: Edit / Application settings / Appearance / Font and size Reduce the font scaling by running set QT\_SCALE\_FACTOR=0.5 in the command console and then starting Slicer in that console (you can make this permanent by adding this to your environment variables or creating a .bat file that sets this and then starts Slicer) You can adjust text scaling settings on your computer Drag-and-drop the module panel to …

---

<div class="post-metadata">

**Author:** ![johny723](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@johny723](https://discourse.slicer.org/u/johny723)\
**Post date:** [May 9, 2026, 12:53pm UTC](https://discourse.slicer.org/t/change-the-left-control-panel-size/18072/3 "2026-05-09T12:53:50Z")

</div>

Hi, how do I change the size of the left panel? Icons for modules on the left are rather small. Thank you.

 ![Snímka obrazovky 2026-05-09 144651](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/8/b858774361d36da0166bab9b899fba135d6d8be0.png)
