From eb487cdb3f6bffa912958ad0225b37e5951bec93 Mon Sep 17 00:00:00 2001 From: dalthviz Date: Fri, 16 Jun 2023 11:42:51 -0500 Subject: [PATCH 1/2] Add font_size field to theme following changes at napari/napari#5607 --- src/npe2/manifest/contributions/_themes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/npe2/manifest/contributions/_themes.py b/src/npe2/manifest/contributions/_themes.py index 55d05f67..fa9e2bb3 100644 --- a/src/npe2/manifest/contributions/_themes.py +++ b/src/npe2/manifest/contributions/_themes.py @@ -64,3 +64,6 @@ class ThemeContribution(BaseModel): ' - RGB/RGBA strings: `"rgb(255, 255, 255)"`, `"rgba(255, 255, 255, 0.5)`"\n' ' - HSL strings: "`hsl(270, 60%, 70%)"`, `"hsl(270, 60%, 70%, .5)`"\n' ) + font_size: str = Field( + description="Font size (in points, pt) used in the application." + ) From 1590f95ee40c0447ed11aa0fb81069605d9af030 Mon Sep 17 00:00:00 2001 From: dalthviz Date: Fri, 16 Jun 2023 13:54:48 -0500 Subject: [PATCH 2/2] Testing --- src/npe2/manifest/contributions/_themes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/npe2/manifest/contributions/_themes.py b/src/npe2/manifest/contributions/_themes.py index fa9e2bb3..8085c2b3 100644 --- a/src/npe2/manifest/contributions/_themes.py +++ b/src/npe2/manifest/contributions/_themes.py @@ -1,3 +1,4 @@ +import sys from typing import Literal, Optional, Union from pydantic import BaseModel, color @@ -65,5 +66,6 @@ class ThemeContribution(BaseModel): ' - HSL strings: "`hsl(270, 60%, 70%)"`, `"hsl(270, 60%, 70%, .5)`"\n' ) font_size: str = Field( - description="Font size (in points, pt) used in the application." + default="12pt" if sys.platform == "darwin" else "9pt", + description="Font size (in points, pt) used in the application.", )