@@ -74,20 +74,7 @@ impl Window {
7474 let menu_button = gtk:: MenuButton :: new ( ) ;
7575 menu_button. set_primary ( true ) ;
7676 menu_button. set_icon_name ( "open-menu" ) ;
77- let menu_model = gio:: Menu :: new ( ) ;
78-
79- let menu_model_bookmarks = gio:: Menu :: new ( ) ;
80- menu_model_bookmarks. insert ( 0 , Some ( "All Bookmarks" ) , Some ( "win.show-bookmarks" ) ) ;
81- menu_model_bookmarks. insert ( 1 , Some ( "Add Bookmark" ) , Some ( "win.bookmark-current" ) ) ;
82- menu_model. insert_section ( 0 , None , & menu_model_bookmarks) ;
83-
84- let menu_model_about = gio:: Menu :: new ( ) ;
85- menu_model_about. insert ( 1 , Some ( "Keyboard Shortcuts" ) , Some ( "win.shortcuts" ) ) ;
86- menu_model_about. insert ( 2 , Some ( "About" ) , Some ( "win.about" ) ) ;
87- menu_model_about. insert ( 3 , Some ( "Donate 💝" ) , Some ( "win.donate" ) ) ;
88- menu_model. insert_section ( 1 , None , & menu_model_about) ;
89-
90- menu_button. set_menu_model ( Some ( & menu_model) ) ;
77+ menu_button. set_menu_model ( Some ( & Self :: build_menu_common ( ) ) ) ;
9178
9279 header_bar. pack_start ( & imp. back_btn ) ;
9380 header_bar. pack_start ( & imp. add_tab_btn ) ;
@@ -106,14 +93,31 @@ impl Window {
10693 let overlay = gtk:: Overlay :: new ( ) ;
10794 let content_view = gtk:: Box :: new ( gtk:: Orientation :: Vertical , 0 ) ;
10895 overlay. set_child ( Some ( & content_view) ) ;
96+
97+ imp. tab_bar . set_view ( Some ( & imp. tab_view ) ) ;
98+ content_view. append ( & imp. tab_bar ) ;
99+ content_view. append ( & imp. tab_view ) ;
100+
109101 imp. progress_bar . add_css_class ( "osd" ) ;
110102 imp. progress_bar . set_valign ( gtk:: Align :: Start ) ;
111103 overlay. add_overlay ( & imp. progress_bar ) ;
112104 content. append ( & overlay) ;
113105
114- imp. tab_bar . set_view ( Some ( & imp. tab_view ) ) ;
115- content_view. append ( & imp. tab_bar ) ;
116- content_view. append ( & imp. tab_view ) ;
106+ let bottom_bar = adw:: HeaderBar :: new ( ) ;
107+ let bottom_entry = gtk:: SearchEntry :: new ( ) ;
108+ bottom_entry. set_hexpand ( true ) ;
109+ bottom_bar. set_title_widget ( Some ( & bottom_entry) ) ;
110+ let bottom_menu = gtk:: MenuButton :: new ( ) ;
111+ let bottom_menu_model = Self :: build_menu_common ( ) ;
112+ let section = gio:: Menu :: new ( ) ;
113+ section. append ( Some ( "Back" ) , Some ( "win.back" ) ) ;
114+ section. append ( Some ( "New Tab" ) , Some ( "win.new-tab" ) ) ;
115+ bottom_menu_model. append_section ( None , & section) ;
116+ bottom_menu. set_menu_model ( Some ( & bottom_menu_model) ) ;
117+ bottom_menu. set_icon_name ( "open-menu" ) ;
118+ bottom_bar. pack_end ( & bottom_menu) ;
119+
120+ content. append ( & bottom_bar) ;
117121
118122 this. set_default_size ( 800 , 600 ) ;
119123 this. set_content ( Some ( & content) ) ;
@@ -124,6 +128,21 @@ impl Window {
124128 this
125129 }
126130
131+ fn build_menu_common ( ) -> gio:: Menu {
132+ let menu_model = gio:: Menu :: new ( ) ;
133+
134+ let menu_model_bookmarks = gio:: Menu :: new ( ) ;
135+ menu_model_bookmarks. append ( Some ( "All Bookmarks" ) , Some ( "win.show-bookmarks" ) ) ;
136+ menu_model_bookmarks. append ( Some ( "Add Bookmark" ) , Some ( "win.bookmark-current" ) ) ;
137+ menu_model. insert_section ( 0 , None , & menu_model_bookmarks) ;
138+
139+ let menu_model_about = gio:: Menu :: new ( ) ;
140+ menu_model_about. append ( Some ( "Keyboard Shortcuts" ) , Some ( "win.shortcuts" ) ) ;
141+ menu_model_about. append ( Some ( "About" ) , Some ( "win.about" ) ) ;
142+ menu_model_about. append ( Some ( "Donate 💝" ) , Some ( "win.donate" ) ) ;
143+ menu_model. insert_section ( 1 , None , & menu_model_about) ;
144+ menu_model
145+ }
127146 fn setup_actions ( & self ) {
128147 self_action ! ( self , "back" , back) ;
129148 self_action ! ( self , "new-tab" , add_tab_focused) ;
0 commit comments