Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move qss file from napari to plugin manager #43

Merged
merged 46 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a266985
Make headless napari usable without qt (#2039)
tlambert03 Dec 29, 2020
bdc60e0
Add `theme` parameter to `get_stylesheet` (#2263)
tlambert03 Feb 15, 2021
f56f860
Refactor icon build process (#2285)
tlambert03 Feb 23, 2021
6bb18b3
Contour toggle (#2168)
kir0ul Feb 23, 2021
980f04f
Notification Manager (#2205)
Carreau Mar 8, 2021
7ec0d9d
PR: Add a font size preview slider widget (#2318)
goanpeca Mar 10, 2021
d72a0b4
PR: Update preferences dialog style to match Designs (#2456)
goanpeca Mar 23, 2021
e41e6e8
add name to dock widget titlebar (#2471)
tlambert03 Mar 26, 2021
907e5ef
New new qt layerlist (#2493)
tlambert03 Apr 13, 2021
67751a6
PR: Add initial welcome screen on canvas (#2542)
goanpeca Apr 15, 2021
99cf30a
Fix tracks icons, and visibility icons (#2708)
tlambert03 May 13, 2021
40bce77
Use QDoubleRangeSlider from superqt package (#2752)
tlambert03 Jun 28, 2021
50feb7d
Use labeled sliders from superqt (#2753)
tlambert03 Jun 28, 2021
346ac16
Shortcuts UI (#2864)
ppwadhwa Jul 7, 2021
07bc932
Add activity dialog and style progress bars (#2656)
DragaDoncila Jul 9, 2021
afe4fb6
Add isosurface rendering to Labels (#3006)
kevinyamauchi Jul 15, 2021
fc22fa3
PR: Allow for multiple installs and update buttons to reflect state (…
goanpeca Jul 21, 2021
4ade17e
Grid mode popup (#3084)
ppwadhwa Aug 5, 2021
bafe7de
Add autoscale modes to image layer model, and buttons to GUI (#3022)
tlambert03 Aug 14, 2021
86598d5
Use QElidingLabel from superqt (#3188)
tlambert03 Aug 17, 2021
89720f1
Add `napari_experimental_provide_theme` hook specification (#3034)
lukasz-migas Aug 27, 2021
3b7d15d
Add cancel and cancel all actions to plugin dialog and improve UI (#3…
goanpeca Sep 12, 2021
88dab57
Hide or Destroy dock widgets (#3331)
ppwadhwa Sep 28, 2021
595499d
Add npe2 plugins to plugins installed list (#3694)
ppwadhwa Dec 7, 2021
8d0d516
volume plane interactive controls (#3759)
alisterburt Mar 2, 2022
ef05f54
Use napari hub api to list plugins (#4074)
goanpeca Mar 7, 2022
765b564
Allow resizing left dock widgets (#4368)
brisvag Apr 25, 2022
28252b2
support PyQt6, remove logic for `compile_qt_svgs` (#3707)
tlambert03 Jul 18, 2022
bf922ad
Confirmation on close, alternative approach (#4820)
Czaki Aug 1, 2022
7301ead
fix icon urls (#4887)
tlambert03 Aug 1, 2022
7926c81
Feature: Minimum blending (#4875)
psobolewskiPhD Sep 12, 2022
8d95ce9
fix theme id not being used correctly (#5412)
brisvag Dec 19, 2022
879315e
Add parent when creating layer context menu to inherit application th…
dalthviz Dec 22, 2022
ca8d739
Clarify package installer interface with abstract base class, and Pip…
jaimergp Dec 22, 2022
9bb2abf
Fix theme id reference to get image for 'success_label' style (#5447)
dalthviz Jan 5, 2023
892fe3c
Add error color to themes and change application close/exit dialogs (…
dalthviz Jan 8, 2023
8772381
Apply disabled widgets style only for menus. Set menus styles for QMo…
dalthviz Jan 11, 2023
2661ba4
Allow layers control section to resize to contents (#5474)
dalthviz Jan 23, 2023
431fe6c
Update plugin dialog design & functionality to add conda install (#5198)
ppwadhwa Mar 10, 2023
2160e92
Add `font-size` to theme (#5607)
lukasz-migas Aug 1, 2023
748d024
Add pre-commit check for basic formattings bugs (#6315)
Czaki Oct 8, 2023
e8330de
Lock dimensions / axes while rolling (#5986)
Chris-N-K Apr 1, 2024
66cdb1f
Move qss file with history, rename and relocate
goanpeca May 29, 2024
c19647e
Remove general qss and only leave plugin dialog one
goanpeca May 29, 2024
b952779
Update class names on qss for display name
goanpeca May 29, 2024
0ee3445
Set stylesheet only once and add comments
goanpeca Jun 4, 2024
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
9 changes: 8 additions & 1 deletion napari_plugin_manager/qt_plugin_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import napari.plugins
import napari.resources
import npe2
from napari._qt.qt_resources import QColoredSVGIcon
from napari._qt.qt_resources import QColoredSVGIcon, get_current_stylesheet
from napari._qt.qthreading import create_worker
from napari._qt.widgets.qt_message_popup import WarnPopup
from napari._qt.widgets.qt_tooltip import QtToolTipLabel
Expand Down Expand Up @@ -58,6 +58,7 @@
PYPI = 'PyPI'
ON_BUNDLE = running_as_constructor_app()
IS_NAPARI_CONDA_INSTALLED = is_conda_package('napari')
STYLES_PATH = Path(__file__).parent / 'styles.qss'


class ProjectInfoVersions(NamedTuple):
Expand Down Expand Up @@ -432,6 +433,9 @@ def __init__(self, parent: QWidget, installer: InstallerQueue) -> None:
self.setSortingEnabled(True)
self._remove_list = []

stylesheet = get_current_stylesheet([STYLES_PATH])
self.setStyleSheet(stylesheet)

def _count_visible(self) -> int:
"""Return the number of visible items.

Expand Down Expand Up @@ -965,6 +969,9 @@ def setup_ui(self):

self.packages_filter.setFocus()

stylesheet = get_current_stylesheet([STYLES_PATH])
self.setStyleSheet(stylesheet)
jaimergp marked this conversation as resolved.
Show resolved Hide resolved

def _update_count_in_label(self):
"""Counts all available but not installed plugins. Updates value."""

Expand Down
334 changes: 334 additions & 0 deletions napari_plugin_manager/styles.qss
Original file line number Diff line number Diff line change
@@ -0,0 +1,334 @@
/* ------------ Plugin Dialog ------------ */
jaimergp marked this conversation as resolved.
Show resolved Hide resolved

QCollapsible#install_info_button {
background-color: {{ darken(foreground, 20) }};
color: {{ darken(text, 15) }};
}
QWidget#info_widget {
background-color: {{ darken(foreground, 20) }};
margin: 0px;
padding: 0px;
font: 11px;
}

QLabel#author_text {
color: {{ darken(text, 35) }};
}

QLabel#install_choice {
background-color: {{ current }};
color: {{ darken(text, 35) }};
}

QLabel#plugin_name_web {
background-color: {{ darken(foreground, 20) }};
}

QLabel#plugin_name_web:hover {
background-color: {{ foreground }}
}

QLabel#plugin_name {
background-color: {{ darken(foreground, 20) }};
}
QLabel#plugin_name:hover {
background-color: {{ darken(foreground, 20) }};
}

QWidget#install_choice_widget {
background-color: {{ darken(foreground, 20) }};
color: {{ darken(text, 35) }};
margin: 0px;
padding: 0px;
font: 11px;
}

QPluginList {
background: {{ console }};
background: black;
}

PluginListItem {
background: {{ darken(foreground, 20) }};
padding: 0;
margin: 2px 4px;
border-radius: 3px;
}

PluginListItem#unavailable {
background: {{ lighten(foreground, 20) }};
padding: 0;
margin: 2px 4px;
border-radius: 3px;
}

PluginListItem QCheckBox::indicator:disabled {
background-color: {{ opacity(foreground, 127) }};
image: url("theme_{{ id }}:/check_50.svg");
}

QPushButton#install_button {
background-color: {{ current }}
}

QPushButton#install_button:hover {
background-color: {{ lighten(current, 10) }}
}

QPushButton#install_button:pressed {
background-color: {{ darken(current, 10) }}
}

QPushButton#install_button:disabled {
background-color: {{ lighten(current, 20) }}
}

QPushButton#remove_button {
background-color: {{ error }}
}

QPushButton#remove_button:hover {
background-color: {{ lighten(error, 10) }}
}

QPushButton#remove_button:pressed {
background-color: {{ darken(error, 10) }}
}

QPushButton#busy_button:pressed {
background-color: {{ darken(secondary, 10) }}
}

QPushButton#busy_button {
background-color: {{ secondary }}
}

QPushButton#busy_button:hover {
background-color: {{ lighten(secondary, 10) }}
}

QPushButton#busy_button:pressed {
background-color: {{ darken(secondary, 10) }}
}

QPushButton#close_button:disabled {
background-color: {{ lighten(secondary, 10) }}
}


#small_text {
color: {{ opacity(text, 150) }};
font-size: {{ decrease(font_size, 2) }};
}

#small_italic_text {
color: {{ opacity(text, 150) }};
font-size: {{ font_size }};
font-style: italic;
}

#plugin_manager_process_status{
background: {{ background }};
color: {{ opacity(text, 200) }};
}

#info_icon {
image: url("theme_{{ id }}:/info.svg");
min-width: 18px;
min-height: 18px;
margin: 2px;
}

#warning_icon {
image: url("theme_{{ id }}:/warning.svg");
max-width: 14px;
max-height: 14px;
min-width: 14px;
min-height: 14px;
margin: 0px;
margin-left: 1px;
padding: 2px;
background: darken(foreground, 20);
}

#warning_icon:hover{
background: {{ foreground }};
}

#warning_icon:pressed{
background: {{ primary }};
}

#error_label {
image: url("theme_{{ id }}:/warning.svg");
max-width: 18px;
max-height: 18px;
min-width: 18px;
min-height: 18px;
margin: 0px;
margin-left: 1px;
padding: 2px;
}

#success_label {
image: url("theme_{{ id }}:/check.svg");
max-width: 18px;
max-height: 18px;
min-width: 18px;
min-height: 18px;
margin: 0px;
margin-left: 1px;
padding: 2px;
}

#help_label {
image: url("theme_{{ id }}:/help.svg");
max-width: 18px;
max-height: 18px;
min-width: 18px;
min-height: 18px;
margin: 0px;
margin-left: 1px;
padding: 2px;
}


QtPluginDialog QSplitter{
padding-right: 2;
}


QtPluginSorter {
padding: 20px;
}


QtFontSizePreview {
border: 1px solid {{ foreground }};
border-radius: 5px;
}

QListWidget#Preferences {
background: {{ background }};
}


QtWelcomeWidget, QtWelcomeWidget[drag=false] {
background: {{ canvas }};
}

QtWelcomeWidget[drag=true] {
background: {{ highlight }};
}

QtWelcomeLabel {
color: {{ foreground }};
font-size: {{ increase(font_size, 8) }};
}

QtShortcutLabel {
color: {{ foreground }};
font-size: {{ increase(font_size, 4) }};
}


/* ------------- Narrow scrollbar for qtlayer list --------- */

QtListView {
background: {{ background }};
}

QtListView QScrollBar:vertical {
max-width: 8px;
}

QtListView QScrollBar::add-line:vertical,
QtListView QScrollBar::sub-line:vertical {
height: 10px;
width: 8px;
margin-top: 2px;
margin-bottom: 2px;
}

QtListView QScrollBar:up-arrow,
QtListView QScrollBar:down-arrow {
min-height: 6px;
min-width: 6px;
max-height: 6px;
max-width: 6px;
}

QtListView::item {
padding: 4px;
margin: 2px 2px 2px 2px;
background-color: {{ foreground }};
border: 1px solid {{ foreground }};
}

QtListView::item:hover {
background-color: {{ lighten(foreground, 3) }};
}

/* in the QSS context "active" means the window is active */
/* (as opposed to focused on another application) */
QtListView::item:selected:active{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 {{ current }}, stop: 1 {{ darken(current, 15) }});
}


QtListView::item:selected:!active {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 {{ darken(current, 10) }}, stop: 1 {{ darken(current, 25) }});
}


QtListView QLineEdit {
background-color: {{ darken(current, 20) }};
selection-background-color: {{ lighten(current, 20) }};
font-size: {{ font_size }};
}

QtLayerList::item {
margin: 2px 2px 2px 28px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border: 0;
}

/* the first one is the "partially checked" state */
QtLayerList::indicator {
width: 16px;
height: 16px;
position: absolute;
left: 0px;
image: url("theme_{{ id }}:/visibility_off.svg");
}

QtLayerList::indicator:unchecked {
image: url("theme_{{ id }}:/visibility_off_50.svg");

}

QtLayerList::indicator:checked {
image: url("theme_{{ id }}:/visibility.svg");
}


#error_icon_btn {
qproperty-icon: url("theme_{{ id }}:/error.svg");
}

#warning_icon_btn {
qproperty-icon: url("theme_{{ id }}:/warning.svg");
}

#warning_icon_element {
image: url("theme_{{ id }}:/warning.svg");
min-height: 36px;
min-width: 36px;
}

#error_icon_element {
image: url("theme_{{ id }}:/error.svg");
min-height: 36px;
min-width: 36px;
}
Loading