@@ -152,40 +152,48 @@ namespace Dc {
152152 var entry = find_chat_entry (chat_store, chat_id);
153153 if (entry != null ) is_pinned = entry. is_pinned;
154154
155- var menu = new GLib .Menu ();
156- menu. append (is_pinned ? " Unpin" : " Pin" , " win.chat-pin" );
157- menu. append (" Chat Info" , " win.chat-info" );
158- menu. append (" Delete for Me" , " win.chat-delete" );
155+ var popover = new Gtk .Popover ();
156+ popover. has_arrow = false ;
157+ popover. set_parent (parent);
158+ popover. set_pointing_to ({ (int ) x, (int ) y, 1 , 1 });
159+
160+ var box = new Gtk .Box (Gtk . Orientation . VERTICAL , 0 );
161+ box. add_css_class (" menu" );
159162
160- var pin_action = new SimpleAction (" chat-pin" , null );
161- pin_action. activate. connect (() = > {
163+ var pin_btn = make_menu_button (is_pinned ? " Unpin" : " Pin" );
164+ pin_btn. clicked. connect (() = > {
165+ popover. popdown ();
162166 toggle_pin. begin (chat_id, is_pinned);
163167 });
164- var info_action = new SimpleAction (" chat-info" , null );
165- info_action. activate. connect (() = > {
168+ box. append (pin_btn);
169+
170+ var info_btn = make_menu_button (" Chat Info" );
171+ info_btn. clicked. connect (() = > {
172+ popover. popdown ();
166173 show_info. begin (chat_id);
167174 });
168- var delete_action = new SimpleAction (" chat-delete" , null );
169- delete_action. activate. connect (() = > {
175+ box. append (info_btn);
176+
177+ var del_btn = make_menu_button (" Delete for Me" );
178+ del_btn. clicked. connect (() = > {
179+ popover. popdown ();
170180 confirm_delete. begin (chat_id);
171181 });
182+ box. append (del_btn);
172183
173- window. add_action (pin_action);
174- window. add_action (info_action);
175- window. add_action (delete_action);
176-
177- var popover = new Gtk .PopoverMenu .from_model (menu);
178- popover. set_parent (parent);
179- popover. set_pointing_to ({ (int ) x, (int ) y, 1 , 1 });
180- popover. closed. connect (() = > {
181- window. remove_action (" chat-pin" );
182- window. remove_action (" chat-info" );
183- window. remove_action (" chat-delete" );
184- popover. unparent ();
185- });
184+ popover. child = box;
185+ popover. closed. connect (() = > { popover. unparent (); });
186186 popover. popup ();
187187 }
188188
189+ private static Gtk .Button make_menu_button (string label ) {
190+ var btn = new Gtk .Button .with_label (label);
191+ btn. add_css_class (" flat" );
192+ ((Gtk . Label ) btn. child). xalign = 0 ;
193+ ((Gtk . Label ) btn. child). halign = Gtk . Align . START ;
194+ return btn;
195+ }
196+
189197 private async void toggle_pin (int chat_id , bool currently_pinned ) {
190198 try {
191199 string visibility = currently_pinned ? " Normal" : " Pinned" ;
0 commit comments