File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -636,16 +636,26 @@ impl Tab {
636636 status_page. set_description ( Some ( & glib:: markup_escape_text ( url. as_str ( ) ) ) ) ;
637637 status_page. set_icon_name ( Some ( "web-browser-symbolic" ) ) ;
638638
639+ let child = gtk:: Box :: new ( gtk:: Orientation :: Vertical , 8 ) ;
640+
639641 let button = gtk:: Button :: with_label ( "Open" ) ;
640642 button. add_css_class ( "suggested-action" ) ;
641643 button. add_css_class ( "pill" ) ;
642644 button. set_halign ( gtk:: Align :: Center ) ;
643- let url = url. clone ( ) ;
645+ let url_clone = url. clone ( ) ;
644646 button. connect_clicked ( move |_| {
645- gtk:: show_uri ( None :: < & gtk:: Window > , url . as_str ( ) , 0 ) ;
647+ gtk:: show_uri ( None :: < & gtk:: Window > , url_clone . as_str ( ) , 0 ) ;
646648 } ) ;
647649
648- status_page. set_child ( Some ( & button) ) ;
650+ child. append ( & button) ;
651+ let button = gtk:: Button :: with_label ( "Copy" ) ;
652+ button. add_css_class ( "pill" ) ;
653+ button. set_halign ( gtk:: Align :: Center ) ;
654+ button. set_action_name ( Some ( "win.set-clipboard" ) ) ;
655+ button. set_action_target_value ( Some ( & url. as_str ( ) . to_variant ( ) ) ) ;
656+ child. append ( & button) ;
657+
658+ status_page. set_child ( Some ( & child) ) ;
649659
650660 imp. stack . add_child ( & status_page) ;
651661 imp. stack . set_visible_child ( & status_page) ;
You can’t perform that action at this time.
0 commit comments