Skip to content

Commit

Permalink
Hide updated, move license label in compact mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 14, 2023
1 parent 5691bd8 commit 1b38942
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions koordinates/gui/dataset_browser_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def setGeometry(self, rect):
if self.details_container:
self.details_container.setGeometry(
QRect(
9999, 80,
left, 35,
105,
61
)
Expand Down Expand Up @@ -606,6 +606,10 @@ def __init__(self,

self._update_title()

self.labelUpdatedIcon = QSvgWidget(GuiUtils.get_icon_svg("history_gray.svg"))
self.labelUpdatedIcon.setFixedSize(13, 12)
self.labelUpdated = QLabel()

license = self.dataset.details.get('license')
self.license_label = None
if license:
Expand All @@ -619,10 +623,6 @@ def __init__(self,
font-size: {detail_font_size}pt">{license_type}</span>"""
)

self.labelUpdatedIcon = QSvgWidget(GuiUtils.get_icon_svg("history_gray.svg"))
self.labelUpdatedIcon.setFixedSize(13, 12)
self.labelUpdated = QLabel()

changed_date = self.dataset.updated_at_date()
if changed_date is not None:
self.labelUpdated.setText(
Expand Down Expand Up @@ -718,6 +718,13 @@ def _update_title(self):

def _update_arrangement(self):
self._update_title()
arrangement = self.dataset_layout.arrangement()
if arrangement in (CardLayout.Tall, CardLayout.Wide):
self.labelUpdated.show()
self.labelUpdatedIcon.show()
else:
self.labelUpdated.hide()
self.labelUpdatedIcon.hide()

def set_column_count(self, count: int):
if count == self.column_count:
Expand Down

0 comments on commit 1b38942

Please sign in to comment.