@@ -269,14 +269,6 @@ class SubTitle(Static):
269269 pass
270270
271271
272- class Notification (Static ):
273- def on_mount (self ) -> None :
274- self .set_timer (3 , self .remove )
275-
276- def on_click (self ) -> None :
277- self .remove ()
278-
279-
280272class DemoApp (App [None ]):
281273 CSS_PATH = "demo.css"
282274 TITLE = "Textual Demo"
@@ -285,7 +277,7 @@ class DemoApp(App[None]):
285277 ("ctrl+t" , "app.toggle_dark" , "Toggle Dark mode" ),
286278 ("ctrl+s" , "app.screenshot()" , "Screenshot" ),
287279 ("f1" , "app.toggle_class('RichLog', '-hidden')" , "Notes" ),
288- Binding ("ctrl+c,ctrl+ q" , "app.quit" , "Quit" , show = True ),
280+ Binding ("ctrl+q" , "app.quit" , "Quit" , show = True ),
289281 ]
290282
291283 show_sidebar = reactive (False )
@@ -390,9 +382,9 @@ def action_screenshot(self, filename: str | None = None, path: str = "./") -> No
390382 """
391383 self .bell ()
392384 path = self .save_screenshot (filename , path )
393- message = Text . assemble ( "Screenshot saved to " , ( f" '{ path } '" , "bold green" ))
394- self .add_note (message )
395- self .screen . mount ( Notification ( message ) )
385+ message = f "Screenshot saved to [bold green] '{ path } '[/]"
386+ self .add_note (Text . from_markup ( message ) )
387+ self .notify ( message )
396388
397389
398390app = DemoApp ()
0 commit comments