Commit 2b23d4640c0d8e4ea3e7b1eed3201e6951d09957
1 parent
ba1bc21f
Exists in
master
and in
4 other branches
Implementing keypad actions.
Showing
3 changed files
with
23 additions
and
17 deletions
Show diff stats
keypad/00-right.xml
| ... | ... | @@ -95,27 +95,27 @@ |
| 95 | 95 | |
| 96 | 96 | \ <button column='2' width='2'> |
| 97 | 97 | <attribute name="icon-name" translatable="no">gtk-go-up</attribute> |
| 98 | - <attribute name="action"></attribute> | |
| 98 | + <attribute name="action">win.up</attribute> | |
| 99 | 99 | </button> |
| 100 | 100 | |
| 101 | 101 | <button column='0' width='2'> |
| 102 | 102 | <attribute name="icon-name" translatable="no">gtk-go-back</attribute> |
| 103 | - <attribute name="action"></attribute> | |
| 103 | + <attribute name="action">win.left</attribute> | |
| 104 | 104 | </button> |
| 105 | 105 | |
| 106 | 106 | <button width='2'> |
| 107 | 107 | <attribute name="icon-name" translatable="no">gtk-goto-top</attribute> |
| 108 | - <attribute name="action"></attribute> | |
| 108 | + <attribute name="action">win.first-field</attribute> | |
| 109 | 109 | </button> |
| 110 | 110 | |
| 111 | 111 | <button width='2'> |
| 112 | 112 | <attribute name="icon-name" translatable="no">gtk-go-forward</attribute> |
| 113 | - <attribute name="action"></attribute> | |
| 113 | + <attribute name="action">win.right</attribute> | |
| 114 | 114 | </button> |
| 115 | 115 | |
| 116 | 116 | <button column='2' width='2'> |
| 117 | 117 | <attribute name="icon-name" translatable="no">gtk-go-down</attribute> |
| 118 | - <attribute name="action"></attribute> | |
| 118 | + <attribute name="action">win.down</attribute> | |
| 119 | 119 | </button> |
| 120 | 120 | |
| 121 | 121 | <button width='2' column='0'> |
| ... | ... | @@ -134,48 +134,48 @@ |
| 134 | 134 | </button> |
| 135 | 135 | |
| 136 | 136 | <button width='3'> |
| 137 | - <attribute name="icon-name" translatable="no">go-first</attribute> | |
| 138 | - <attribute name="action"></attribute> | |
| 137 | + <attribute name="icon-name">go-first</attribute> | |
| 138 | + <attribute name="action">win.previous-field</attribute> | |
| 139 | 139 | </button> |
| 140 | 140 | |
| 141 | 141 | <button width='3'> |
| 142 | - <attribute name="icon-name" translatable="no">go-last</attribute> | |
| 143 | - <attribute name="action"></attribute> | |
| 142 | + <attribute name="icon-name">go-last</attribute> | |
| 143 | + <attribute name="action">win.next-field</attribute> | |
| 144 | 144 | </button> |
| 145 | 145 | |
| 146 | 146 | <button width='3'> |
| 147 | 147 | <attribute name="label" translatable="Yes">Clear</attribute> |
| 148 | - <attribute name="action"></attribute> | |
| 148 | + <attribute name="action">win.clear</attribute> | |
| 149 | 149 | </button> |
| 150 | 150 | |
| 151 | 151 | <button width='3'> |
| 152 | 152 | <attribute name="label" translatable="Yes">Reset</attribute> |
| 153 | - <attribute name="action"></attribute> | |
| 153 | + <attribute name="action">win.kybdreset</attribute> | |
| 154 | 154 | </button> |
| 155 | 155 | |
| 156 | 156 | <button width='3'> |
| 157 | 157 | <attribute name="label" translatable="Yes">Erase\nEOF</attribute> |
| 158 | - <attribute name="action"></attribute> | |
| 158 | + <attribute name="action">win.erase-eof</attribute> | |
| 159 | 159 | </button> |
| 160 | 160 | |
| 161 | 161 | <button width='3'> |
| 162 | 162 | <attribute name="label" translatable="Yes">Erase\nInput</attribute> |
| 163 | - <attribute name="action"></attribute> | |
| 163 | + <attribute name="action">win.erase-input</attribute> | |
| 164 | 164 | </button> |
| 165 | 165 | |
| 166 | 166 | <button width='3'> |
| 167 | 167 | <attribute name="label" translatable="Yes">Attn</attribute> |
| 168 | - <attribute name="action"></attribute> | |
| 168 | + <attribute name="action">win.attn</attribute> | |
| 169 | 169 | </button> |
| 170 | 170 | |
| 171 | 171 | <button width='3'> |
| 172 | 172 | <attribute name="label" translatable="Yes">Break</attribute> |
| 173 | - <attribute name="action"></attribute> | |
| 173 | + <attribute name="action">win.break</attribute> | |
| 174 | 174 | </button> |
| 175 | 175 | |
| 176 | 176 | <button width='6'> |
| 177 | 177 | <attribute name="icon-name" translatable="no">gtk-ok</attribute> |
| 178 | - <attribute name="action"></attribute> | |
| 178 | + <attribute name="action">win.enter</attribute> | |
| 179 | 179 | </button> |
| 180 | 180 | |
| 181 | 181 | </keypad> | ... | ... |
src/objects/keypad/widget.c
| ... | ... | @@ -44,6 +44,10 @@ |
| 44 | 44 | button = gtk_button_new(); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | + if(element->action && *element->action) { | |
| 48 | + gtk_actionable_set_action_name(GTK_ACTIONABLE(button),g_intern_string(element->action)); | |
| 49 | + } | |
| 50 | + | |
| 47 | 51 | gtk_button_set_relief(GTK_BUTTON(button),GTK_RELIEF_NORMAL); |
| 48 | 52 | gtk_widget_set_can_focus(button,FALSE); |
| 49 | 53 | gtk_widget_set_can_default(button,FALSE); | ... | ... |
src/objects/window/window.c
| ... | ... | @@ -200,7 +200,9 @@ |
| 200 | 200 | // Create new tab action widget |
| 201 | 201 | GtkWidget * new_tab = gtk_button_new_from_icon_name("tab-new-symbolic",GTK_ICON_SIZE_LARGE_TOOLBAR); |
| 202 | 202 | gtk_button_set_relief(GTK_BUTTON(new_tab),GTK_RELIEF_NONE); |
| 203 | - gtk_actionable_set_action_name(GTK_ACTIONABLE(new_tab),"app.new.tab"); | |
| 203 | + gtk_actionable_set_action_name(GTK_ACTIONABLE(new_tab),g_intern_static_string("app.new.tab")); | |
| 204 | + | |
| 205 | + debug("*************[%s]",g_intern_static_string("app.new.tab")); | |
| 204 | 206 | |
| 205 | 207 | gtk_widget_set_margin_start(new_tab,6); |
| 206 | 208 | gtk_widget_set_margin_end(new_tab,6); | ... | ... |