Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/core/utils/widgets/weather/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def __init__(self, *args: Any, **kwargs: Any):
self.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
self.setWidgetResizable(True)
self.setCursor(Qt.CursorShape.OpenHandCursor)
self.setAutoFillBackground(False)
self.setContentsMargins(0, 0, 0, 0)
self.setStyleSheet("QScrollArea{background: transparent;border: none;}")
self._drag_active = False
self._drag_start_pos = QPoint()
self._scroll_start_pos = QPoint()
Expand Down
12 changes: 10 additions & 2 deletions src/core/widgets/yasb/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,15 @@ def _popup_card(self):
hourly_temperature_widget.setProperty("class", "hourly-data")
hourly_temperature_scroll_area = HourlyTemperatureScrollArea()
hourly_temperature_scroll_area.setWidget(hourly_temperature_widget)
hourly_temperature_scroll_area.setProperty("class", "hourly-container")

# NOTE: # This is needed for Qt >=6.10.0 because QScrollArea
# refuses to play nicely with background color and border styles
hourly_container_wrapper = QFrame()
hourly_container_wrapper_layout = QHBoxLayout()
hourly_container_wrapper.setLayout(hourly_container_wrapper_layout)
hourly_container_wrapper_layout.addWidget(hourly_temperature_scroll_area)
hourly_container_wrapper_layout.setContentsMargins(0, 0, 0, 0)
hourly_container_wrapper.setProperty("class", "hourly-container")

@pyqtSlot(int)
def switch_hourly_data(day_idx: int):
Expand Down Expand Up @@ -275,7 +283,7 @@ def switch_hourly_data(day_idx: int):

# If we have no data just don't add the widget at all
if self._hourly_data_today and self._weather_card["show_hourly_forecast"]:
main_layout.addWidget(hourly_temperature_scroll_area)
main_layout.addWidget(hourly_container_wrapper)

self.dialog.setLayout(main_layout)

Expand Down