Repository: lutris/lutris

Issue:
Zoom adjustment slider not updated with view type
### Bug description

Lutris maintains two zoom settings- one for the list view type, and one for the grid view type. They are independent.

When you switch between these modes, the actual game view updates appropriately, but the zoom slider does not, so it contains a stale setting. This can interfere with changing the zoom.

### How to Reproduce

First, we must configure Lutris so that the two view modes disagree about the zoom. So start Lutris and switch to grid view; set it to  shows banners. Switch to list view, and set that to show icons. Now the disagree.

The zoom slider is still in the 'icon' (left) position. Switch to grid view; the grid displays *with banners*. But open the view menu; the slider is still the in 'icon' (left) position.

### Expected behavior

The slider should update to reflect the state of the view.

### Log output

```shell
INFO     2022-01-30 11:05:03,893 [startup.check_driver:53]:Using NVIDIA drivers 470.86 for x86_64
INFO     2022-01-30 11:05:03,893 [startup.check_driver:57]:GPU: NVIDIA GeForce RTX 3060
INFO     2022-01-30 11:05:03,893 [startup.check_driver:73]:GPU: 10DE:2503 196E:1377 (nvidia drivers)
DEBUG    2022-01-30 11:05:04,065 [lutriswindow.update_store:451]:Showing 32 games
DEBUG    2022-01-30 11:05:07,182 [lutriswindow.on_toggle_viewtype:716]:View type changed to list
DEBUG    2022-01-30 11:05:07,195 [lutriswindow.update_store:451]:Showing 32 games
DEBUG    2022-01-30 11:05:09,299 [lutriswindow.on_toggle_viewtype:716]:View type changed to grid
DEBUG    2022-01-30 11:05:09,303 [lutriswindow.update_store:451]:Showing 32 games
DEBUG    2022-01-30 11:05:16,404 [application.show_window:259]:Showing window <class 'lutris.gui.config.preferences_dialog.PreferencesDialog'>{}
DEBUG    2022-01-30 11:05:21,950 [application.on_app_window_destroyed:276]:Removed window <class 'lutris.gui.config.preferences_dialog.PreferencesDialog'>{}
INFO     2022-01-30 11:07:05,172 [application.do_shutdown:631]:Shutting down Lutris
```


### System Information

```shell
[System]
OS:              Pop!_OS 21.10 impish
Arch:            x86_64
Kernel:          5.15.15-76051515-generic
Desktop:         GNOME
Display Server:  x11

[CPU]
Vendor:          AuthenticAMD
Model:           AMD Ryzen 7 5800X 8-Core Processor
Physical cores:  8
Logical cores:   16

[Memory]
RAM:             31.4 GB
Swap:            0.0 GB

[Graphics]
Vendor:          NVIDIA Corporation
OpenGL Renderer: NVIDIA GeForce RTX 3060/PCIe/SSE2
OpenGL Version:  4.6.0 NVIDIA 470.86
OpenGL Core:     4.6.0 NVIDIA 470.86
OpenGL ES:       OpenGL ES 3.2 NVIDIA 470.86
Vulkan:          Supported
```


### Media (optional)

![Screenshot from 2022-01-30 11-11-44](https://user-images.githubusercontent.com/6507403/151707538-e80c65ab-1588-4aef-b101-15fbbb09f797.png)


### Checklist:

- [X] I'm not asking for support with a game or the wine runner.
- [X] I have followed the above mentioned guides and have all the graphics and wine dependencies installed.
- [X] I have checked for existing issues that describe my problem prior to opening this one.
- [X] I understand that improperly formatted bug reports may be closed without explanation.


Discussion:

Resolving patch:
diff --git a/lutris/gui/lutriswindow.py b/lutris/gui/lutriswindow.py
--- a/lutris/gui/lutriswindow.py
+++ b/lutris/gui/lutriswindow.py
@@ -744,6 +744,7 @@ def on_toggle_viewtype(self, *args):
         self.set_viewtype_icon(view_type)
         settings.write_setting("view_type", view_type)
         self.redraw_view()
+        self._bind_zoom_adjustment()
 
     def on_icontype_state_change(self, action, value):
         action.set_state(value)


Test patch: