Commit 450009f4e2fb8b7786edc38a95e30343885c828c
1 parent
857639f0
Exists in
master
and in
4 other branches
Adding action to toggle toolbar visibility.
Showing
2 changed files
with
10 additions
and
1 deletions
Show diff stats
src/objects/window/window.c
| @@ -83,7 +83,6 @@ | @@ -83,7 +83,6 @@ | ||
| 83 | g_signal_connect(G_OBJECT(widget->notebook), "page-removed", G_CALLBACK(on_page_changed), widget); | 83 | g_signal_connect(G_OBJECT(widget->notebook), "page-removed", G_CALLBACK(on_page_changed), widget); |
| 84 | 84 | ||
| 85 | widget->toolbar = GTK_TOOLBAR(pw3270_toolbar_new()); | 85 | widget->toolbar = GTK_TOOLBAR(pw3270_toolbar_new()); |
| 86 | - | ||
| 87 | gtk_box_pack_start(vBox,GTK_WIDGET(widget->toolbar),FALSE,TRUE,0); | 86 | gtk_box_pack_start(vBox,GTK_WIDGET(widget->toolbar),FALSE,TRUE,0); |
| 88 | gtk_box_pack_start(vBox,GTK_WIDGET(widget->notebook),TRUE,TRUE,0); | 87 | gtk_box_pack_start(vBox,GTK_WIDGET(widget->notebook),TRUE,TRUE,0); |
| 89 | 88 | ||
| @@ -164,6 +163,11 @@ | @@ -164,6 +163,11 @@ | ||
| 164 | pw3270_toolbar_insert_action(GTK_WIDGET(widget->toolbar),actions[ix],-1); | 163 | pw3270_toolbar_insert_action(GTK_WIDGET(widget->toolbar),actions[ix],-1); |
| 165 | } | 164 | } |
| 166 | 165 | ||
| 166 | + g_action_map_add_action( | ||
| 167 | + G_ACTION_MAP(widget), | ||
| 168 | + G_ACTION(g_property_action_new("toolbar", widget->toolbar, "visible")) | ||
| 169 | + ); | ||
| 170 | + | ||
| 167 | } | 171 | } |
| 168 | 172 | ||
| 169 | } | 173 | } |
ui/application.xml
| @@ -226,6 +226,11 @@ | @@ -226,6 +226,11 @@ | ||
| 226 | <attribute name="action">win.trace</attribute> | 226 | <attribute name="action">win.trace</attribute> |
| 227 | </item> | 227 | </item> |
| 228 | 228 | ||
| 229 | + <item> | ||
| 230 | + <attribute name="label" translatable="yes">Toolbar</attribute> | ||
| 231 | + <attribute name="action">win.toolbar</attribute> | ||
| 232 | + </item> | ||
| 233 | + | ||
| 229 | </submenu> | 234 | </submenu> |
| 230 | 235 | ||
| 231 | <submenu> | 236 | <submenu> |