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
5 changes: 2 additions & 3 deletions src/napari_plugin_manager/base_qt_plugin_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def setup_ui(self, enabled: bool = True) -> None:

# Action Button
self.action_button = QPushButton(self)
self.action_button.setFixedWidth(70)
self.action_button.setFixedWidth(80)
sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
self.action_button.setSizePolicy(sizePolicy1)
self.action_button.clicked.connect(self._action_requested)
Expand All @@ -444,7 +444,7 @@ def setup_ui(self, enabled: bool = True) -> None:
self.cancel_btn = QPushButton('Cancel', self)
self.cancel_btn.setObjectName('remove_button')
self.cancel_btn.setSizePolicy(sizePolicy)
self.cancel_btn.setFixedWidth(70)
self.cancel_btn.setFixedWidth(80)
self.cancel_btn.clicked.connect(self._cancel_requested)

# Collapsible button
Expand Down Expand Up @@ -1504,7 +1504,6 @@ def _setup_ui(self) -> None:
self.direct_entry_btn.setMenu(self._menu)

self.show_status_btn = QPushButton(self._trans('Show Status'), self)
self.show_status_btn.setFixedWidth(100)

self.cancel_all_btn = QPushButton(
self._trans('cancel all actions'), self
Expand Down
16 changes: 13 additions & 3 deletions src/napari_plugin_manager/qt_plugin_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import napari.plugins
import napari.resources
import npe2
from napari._qt.qt_resources import QColoredSVGIcon, get_current_stylesheet
from napari._qt.qt_resources import (
QColoredSVGIcon,
get_stylesheet,
)
from napari._qt.qthreading import create_worker
from napari._qt.widgets.qt_tooltip import QtToolTipLabel
from napari.plugins.utils import normalized_name
Expand Down Expand Up @@ -173,10 +176,17 @@ class QtPluginDialog(BaseQtPluginDialog):
BASE_PACKAGE_NAME = 'napari'

def _setup_theme_update(self) -> None:
get_settings().appearance.events.theme.connect(self._update_theme)
settings = get_settings()
settings.appearance.events.theme.connect(self._update_theme)
settings.appearance.events.font_size.connect(self._update_theme)

def _update_theme(self, event) -> None:
stylesheet = get_current_stylesheet([STYLES_PATH])
settings = get_settings()
theme = settings.appearance.theme
font_variable = {'font_size': f'{settings.appearance.font_size}pt'}
stylesheet = get_stylesheet(
theme, extra=[STYLES_PATH], extra_variables=font_variable
)
self.setStyleSheet(stylesheet)

def _add_installed(self, pkg_name: str | None = None) -> None:
Expand Down
11 changes: 6 additions & 5 deletions src/napari_plugin_manager/styles.qss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from napari._qt.qt_resources import get_current_stylesheet

QLineEdit {
border: 1px solid white;
font-size: 16px;
font-size: {{ increase(font_size, 2) }};
}

QLineEdit:focus {
Expand All @@ -24,12 +24,13 @@ QLineEdit:focus {
QCollapsible#install_info_button {
background-color: {{ darken(foreground, 20) }};
color: {{ darken(text, 15) }};
font-size: {{ font_size }};
}
QWidget#info_widget {
QWidget#info_widget, QWidget#info_widget > QLabel {
background-color: {{ darken(foreground, 20) }};
margin: 0px;
padding: 0px;
font: 11px;
font-size: {{ font_size }};
}

QLabel#author_text {
Expand Down Expand Up @@ -69,7 +70,7 @@ QWidget#install_choice_widget {
color: {{ darken(text, 35) }};
margin: 0px;
padding: 0px;
font: 11px;
font-size: {{ font_size }};
}

QPluginList {
Expand Down Expand Up @@ -371,7 +372,7 @@ QToolButton {
background-color: {{ darken(foreground, 20) }};
color: {{ darken(text, 15) }};
padding: 3 12px;
font-size: 16px;
font-size: {{ increase(font_size, 2) }};
}

QToolButton:hover {
Expand Down
Loading