Skip to content

Commit 2ca5832

Browse files
committed
Fix aspect ratio slider: invert direction, allow shorter views
1 parent 82fd4ac commit 2ca5832

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/e3sm_quickview/components/toolbars.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ def __init__(self, apply_size=None):
4747
v3.VSpacer()
4848

4949
v3.VSlider(
50-
v_model=("aspect_ratio", 2),
51-
prepend_icon="mdi-arrow-expand-horizontal",
52-
min=1,
50+
v_model=("aspect_ratio", 0.5),
51+
prepend_icon="mdi-arrow-expand-vertical",
52+
min=0.25,
5353
max=2,
54-
step=0.1,
54+
step=0.05,
5555
density="compact",
5656
hide_details=True,
5757
style="max-width: 400px;",

src/e3sm_quickview/view_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ def _build_ui(self):
956956
style=(
957957
"""
958958
{
959-
aspectRatio: active_layout === 'auto_layout' ? aspect_ratio : null,
959+
aspectRatio: active_layout === 'auto_layout' ? (1.0 / aspect_ratio) : null,
960960
height: active_layout !== 'auto_layout' ? 'calc(100% - 2.4rem)' : null,
961961
pointerEvents: lock_views ? 'none': null,
962962
}

src/e3sm_quickview/view_manager2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ def _build_ui(self):
955955
style=(
956956
"""
957957
{
958-
aspectRatio: active_layout === 'auto_layout' ? aspect_ratio : null,
958+
aspectRatio: active_layout === 'auto_layout' ? (1.0 / aspect_ratio) : null,
959959
height: active_layout !== 'auto_layout' ? 'calc(100% - 2.4rem)' : null,
960960
pointerEvents: lock_views ? 'none': null,
961961
}

0 commit comments

Comments
 (0)