Commit 5aea0ad1 authored by Michael Gratton's avatar Michael Gratton 🍸 Committed by Michael Gratton
Browse files

client: Invoke the correct menu for move or copy shortcuts

parent ef4269e1
......@@ -2332,11 +2332,25 @@ public class Application.MainWindow :
}
private void on_show_copy_menu() {
this.conversation_actions.copy_message_button.clicked();
if (this.is_conversation_list_shown &&
this.conversation_list_actions_revealer.child_revealed) {
this.conversation_list_actions.show_copy_menu();
} else if (this.is_conversation_viewer_shown) {
this.main_toolbar.shown_actions.show_copy_menu();
} else {
this.error_bell();
}
}
private void on_show_move_menu() {
this.conversation_actions.move_message_button.clicked();
if (this.is_conversation_list_shown &&
this.conversation_list_actions_revealer.child_revealed) {
this.conversation_list_actions.show_move_menu();
} else if (this.is_conversation_viewer_shown) {
this.main_toolbar.shown_actions.show_move_menu();
} else {
this.error_bell();
}
}
private void on_conversation_up() {
......
......@@ -70,6 +70,14 @@ public class Components.ConversationActions : Gtk.Box {
}
}
public void show_copy_menu() {
this.copy_message_button.clicked();
}
public void show_move_menu() {
this.move_message_button.clicked();
}
public void update_trash_button(bool show_trash) {
this.show_trash_button = show_trash;
update_conversation_buttons();
......
/*
* Copyright © 2017 Software Freedom Conservancy Inc.
* Copyright © 2021 Michael Gratton <mike@vee.net>
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
......@@ -25,6 +26,12 @@ public class Components.MainToolbar : Hdy.Leaflet {
public bool find_open { get; set; default = false; }
public ConversationActions shown_actions {
get {
return (ConversationActions) this.actions_squeezer.visible_child;
}
}
[GtkChild] public unowned ConversationActions full_actions;
[GtkChild] public unowned ConversationActions compact_actions;
......@@ -44,6 +51,7 @@ public class Components.MainToolbar : Hdy.Leaflet {
// Conversation viewer header elements
[GtkChild] private unowned Hdy.HeaderBar conversation_header;
[GtkChild] private unowned Hdy.Squeezer actions_squeezer;
[GtkChild] private unowned Gtk.ToggleButton find_button;
[GtkChild] private unowned Hdy.HeaderGroup header_group;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment