mirror of
https://github.com/rio-labs/rio.git
synced 2026-02-10 23:59:10 -06:00
fix incorrect fill use in yes_no_dialog
This commit is contained in:
@@ -10,19 +10,25 @@ from .. import color, fills, icon_registry
|
||||
from .component import AccessibilityRole, Key
|
||||
from .fundamental_component import FundamentalComponent
|
||||
|
||||
__all__ = [
|
||||
"Icon",
|
||||
]
|
||||
__all__ = ["Icon"]
|
||||
|
||||
|
||||
_IconFill = t.Union[
|
||||
"fills.SolidFill",
|
||||
"fills.LinearGradientFill",
|
||||
"fills.ImageFill",
|
||||
"color.ColorSet",
|
||||
fills.SolidFill,
|
||||
fills.LinearGradientFill,
|
||||
fills.ImageFill,
|
||||
color.ColorSet,
|
||||
t.Literal["dim"],
|
||||
]
|
||||
|
||||
ICON_FILLS = tuple(
|
||||
typ for typ in t.get_args(_IconFill) if isinstance(typ, type)
|
||||
)
|
||||
|
||||
|
||||
def is_icon_fill(fill: t.Any) -> t.TypeGuard[_IconFill]:
|
||||
return isinstance(fill, ICON_FILLS)
|
||||
|
||||
|
||||
@t.final
|
||||
class Icon(FundamentalComponent):
|
||||
|
||||
@@ -46,6 +46,7 @@ from . import (
|
||||
weak_key_id_default_dict,
|
||||
)
|
||||
from .components import dialog_container, fundamental_component, root_components
|
||||
from .components.icon import is_icon_fill
|
||||
from .data_models import BuildData, UnittestComponentLayout
|
||||
from .observables.dataclass import RioDataclassMeta
|
||||
from .observables.observable_property import AttributeBinding
|
||||
@@ -3581,7 +3582,7 @@ a.remove();
|
||||
self.theme.heading1_style.fill,
|
||||
self.theme.text_style.fill,
|
||||
):
|
||||
if fill is not None:
|
||||
if is_icon_fill(fill):
|
||||
break
|
||||
else:
|
||||
fill = rio.Color.BLACK
|
||||
|
||||
Reference in New Issue
Block a user