Skip to content
Open
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
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ __pycache__/
*$py.class

fluentflet.egg-info
dist/
dist/

storage/
*.cpython-312.pyc

__pycache__/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ window.state.subscribe("theme", lambda t: print(f"Theme changed: {t}"))
- `bottom_navigation_items: Optional[List[Dict]]`. Bottom nav items
- `selected_index: int = 0`. Initial selected nav item
- `window_titlebar: Union[str, Titlebar]`. Window title or titlebar component
- `colors: Optional[Dict]`. Color overrides
- `Colors: Optional[Dict]`. Color overrides
```python
{
"nav_bg": "#1F1F1F",
Expand Down
Binary file removed fluentflet/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
40 changes: 20 additions & 20 deletions fluentflet/components/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(
else self.design_system.light_theme
)

# Define style configurations for each variant using design system colors
# Define style configurations for each variant using design system Colors
styles = {
ButtonVariant.DEFAULT: {
"bgcolor": {
Expand All @@ -51,55 +51,55 @@ def __init__(
},
"side": {
ft.ControlState.DEFAULT: ft.BorderSide(
1, ft.colors.with_opacity(0.0578, "#ffffff")
1, ft.Colors.with_opacity(0.0578, "#ffffff")
),
ft.ControlState.HOVERED: ft.BorderSide(
1, ft.colors.with_opacity(0.078, "#ffffff")
1, ft.Colors.with_opacity(0.078, "#ffffff")
),
},
"color": {
ft.ControlState.DEFAULT: self.theme.colors.get_color(
ft.ControlState.DEFAULT: self.theme.Colors.get_color(
"text_primary"
),
ft.ControlState.PRESSED: self.theme.colors.get_color(
ft.ControlState.PRESSED: self.theme.Colors.get_color(
"text_secondary"
),
ft.ControlState.DISABLED: self.theme.colors.get_color(
ft.ControlState.DISABLED: self.theme.Colors.get_color(
"text_disabled"
),
},
},
ButtonVariant.ACCENT: {
"bgcolor": {
ft.ControlState.DEFAULT: self.theme.colors.get_color(
ft.ControlState.DEFAULT: self.theme.Colors.get_color(
"accent_default"
),
ft.ControlState.PRESSED: self.theme.colors.get_color(
ft.ControlState.PRESSED: self.theme.Colors.get_color(
"accent_tertiary"
),
ft.ControlState.HOVERED: self.theme.colors.get_color(
ft.ControlState.HOVERED: self.theme.Colors.get_color(
"accent_secondary"
),
ft.ControlState.DISABLED: self.theme.colors.get_color(
ft.ControlState.DISABLED: self.theme.Colors.get_color(
"accent_disabled"
),
},
"side": {
ft.ControlState.DEFAULT: ft.BorderSide(
1, ft.colors.with_opacity(0.08, "#000000")
1, ft.Colors.with_opacity(0.08, "#000000")
),
ft.ControlState.HOVERED: ft.BorderSide(
1, ft.colors.with_opacity(0.078, "#ffffff")
1, ft.Colors.with_opacity(0.078, "#ffffff")
),
},
"color": {
ft.ControlState.DEFAULT: self.theme.colors.get_color(
ft.ControlState.DEFAULT: self.theme.Colors.get_color(
"text_on_accent_primary"
),
ft.ControlState.PRESSED: self.theme.colors.get_color(
ft.ControlState.PRESSED: self.theme.Colors.get_color(
"text_on_accent_secondary"
),
ft.ControlState.DISABLED: self.theme.colors.get_color(
ft.ControlState.DISABLED: self.theme.Colors.get_color(
"text_on_accent_disabled"
),
},
Expand All @@ -120,17 +120,17 @@ def __init__(
),
},
"color": {
ft.ControlState.DEFAULT: self.theme.colors.get_color(
ft.ControlState.DEFAULT: self.theme.Colors.get_color(
"accent_default"
),
ft.ControlState.PRESSED: self.theme.colors.get_color(
ft.ControlState.PRESSED: self.theme.Colors.get_color(
"accent_tertiary"
),
ft.ControlState.DISABLED: self.theme.colors.get_color(
ft.ControlState.DISABLED: self.theme.Colors.get_color(
"text_disabled"
),
},
"side": ft.BorderSide(0, ft.colors.with_opacity(0, "#000000")),
"side": ft.BorderSide(0, ft.Colors.with_opacity(0, "#000000")),
},
}

Expand Down Expand Up @@ -160,7 +160,7 @@ def __init__(
bgcolor=style_config["bgcolor"],
side=style_config["side"],
color=style_config["color"] if not custom_color else custom_color,
overlay_color=ft.colors.TRANSPARENT,
overlay_color=ft.Colors.TRANSPARENT,
padding=(
ft.padding.all(4)
if is_icon_only
Expand Down
30 changes: 15 additions & 15 deletions fluentflet/components/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,16 @@ def setup_months_view(self):
month,
size=16,
color=(
self.theme.colors.get_color("text_on_accent_primary")
self.theme.Colors.get_color("text_on_accent_primary")
if is_current
else self.theme.colors.get_color("text_secondary")
else self.theme.Colors.get_color("text_secondary")
),
),
width=70,
height=70,
alignment=ft.alignment.center,
bgcolor=(
self.theme.colors.get_color("accent_default")
self.theme.Colors.get_color("accent_default")
if is_current
else None
),
Expand Down Expand Up @@ -257,7 +257,7 @@ def setup_years_view(self):
ft.Text(
str(year),
size=16,
color=ft.colors.BLACK if is_current else ft.colors.WHITE70,
color=ft.Colors.BLACK if is_current else ft.Colors.WHITE70,
),
width=70,
height=70,
Expand Down Expand Up @@ -297,7 +297,7 @@ def setup_days_view(self):
weekday_containers = [
ft.Container(
ft.Text(
day, size=12, color=self.theme.colors.get_color("text_secondary")
day, size=12, color=self.theme.Colors.get_color("text_secondary")
),
alignment=ft.alignment.center,
padding=5,
Expand Down Expand Up @@ -327,15 +327,15 @@ def setup_days_view(self):
day.lstrip("+-"),
size=16,
color=(
self.theme.colors.get_color("text_on_accent_primary")
self.theme.Colors.get_color("text_on_accent_primary")
if is_current
else (
self.theme.colors.get_color("accent_default")
self.theme.Colors.get_color("accent_default")
if is_selected
else (
self.theme.colors.get_color("text_primary")
self.theme.Colors.get_color("text_primary")
if not (day.startswith(("-", "+")) or is_blackout)
else self.theme.colors.get_color("text_disabled")
else self.theme.Colors.get_color("text_disabled")
)
)
),
Expand All @@ -349,7 +349,7 @@ def setup_days_view(self):
if is_blackout:
blackout_line = ft.Container(
ft.Container(
bgcolor=self.theme.colors.get_color("text_disabled"),
bgcolor=self.theme.Colors.get_color("text_disabled"),
width=1,
height=30,
rotate=ft.transform.Rotate(0.785398),
Expand All @@ -368,12 +368,12 @@ def setup_days_view(self):
height=40,
alignment=ft.alignment.center,
bgcolor=(
self.theme.colors.get_color("accent_default")
self.theme.Colors.get_color("accent_default")
if is_current
else None
),
border=(
ft.border.all(1, self.theme.colors.get_color("accent_default"))
ft.border.all(1, self.theme.Colors.get_color("accent_default"))
if is_selected
else None
),
Expand Down Expand Up @@ -433,7 +433,7 @@ def create_header(self, title):
content=ft.Text(
title,
size=16,
color=self.theme.colors.get_color("text_primary"),
color=self.theme.Colors.get_color("text_primary"),
),
variant=ButtonVariant.HYPERLINK,
on_click=self.toggle_view,
Expand All @@ -445,7 +445,7 @@ def create_header(self, title):
content=ft.Icon(
name=ft.icons.ARROW_DROP_UP,
size=20,
color=self.theme.colors.get_color("text_primary"),
color=self.theme.Colors.get_color("text_primary"),
),
variant=ButtonVariant.HYPERLINK,
on_click=self.change_month(False),
Expand All @@ -455,7 +455,7 @@ def create_header(self, title):
content=ft.Icon(
name=ft.icons.ARROW_DROP_DOWN,
size=20,
color=self.theme.colors.get_color("text_primary"),
color=self.theme.Colors.get_color("text_primary"),
),
variant=ButtonVariant.HYPERLINK,
on_click=self.change_month(True),
Expand Down
38 changes: 19 additions & 19 deletions fluentflet/components/checkbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,26 @@ def __init__(
),
},
"checked_bgcolor": {
ft.ControlState.DEFAULT: self.theme.colors.get_color("accent_default"),
ft.ControlState.HOVERED: self.theme.colors.get_color(
ft.ControlState.DEFAULT: self.theme.Colors.get_color("accent_default"),
ft.ControlState.HOVERED: self.theme.Colors.get_color(
"accent_secondary"
),
ft.ControlState.PRESSED: self.theme.colors.get_color("accent_tertiary"),
ft.ControlState.DISABLED: self.theme.colors.get_color(
ft.ControlState.PRESSED: self.theme.Colors.get_color("accent_tertiary"),
ft.ControlState.DISABLED: self.theme.Colors.get_color(
"accent_disabled"
),
},
"check_color": {
ft.ControlState.DEFAULT: self.theme.colors.get_color(
ft.ControlState.DEFAULT: self.theme.Colors.get_color(
"text_on_accent_primary"
),
ft.ControlState.HOVERED: self.theme.colors.get_color(
ft.ControlState.HOVERED: self.theme.Colors.get_color(
"text_on_accent_primary"
),
ft.ControlState.PRESSED: self.theme.colors.get_color(
ft.ControlState.PRESSED: self.theme.Colors.get_color(
"text_on_accent_secondary"
),
ft.ControlState.DISABLED: self.theme.colors.get_color(
ft.ControlState.DISABLED: self.theme.Colors.get_color(
"text_on_accent_disabled"
),
},
Expand Down Expand Up @@ -154,9 +154,9 @@ def __init__(
),
font_family=self.design_system.font_families.font_family_text,
color=(
self.theme.colors.get_color("text_disabled")
self.theme.Colors.get_color("text_disabled")
if disabled
else self.theme.colors.get_color("text_primary")
else self.theme.Colors.get_color("text_primary")
),
)
)
Expand All @@ -167,7 +167,7 @@ def __init__(
self.on_hover = self._on_hover if not disabled else None

def update_theme(self, is_dark_mode: bool):
"""Update checkbox theme colors"""
"""Update checkbox theme Colors"""
self.theme = (
self.design_system.dark_theme
if is_dark_mode
Expand Down Expand Up @@ -204,26 +204,26 @@ def update_theme(self, is_dark_mode: bool):
),
},
"checked_bgcolor": {
ft.ControlState.DEFAULT: self.theme.colors.get_color("accent_default"),
ft.ControlState.HOVERED: self.theme.colors.get_color(
ft.ControlState.DEFAULT: self.theme.Colors.get_color("accent_default"),
ft.ControlState.HOVERED: self.theme.Colors.get_color(
"accent_secondary"
),
ft.ControlState.PRESSED: self.theme.colors.get_color("accent_tertiary"),
ft.ControlState.DISABLED: self.theme.colors.get_color(
ft.ControlState.PRESSED: self.theme.Colors.get_color("accent_tertiary"),
ft.ControlState.DISABLED: self.theme.Colors.get_color(
"accent_disabled"
),
},
"check_color": {
ft.ControlState.DEFAULT: self.theme.colors.get_color(
ft.ControlState.DEFAULT: self.theme.Colors.get_color(
"text_on_accent_primary"
),
ft.ControlState.HOVERED: self.theme.colors.get_color(
ft.ControlState.HOVERED: self.theme.Colors.get_color(
"text_on_accent_primary"
),
ft.ControlState.PRESSED: self.theme.colors.get_color(
ft.ControlState.PRESSED: self.theme.Colors.get_color(
"text_on_accent_secondary"
),
ft.ControlState.DISABLED: self.theme.colors.get_color(
ft.ControlState.DISABLED: self.theme.Colors.get_color(
"text_on_accent_disabled"
),
},
Expand Down
2 changes: 1 addition & 1 deletion fluentflet/components/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def initialize_dialog(self):
shadow=ft.BoxShadow(
spread_radius=1,
blur_radius=15,
color=ft.colors.with_opacity(0.3, "black"),
color=ft.Colors.with_opacity(0.3, "black"),
offset=ft.Offset(0, 4),
),
animate=ft.animation.Animation(200, ft.AnimationCurve.EASE_IN_OUT),
Expand Down
16 changes: 8 additions & 8 deletions fluentflet/components/dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(
def _setup_dropdown(self):
"""Initialize the dropdown UI components"""
self.dropdown_icon = ft.Icon(
name=ft.icons.ARROW_DROP_DOWN_ROUNDED, color=ft.colors.WHITE, size=16
name=ft.icons.ARROW_DROP_DOWN_ROUNDED, color=ft.Colors.WHITE, size=16
)

self.dropdown_button = ft.GestureDetector(
Expand Down Expand Up @@ -74,7 +74,7 @@ def handle_item_click(e):
return ft.Container(
content=ft.Text(
text,
color=ft.colors.with_opacity(1, "#ffffff"),
color=ft.Colors.with_opacity(1, "#ffffff"),
size=14,
no_wrap=True,
overflow=ft.TextOverflow.ELLIPSIS,
Expand All @@ -90,11 +90,11 @@ def _handle_item_hover(self, e: ft.HoverEvent) -> None:
"""Handle hover states for dropdown items"""
container = e.control
is_hover = e.data == "true"
container.bgcolor = ft.colors.with_opacity(0.7, "#37393b") if is_hover else None
container.bgcolor = ft.Colors.with_opacity(0.7, "#37393b") if is_hover else None
container.content.color = (
ft.colors.with_opacity(1, "#ffffff")
ft.Colors.with_opacity(1, "#ffffff")
if is_hover
else ft.colors.with_opacity(1, "#ffffff")
else ft.Colors.with_opacity(1, "#ffffff")
)
container.update()

Expand All @@ -104,16 +104,16 @@ def _create_dropdown_list(self) -> ft.Container:

return ft.Container(
content=ft.ListView(items, spacing=2),
# bgcolor=ft.colors.with_opacity(0.061, "#ffffff"),
# bgcolor=ft.Colors.with_opacity(0.061, "#ffffff"),
bgcolor="#2d2d2d",
border=ft.border.all(1, ft.colors.with_opacity(0.8, ft.colors.BLACK)),
border=ft.border.all(1, ft.Colors.with_opacity(0.8, ft.Colors.BLACK)),
border_radius=8,
padding=5,
width=self.max_width,
shadow=ft.BoxShadow(
spread_radius=-1,
blur_radius=3,
color=ft.colors.with_opacity(0.2, ft.colors.BLACK),
color=ft.Colors.with_opacity(0.2, ft.Colors.BLACK),
offset=ft.Offset(0, 2),
),
animate=ft.animation.Animation(
Expand Down
Loading