fix: update snackbar message color

This commit is contained in:
ihmily
2026-04-30 15:39:39 +08:00
parent 6f99fbd079
commit 2e1f60f9f4
3 changed files with 12 additions and 12 deletions

View File

@@ -323,7 +323,7 @@ class RecordingCardManager:
await self.app.record_manager.check_if_live(recording)
if recording.is_live:
self.app.record_manager.start_update(recording)
await self.app.snack_bar.show_snack_bar(self._["pre_record_tip"], bgcolor=ft.Colors.GREEN)
await self.app.snack_bar.show_snack_bar(self._["pre_record_tip"], bgcolor=ft.Colors.PRIMARY)
else:
await self.app.snack_bar.show_snack_bar(self._["is_not_live_tip"])
else:
@@ -340,7 +340,7 @@ class RecordingCardManager:
return
await self.app.record_manager.delete_recording_cards([recording])
await self.app.snack_bar.show_snack_bar(
self._["delete_recording_success_tip"], bgcolor=ft.Colors.GREEN, duration=2000
self._["delete_recording_success_tip"], bgcolor=ft.Colors.PRIMARY, duration=2000
)
async def remove_recording_card(self, recordings: list[Recording]):

View File

@@ -540,7 +540,7 @@ class RecordingsPage(PageBase):
self.content_area.controls[1] = self.create_filter_area()
self.content_area.update()
await self.app.snack_bar.show_snack_bar(self._["add_recording_success_tip"], bgcolor=ft.Colors.GREEN)
await self.app.snack_bar.show_snack_bar(self._["add_recording_success_tip"], bgcolor=ft.Colors.PRIMARY)
async def search_on_click(self, _e):
"""Open the search dialog when the search button is clicked."""
@@ -583,17 +583,17 @@ class RecordingsPage(PageBase):
self.loading_indicator.visible = False
self.loading_indicator.update()
await self.app.snack_bar.show_snack_bar(self._["refresh_success_tip"], bgcolor=ft.Colors.GREEN)
await self.app.snack_bar.show_snack_bar(self._["refresh_success_tip"], bgcolor=ft.Colors.PRIMARY)
async def start_monitor_recordings_on_click(self, _):
await self.app.record_manager.check_free_space()
if self.app.recording_enabled:
await self.app.record_manager.start_monitor_recordings()
await self.app.snack_bar.show_snack_bar(self._["start_recording_success_tip"], bgcolor=ft.Colors.GREEN)
await self.app.snack_bar.show_snack_bar(self._["start_recording_success_tip"], bgcolor=ft.Colors.PRIMARY)
async def stop_monitor_recordings_on_click(self, _):
await self.app.record_manager.stop_monitor_recordings()
await self.app.snack_bar.show_snack_bar(self._["stop_recording_success_tip"])
await self.app.snack_bar.show_snack_bar(self._["stop_recording_success_tip"], bgcolor=ft.Colors.PRIMARY)
async def delete_monitor_recordings_on_click(self, _):
selected_recordings = await self.app.record_manager.get_selected_recordings()
@@ -615,7 +615,7 @@ class RecordingsPage(PageBase):
self.recording_card_area.update()
await self.app.snack_bar.show_snack_bar(
self._["delete_recording_success_tip"], bgcolor=ft.Colors.GREEN, duration=2000
self._["delete_recording_success_tip"], bgcolor=ft.Colors.PRIMARY, duration=2000
)
await close_dialog(None)

View File

@@ -139,7 +139,7 @@ class SettingsPage(PageBase):
self.page.run_task(self.load)
await self.config_manager.save_user_config(self.user_config)
logger.success("Default configuration restored.")
await self.app.snack_bar.show_snack_bar(self._["success_restore_tip"], bgcolor=ft.Colors.GREEN)
await self.app.snack_bar.show_snack_bar(self._["success_restore_tip"], bgcolor=ft.Colors.PRIMARY)
await close_dialog(None)
async def close_dialog(_):
@@ -1312,7 +1312,7 @@ class SettingsPage(PageBase):
if show_snack_bar:
await self.app.snack_bar.show_snack_bar(
self._["success_save_config_tip"], duration=1500, bgcolor=ft.Colors.GREEN
self._["success_save_config_tip"], duration=1500, bgcolor=ft.Colors.PRIMARY
)
async def on_keyboard(self, e: ft.KeyboardEvent):
@@ -1356,7 +1356,7 @@ class SettingsPage(PageBase):
new_password_field.update()
confirm_password_field.update()
await self.app.snack_bar.show_snack_bar(self._["password_changed"], bgcolor=ft.Colors.GREEN)
await self.app.snack_bar.show_snack_bar(self._["password_changed"], bgcolor=ft.Colors.PRIMARY)
else:
await self.app.snack_bar.show_snack_bar(self._["old_password_incorrect"], bgcolor=ft.Colors.RED)
else:
@@ -1368,9 +1368,9 @@ class SettingsPage(PageBase):
await self.config_manager.save_user_config(self.user_config)
if login_required:
await self.app.snack_bar.show_snack_bar(self._["login_required_enabled"], bgcolor=ft.Colors.GREEN)
await self.app.snack_bar.show_snack_bar(self._["login_required_enabled"], bgcolor=ft.Colors.PRIMARY)
else:
await self.app.snack_bar.show_snack_bar(self._["login_required_disabled"], bgcolor=ft.Colors.GREEN)
await self.app.snack_bar.show_snack_bar(self._["login_required_disabled"], bgcolor=ft.Colors.PRIMARY)
username = self.app.current_username or "admin"