Skip to content

Commit

Permalink
Fix issue with Apply Voltage page slider for with aspect ratios less …
Browse files Browse the repository at this point in the history
…than 21:9

This was an issue where when the slider was dragged to the right-most extreme and the warning message appeared it caused a weird, rapidly changing size behavior for the slider
  • Loading branch information
Ahsoka committed Jul 9, 2021
1 parent 5efae92 commit 1c98a10
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion beskar/pages.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .utils import apply_voltage, interact_with_LEDs, LED_position_gen, TwoDQBarDataItem
from PyQt6 import QtCore, QtWidgets, QtCharts, QtGui, QtDataVisualization, QtTest
from .constants import offset
from fractions import Fraction
from typing import List

import statistics as stats
Expand Down Expand Up @@ -74,8 +75,14 @@ def __init__(self, parent):
self.desc_layout.addWidget(self.help_tab_desc)
self.desc_layout.addItem(spacer1)

screen_size = QtWidgets.QApplication.primaryScreen().size()
if Fraction(screen_size.height(), screen_size.width()) >= Fraction(64, 27):
spacer2_policy = QtWidgets.QSizePolicy.Policy.MinimumExpanding
else:
spacer2_policy = QtWidgets.QSizePolicy.Policy.Minimum

spacer2 = QtWidgets.QSpacerItem(
20, 0, QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Minimum
20, 0, spacer2_policy, QtWidgets.QSizePolicy.Policy.Minimum
)

self.layout = QtWidgets.QHBoxLayout()
Expand Down

0 comments on commit 1c98a10

Please sign in to comment.