Commit 821655b8206a8d404350a8583e1cf610958266fc
1 parent
4a5875a1
Exists in
master
and in
4 other branches
Implementing header buttons for the modern API.
Showing
2 changed files
with
21 additions
and
3 deletions
Show diff stats
src/objects/window/header.c
| ... | ... | @@ -41,6 +41,22 @@ |
| 41 | 41 | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | + /* | |
| 45 | + static gboolean bg_deactivate_button(GtkWidget *button) { | |
| 46 | + debug("******************** %s %p",__FUNCTION__,button) | |
| 47 | + return FALSE; | |
| 48 | + } | |
| 49 | + | |
| 50 | + static void on_state_flags_changed(GtkWidget *button, GtkStateFlags flags, gpointer user_data) { | |
| 51 | + | |
| 52 | + debug("%s(%p,%d)",__FUNCTION__,button,flags & GTK_STATE_FLAG_ACTIVE); | |
| 53 | + | |
| 54 | + if(flags & GTK_STATE_FLAG_ACTIVE) | |
| 55 | + g_idle_add((GSourceFunc) bg_deactivate_button, button); | |
| 56 | + | |
| 57 | + } | |
| 58 | + */ | |
| 59 | + | |
| 44 | 60 | GtkWidget * pw3270_header_button_new_from_builder(GtkWidget *widget, GtkBuilder * builder, const gchar *action_name) { |
| 45 | 61 | |
| 46 | 62 | GtkWidget * button = NULL; |
| ... | ... | @@ -66,8 +82,6 @@ |
| 66 | 82 | button = pw3270_setup_image_button(gtk_menu_button_new(),icon_name); |
| 67 | 83 | gtk_actionable_set_action_name(GTK_ACTIONABLE(button),action_name); |
| 68 | 84 | gtk_widget_set_visible(button,g_action_get_enabled(action)); |
| 69 | - | |
| 70 | - | |
| 71 | 85 | } |
| 72 | 86 | |
| 73 | 87 | } |
| ... | ... | @@ -75,8 +89,10 @@ |
| 75 | 89 | if(button) { |
| 76 | 90 | |
| 77 | 91 | g_signal_connect(button, "notify::sensitive", G_CALLBACK(on_sensitive), widget); |
| 92 | + // g_signal_connect(button,"state-flags-changed",G_CALLBACK(on_state_flags_changed), widget); | |
| 78 | 93 | gtk_widget_set_focus_on_click(button,FALSE); |
| 79 | 94 | gtk_widget_set_can_focus(button,FALSE); |
| 95 | + gtk_widget_set_can_default(button,FALSE); | |
| 80 | 96 | |
| 81 | 97 | } |
| 82 | 98 | ... | ... |
src/objects/window/window.c