From 99b800284559f1bd942d28afc6d4008bfdab1705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Pe=C3=B1a-Castellanos?= Date: Wed, 10 Jul 2024 01:59:42 -0500 Subject: [PATCH] Fix styling issues --- napari_plugin_manager/qt_plugin_dialog.py | 496 ++++++---------------- napari_plugin_manager/styles.qss | 5 + 2 files changed, 126 insertions(+), 375 deletions(-) diff --git a/napari_plugin_manager/qt_plugin_dialog.py b/napari_plugin_manager/qt_plugin_dialog.py index 750e273..2cff6d3 100644 --- a/napari_plugin_manager/qt_plugin_dialog.py +++ b/napari_plugin_manager/qt_plugin_dialog.py @@ -20,9 +20,10 @@ ) from napari.utils.translations import trans from qtpy.QtCore import QEvent, QPoint, QSize, Qt, QTimer, Slot -from qtpy.QtGui import QMovie +from qtpy.QtGui import QFont, QMovie from qtpy.QtWidgets import ( QCheckBox, + QComboBox, QDialog, QFrame, QGridLayout, @@ -32,11 +33,13 @@ QListWidget, QListWidgetItem, QPushButton, + QSizePolicy, QSplitter, QTextEdit, QVBoxLayout, QWidget, ) +from superqt import QCollapsible, QElidingLabel from napari_plugin_manager.npe2api import iter_napari_plugin_info from napari_plugin_manager.qt_package_installer import ( @@ -50,7 +53,7 @@ # TODO: add error icon and handle pip install errors # Scaling factor for each list widget item when expanding. -SCALE = 1.6 +SCALE = 1.4 CONDA = 'Conda' PYPI = 'PyPI' ON_BUNDLE = running_as_constructor_app() @@ -105,9 +108,9 @@ def __init__( else: self._populate_version_dropdown(CONDA) - self.package_name.setText(version) + self.version.setText(version) if summary: - self.summary.setText(summary + '
') + self.summary.setText(summary) if author: self.package_author.setText(author) self.package_author.setWordWrap(True) @@ -130,7 +133,6 @@ def __init__( self.action_button.setObjectName("install_button") self.info_widget.hide() self.install_info_button.addWidget(self.info_choice_wdg) - self.install_info_button.setFixedWidth(170) self.info_choice_wdg.show() self._populate_version_dropdown(self.get_installer_source()) @@ -193,26 +195,28 @@ def set_busy( def setup_ui(self, enabled=True): """Define the layout of the PluginListItem""" - # --- Widgets - # ---------------------------------------------- + # Enabled checkbox self.enabled_checkbox = QCheckBox(self) self.enabled_checkbox.setChecked(enabled) self.enabled_checkbox.setToolTip(trans._("enable/disable")) self.enabled_checkbox.setText("") self.enabled_checkbox.stateChanged.connect(self._on_enabled_checkbox) - # self.row1.addWidget(self.enabled_checkbox) - # sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - # sizePolicy.setHorizontalStretch(0) - # sizePolicy.setVerticalStretch(0) - # sizePolicy.setHeightForWidth( - # self.enabled_checkbox.sizePolicy().hasHeightForWidth() - # ) - # self.enabled_checkbox.setSizePolicy(sizePolicy) - # self.enabled_checkbox.setMinimumSize(QSize(20, 0)) + sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth( + self.enabled_checkbox.sizePolicy().hasHeightForWidth() + ) + self.enabled_checkbox.setSizePolicy(sizePolicy) + self.enabled_checkbox.setMinimumSize(QSize(20, 0)) # Plugin name self.plugin_name = ClickableLabel(self) # To style content + font_plugin_name = QFont() + font_plugin_name.setPointSize(15) + font_plugin_name.setUnderline(True) + self.plugin_name.setFont(font_plugin_name) # Status self.status_icon = QLabel(self) @@ -220,27 +224,24 @@ def setup_ui(self, enabled=True): self.status_label = QLabel(self) self.status_label.setVisible(False) - # Do not want to highlight on hover unless there is a website. if self.url and self.url != 'UNKNOWN': + # Do not want to highlight on hover unless there is a website. self.plugin_name.setObjectName('plugin_name_web') else: self.plugin_name.setObjectName('plugin_name') - # sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum) - # sizePolicy.setHorizontalStretch(0) - # sizePolicy.setVerticalStretch(0) - # sizePolicy.setHeightForWidth( - # self.plugin_name.sizePolicy().hasHeightForWidth() - # ) - # self.plugin_name.setSizePolicy(sizePolicy) - # font15 = QFont() - # font15.setPointSize(15) - # font15.setUnderline(True) - # self.plugin_name.setFont(font15) + sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth( + self.plugin_name.sizePolicy().hasHeightForWidth() + ) + self.plugin_name.setSizePolicy(sizePolicy) # Warning icon icon = QColoredSVGIcon.from_resources("warning") self.warning_tooltip = QtToolTipLabel(self) + # TODO: This color should come from the theme but the theme needs # to provide the right color. Default warning should be orange, not # red. Code example: @@ -250,36 +251,54 @@ def setup_ui(self, enabled=True): icon.colored(color="#E3B617").pixmap(15, 15) ) self.warning_tooltip.setVisible(False) - # self.row1.addWidget(self.warning_tooltip) # Item status self.item_status = QLabel(self) self.item_status.setObjectName("small_italic_text") - - # self.item_status.setSizePolicy(sizePolicy) - # self.row1.addWidget(self.item_status) - # self.row1.addStretch() - # self.v_lay.addLayout(self.row1) + self.item_status.setSizePolicy(sizePolicy) # Summary self.summary = QElidingLabel(parent=self) self.summary.setObjectName('summary_text') self.summary.setWordWrap(True) + font_summary = QFont() + font_summary.setPointSize(10) + self.summary.setFont(font_summary) + + sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(1) + sizePolicy.setVerticalStretch(0) + self.summary.setSizePolicy(sizePolicy) + self.summary.setContentsMargins(0, -2, 0, -2) + # Package author self.package_author = QElidingLabel(self) self.package_author.setObjectName('author_text') self.package_author.setWordWrap(True) + self.package_author.setSizePolicy(sizePolicy) # Update button self.update_btn = QPushButton('Update', self) self.update_btn.setObjectName("install_button") self.update_btn.setVisible(False) + sizePolicy.setRetainSizeWhenHidden(True) + sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) + self.update_btn.setSizePolicy(sizePolicy) - # Install version widget - self.info_choice_wdg = QWidget(self) - self.info_choice_wdg.setObjectName('install_choice') + # Action Button + self.action_button = QPushButton(self) + self.action_button.setFixedWidth(70) + sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) + self.action_button.setSizePolicy(sizePolicy1) + + # Cancel + self.cancel_btn = QPushButton("Cancel", self) + self.cancel_btn.setObjectName("remove_button") + self.cancel_btn.setSizePolicy(sizePolicy) + self.cancel_btn.setFixedWidth(70) + # Collapsible button coll_icon = QColoredSVGIcon.from_resources('right_arrow').colored( color='white', ) @@ -289,8 +308,24 @@ def setup_ui(self, enabled=True): self.install_info_button = QCollapsible( "Installation Info", collapsedIcon=coll_icon, expandedIcon=exp_icon ) + self.install_info_button.setLayoutDirection( + Qt.RightToLeft + ) # Make icon appear on the right self.install_info_button.setObjectName("install_info_button") - self.install_info_button.setVisible(False) # Extra + self.install_info_button.setFixedWidth(180) + self.install_info_button.content().layout().setContentsMargins( + 0, 0, 0, 0 + ) + self.install_info_button.content().setContentsMargins(0, 0, 0, 0) + self.install_info_button.content().layout().setSpacing(0) + self.install_info_button.layout().setContentsMargins(0, 0, 0, 0) + self.install_info_button.layout().setSpacing(2) + self.install_info_button.setSizePolicy(sizePolicy) + + # Information widget for available packages + self.info_choice_wdg = QWidget(self) + self.info_choice_wdg.setObjectName('install_choice') + self.source_choice_text = QLabel('Source:') self.version_choice_text = QLabel('Version:') self.source_choice_dropdown = QComboBox() @@ -308,148 +343,50 @@ def setup_ui(self, enabled=True): self.source_choice_dropdown.currentTextChanged.connect( self._populate_version_dropdown ) - # self.row2.addWidget( - # self.install_info_button, - # 0, - # 7, - # 1, - # 1, - # alignment=Qt.AlignmentFlag.AlignTop, - # self.version_choice_dropdown = QComboBox() - - # Action Button - # TODO: change to separate buttons! - self.action_button = QPushButton(self) - # self.action_button.setVisible(False) # Extra - - # Cancel - self.cancel_btn = QPushButton("Cancel", self) - self.cancel_btn.setObjectName("remove_button") + # Information widget for installed packages self.info_widget = QWidget(self) - self.version_text = QLabel('Version:') - self.package_name = QLabel() + self.info_widget.setLayoutDirection(Qt.LeftToRight) + self.info_widget.setObjectName("info_widget") + self.info_widget.setFixedWidth(180) + self.source_text = QLabel('Source:') self.source = QLabel(PYPI) + self.version_text = QLabel('Version:') + self.version = QElidingLabel() + self.version.setWordWrap(True) - # Information on versions and package type - self.info_choice_wdg = QWidget(self) - self.info_choice_wdg.setObjectName('install_choice') - coll_icon = QColoredSVGIcon.from_resources('right_arrow').colored( - color='white', - ) - exp_icon = QColoredSVGIcon.from_resources('down_arrow').colored( - color='white', - ) - self.install_info_button = QCollapsible( - "Installation Info", collapsedIcon=coll_icon, expandedIcon=exp_icon - ) - self.install_info_button.setObjectName("install_info_button") - - # self.row2 = QGridLayout() - # self.error_indicator = QPushButton() - # self.error_indicator.setObjectName("warning_icon") - # self.error_indicator.setCursor(Qt.CursorShape.PointingHandCursor) - # self.error_indicator.hide() - # self.row2.addWidget( - # self.error_indicator, - # 0, - # 0, - # 1, - # 1, - # alignment=Qt.AlignmentFlag.AlignTop, - # ) - # self.row2.setSpacing(4) - - # sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) - - # sizePolicy.setHorizontalStretch(1) - # sizePolicy.setVerticalStretch(0) - # self.summary.setSizePolicy(sizePolicy) - # self.row2.addWidget( - # self.summary, 0, 1, 1, 3, alignment=Qt.AlignmentFlag.AlignTop - # ) - - # self.package_author.setSizePolicy(sizePolicy) - # self.row2.addWidget( - # self.package_author, - # 0, - # 4, - # 1, - # 2, - # alignment=Qt.AlignmentFlag.AlignTop, - # ) - - # sizePolicy.setRetainSizeWhenHidden(True) - # self.update_btn.setSizePolicy(sizePolicy) - - # self.row2.addWidget( - # self.update_btn, 0, 6, 1, 1, alignment=Qt.AlignmentFlag.AlignTop - # ) - - # # To make the icon appear on the right - # self.install_info_button.setLayoutDirection(Qt.RightToLeft) - - # # Remove any extra margins - # self.install_info_button.content().layout().setContentsMargins( - # 0, 0, 0, 0 - # ) - # self.install_info_button.content().setContentsMargins(0, 0, 0, 0) - # self.install_info_button.content().layout().setSpacing(0) - # self.install_info_button.layout().setContentsMargins(0, 0, 0, 0) - # self.install_info_button.layout().setSpacing(2) - # self.install_info_button.setSizePolicy(sizePolicy) - - # self.row2.addWidget( - # self.install_info_button, - # 0, - # 7, - # 1, - # 1, - # alignment=Qt.AlignmentFlag.AlignTop, - # ) - - # self.cancel_btn.setSizePolicy(sizePolicy) - # self.row2.addWidget( - # self.cancel_btn, 0, 8, 1, 1, alignment=Qt.AlignmentFlag.AlignTop - # ) - - # sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) - # self.action_button.setFixedWidth(70) - # self.action_button.setSizePolicy(sizePolicy1) - # self.row2.addWidget( - # self.action_button, 0, 8, 1, 1, alignment=Qt.AlignmentFlag.AlignTop - # ) - - # self.v_lay.addLayout(self.row2) - - # self.info_widget.setLayoutDirection(Qt.LeftToRight) - # self.info_widget.setObjectName("info_widget") - # info_layout = QGridLayout() - # info_layout.setContentsMargins(0, 0, 0, 0) - # info_layout.setVerticalSpacing(0) - - # info_layout.addWidget(self.source_text, 0, 0) - # info_layout.addWidget(self.source, 1, 0) - # info_layout.addWidget(self.version_text, 0, 1) - # info_layout.addWidget(self.package_name, 1, 1) - - # self.install_info_button.setFixedWidth(150) - # self.install_info_button.layout().setContentsMargins(0, 0, 0, 0) - # self.info_widget.setLayout(info_layout) + info_layout = QGridLayout() + info_layout.setContentsMargins(0, 0, 0, 0) + info_layout.setVerticalSpacing(0) + info_layout.addWidget(self.source_text, 0, 0) + info_layout.addWidget(self.source, 1, 0) + info_layout.addWidget(self.version_text, 0, 1) + info_layout.addWidget(self.version, 1, 1) + self.info_widget.setLayout(info_layout) + + # Error indicator + self.error_indicator = QPushButton() + self.error_indicator.setObjectName("warning_icon") + self.error_indicator.setCursor(Qt.CursorShape.PointingHandCursor) + self.error_indicator.hide() # --- Layout # ------------------------------------------------ layout = QHBoxLayout() + layout.setSpacing(2) layout_left = QVBoxLayout() layout_right = QVBoxLayout() layout_top = QHBoxLayout() layout_bottom = QHBoxLayout() + layout_bottom.setSpacing(4) - layout_left.addWidget(self.enabled_checkbox) + layout_left.addWidget( + self.enabled_checkbox, alignment=Qt.AlignmentFlag.AlignTop + ) - layout_right.addLayout(layout_top) - layout_right.addLayout(layout_bottom) + layout_right.addLayout(layout_top, 1) + layout_right.addLayout(layout_bottom, 100) layout.addLayout(layout_left) layout.addLayout(layout_right) @@ -459,14 +396,27 @@ def setup_ui(self, enabled=True): layout_top.addWidget(self.plugin_name) layout_top.addWidget(self.status_icon) layout_top.addWidget(self.status_label) + layout_top.addWidget(self.item_status) layout_top.addStretch() - layout_bottom.addWidget(self.summary) - layout_bottom.addWidget(self.package_author) - layout_bottom.addWidget(self.install_info_button) - layout_bottom.addWidget(self.action_button) - layout_bottom.addWidget(self.update_btn) - layout_bottom.addWidget(self.cancel_btn) + layout_bottom.addWidget( + self.summary, alignment=Qt.AlignmentFlag.AlignTop, stretch=3 + ) + layout_bottom.addWidget( + self.package_author, alignment=Qt.AlignmentFlag.AlignTop, stretch=1 + ) + layout_bottom.addWidget( + self.update_btn, alignment=Qt.AlignmentFlag.AlignTop + ) + layout_bottom.addWidget( + self.install_info_button, alignment=Qt.AlignmentFlag.AlignTop + ) + layout_bottom.addWidget( + self.action_button, alignment=Qt.AlignmentFlag.AlignTop + ) + layout_bottom.addWidget( + self.cancel_btn, alignment=Qt.AlignmentFlag.AlignTop + ) info_layout = QGridLayout() info_layout.setContentsMargins(0, 0, 0, 0) @@ -478,212 +428,8 @@ def setup_ui(self, enabled=True): self.info_choice_wdg.setLayout(info_layout) self.info_choice_wdg.setLayoutDirection(Qt.LeftToRight) self.info_choice_wdg.setObjectName("install_choice_widget") - # Remove any extra margins - self.install_info_button.content().layout().setContentsMargins( - 0, 0, 0, 0 - ) - self.install_info_button.content().setContentsMargins(0, 0, 0, 0) - self.install_info_button.content().layout().setSpacing(0) - self.install_info_button.layout().setContentsMargins(0, 0, 0, 0) self.info_choice_wdg.hide() - # layout_bottom.addStretch() - - # self.v_lay = QVBoxLayout(self) - # self.v_lay.setContentsMargins(-1, 6, -1, 6) - # self.v_lay.setSpacing(0) - # self.row1 = QHBoxLayout() - # self.row1.setSpacing(6) - # self.enabled_checkbox = QCheckBox(self) - # self.enabled_checkbox.setChecked(enabled) - # self.enabled_checkbox.stateChanged.connect(self._on_enabled_checkbox) - # self.enabled_checkbox.setToolTip(trans._("enable/disable")) - # sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - # sizePolicy.setHorizontalStretch(0) - # sizePolicy.setVerticalStretch(0) - # sizePolicy.setHeightForWidth( - # self.enabled_checkbox.sizePolicy().hasHeightForWidth() - # ) - # self.enabled_checkbox.setSizePolicy(sizePolicy) - # self.enabled_checkbox.setMinimumSize(QSize(20, 0)) - # self.enabled_checkbox.setText("") - # self.row1.addWidget(self.enabled_checkbox) - # self.plugin_name = QPushButton(self) - - # # Do not want to highlight on hover unless there is a website. - # if self.url and self.url != 'UNKNOWN': - # self.plugin_name.setObjectName('plugin_name_web') - # else: - # self.plugin_name.setObjectName('plugin_name') - - # sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum) - # sizePolicy.setHorizontalStretch(0) - # sizePolicy.setVerticalStretch(0) - # sizePolicy.setHeightForWidth( - # self.plugin_name.sizePolicy().hasHeightForWidth() - # ) - # self.plugin_name.setSizePolicy(sizePolicy) - # font15 = QFont() - # font15.setPointSize(15) - # font15.setUnderline(True) - # self.plugin_name.setFont(font15) - # self.row1.addWidget(self.plugin_name) - - # icon = QColoredSVGIcon.from_resources("warning") - # self.warning_tooltip = QtToolTipLabel(self) - # # TODO: This color should come from the theme but the theme needs - # # to provide the right color. Default warning should be orange, not - # # red. Code example: - # # theme_name = get_settings().appearance.theme - # # napari.utils.theme.get_theme(theme_name, as_dict=False).warning.as_hex() - # self.warning_tooltip.setPixmap( - # icon.colored(color="#E3B617").pixmap(15, 15) - # ) - # self.warning_tooltip.setVisible(False) - # self.row1.addWidget(self.warning_tooltip) - - # self.item_status = QLabel(self) - # self.item_status.setObjectName("small_italic_text") - # self.item_status.setSizePolicy(sizePolicy) - # self.row1.addWidget(self.item_status) - # self.row1.addStretch() - # self.v_lay.addLayout(self.row1) - - # self.row2 = QGridLayout() - # self.error_indicator = QPushButton() - # self.error_indicator.setObjectName("warning_icon") - # self.error_indicator.setCursor(Qt.CursorShape.PointingHandCursor) - # self.error_indicator.hide() - # self.row2.addWidget( - # self.error_indicator, - # 0, - # 0, - # 1, - # 1, - # alignment=Qt.AlignmentFlag.AlignTop, - # ) - # self.row2.setSpacing(4) - # self.summary = QElidingLabel(parent=self) - # self.summary.setObjectName('summary_text') - # self.summary.setWordWrap(True) - - # sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) - - # sizePolicy.setHorizontalStretch(1) - # sizePolicy.setVerticalStretch(0) - # self.summary.setSizePolicy(sizePolicy) - # self.row2.addWidget( - # self.summary, 0, 1, 1, 3, alignment=Qt.AlignmentFlag.AlignTop - # ) - - # self.package_author = QElidingLabel(self) - # self.package_author.setObjectName('author_text') - # self.package_author.setWordWrap(True) - # self.package_author.setSizePolicy(sizePolicy) - # self.row2.addWidget( - # self.package_author, - # 0, - # 4, - # 1, - # 2, - # alignment=Qt.AlignmentFlag.AlignTop, - # ) - - # self.update_btn = QPushButton('Update', self) - # sizePolicy.setRetainSizeWhenHidden(True) - # self.update_btn.setSizePolicy(sizePolicy) - # self.update_btn.setObjectName("install_button") - # self.update_btn.setVisible(False) - - # self.row2.addWidget( - # self.update_btn, 0, 6, 1, 1, alignment=Qt.AlignmentFlag.AlignTop - # ) - - # # To make the icon appear on the right - # self.install_info_button.setLayoutDirection(Qt.RightToLeft) - - # # Remove any extra margins - # self.install_info_button.content().layout().setContentsMargins( - # 0, 0, 0, 0 - # ) - # self.install_info_button.content().setContentsMargins(0, 0, 0, 0) - # self.install_info_button.content().layout().setSpacing(0) - # self.install_info_button.layout().setContentsMargins(0, 0, 0, 0) - # self.install_info_button.layout().setSpacing(2) - # self.install_info_button.setSizePolicy(sizePolicy) - - # self.source_choice_text = QLabel('Source:') - # self.version_choice_text = QLabel('Version:') - # self.source_choice_dropdown = QComboBox() - - # if self._versions_pypi: - # self.source_choice_dropdown.addItem(PYPI) - - # if IS_NAPARI_CONDA_INSTALLED and self._versions_conda: - # self.source_choice_dropdown.addItem(CONDA) - - # self.source_choice_dropdown.currentTextChanged.connect( - # self._populate_version_dropdown - # ) - # self.version_choice_dropdown = QComboBox() - # self.row2.addWidget( - # self.install_info_button, - # 0, - # 7, - # 1, - # 1, - # alignment=Qt.AlignmentFlag.AlignTop, - # ) - - # info_layout = QGridLayout() - # info_layout.setContentsMargins(0, 0, 0, 0) - # info_layout.setVerticalSpacing(0) - # info_layout.addWidget(self.source_choice_text, 0, 0, 1, 1) - # info_layout.addWidget(self.source_choice_dropdown, 1, 0, 1, 1) - # info_layout.addWidget(self.version_choice_text, 0, 1, 1, 1) - # info_layout.addWidget(self.version_choice_dropdown, 1, 1, 1, 1) - # self.info_choice_wdg.setLayout(info_layout) - # self.info_choice_wdg.setLayoutDirection(Qt.LeftToRight) - # self.info_choice_wdg.setObjectName("install_choice_widget") - # self.info_choice_wdg.hide() - - # self.cancel_btn = QPushButton("Cancel", self) - # self.cancel_btn.setSizePolicy(sizePolicy) - # self.cancel_btn.setObjectName("remove_button") - # self.row2.addWidget( - # self.cancel_btn, 0, 8, 1, 1, alignment=Qt.AlignmentFlag.AlignTop - # ) - - # self.action_button = QPushButton(self) - # self.action_button.setFixedWidth(70) - # sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) - # self.action_button.setSizePolicy(sizePolicy1) - # self.row2.addWidget( - # self.action_button, 0, 8, 1, 1, alignment=Qt.AlignmentFlag.AlignTop - # ) - - # self.v_lay.addLayout(self.row2) - - # self.info_widget = QWidget(self) - # self.info_widget.setLayoutDirection(Qt.LeftToRight) - # self.info_widget.setObjectName("info_widget") - # info_layout = QGridLayout() - # info_layout.setContentsMargins(0, 0, 0, 0) - # info_layout.setVerticalSpacing(0) - # self.version_text = QLabel('Version:') - # self.package_name = QLabel() - # self.source_text = QLabel('Source:') - # self.source = QLabel(PYPI) - - # info_layout.addWidget(self.source_text, 0, 0) - # info_layout.addWidget(self.source, 1, 0) - # info_layout.addWidget(self.version_text, 0, 1) - # info_layout.addWidget(self.package_name, 1, 1) - - # self.install_info_button.setFixedWidth(150) - # self.install_info_button.layout().setContentsMargins(0, 0, 0, 0) - # self.info_widget.setLayout(info_layout) - def _populate_version_dropdown(self, source: Literal["PyPI", "Conda"]): """Display the versions available after selecting a source: pypi or conda.""" if source == PYPI: diff --git a/napari_plugin_manager/styles.qss b/napari_plugin_manager/styles.qss index 28ee023..f19c29f 100644 --- a/napari_plugin_manager/styles.qss +++ b/napari_plugin_manager/styles.qss @@ -26,6 +26,11 @@ QLabel#author_text { color: {{ darken(text, 35) }}; } +QElidingLabel#summary_text { + color: {{ darken(text, 35) }}; +} + + QLabel#install_choice { background-color: {{ current }}; color: {{ darken(text, 35) }};