A multilingual input method framework
Revision | ab0a7f99209b50c00a1f69851283590a7912532c (tree) |
---|---|
Time | 2013-11-10 17:22:15 |
Author | Muneyuki Noguchi <nogu.dev@gmai...> |
Commiter | Muneyuki Noguchi |
Use gtk_widget_queue_draw() to redraw buttons.
* gtk2/candwin/horizontal-gtk.c
* gtk2/immodule/uim-cand-win-horizontal-gtk.c
@@ -349,8 +349,7 @@ button_clicked(GtkEventBox *button, GdkEventButton *event, gpointer data) | ||
349 | 349 | prev_selected = cwin->selected; |
350 | 350 | if (prev_selected) { |
351 | 351 | GtkWidget *label = gtk_bin_get_child(GTK_BIN(prev_selected->button)); |
352 | - gtk_widget_unmap(label); | |
353 | - gtk_widget_map(label); | |
352 | + gtk_widget_queue_draw(label); | |
354 | 353 | } |
355 | 354 | |
356 | 355 | for (i = 0; i < (gint)cwin->buttons->len; i++) { |
@@ -364,8 +363,7 @@ button_clicked(GtkEventBox *button, GdkEventButton *event, gpointer data) | ||
364 | 363 | if (p == button) { |
365 | 364 | GtkWidget *label = gtk_bin_get_child(GTK_BIN(button)); |
366 | 365 | idx = idxbutton->cand_index_in_page; |
367 | - gtk_widget_unmap(label); | |
368 | - gtk_widget_map(label); | |
366 | + gtk_widget_queue_draw(label); | |
369 | 367 | cwin->selected = idxbutton; |
370 | 368 | break; |
371 | 369 | } |
@@ -1040,12 +1038,10 @@ uim_cand_win_gtk_set_index(UIMCandidateWindow *cwin, gint index) | ||
1040 | 1038 | prev_selected = (gpointer)cwin->selected; |
1041 | 1039 | if (prev_selected && prev_index != cwin->candidate_index) { |
1042 | 1040 | label = gtk_bin_get_child(GTK_BIN(prev_selected->button)); |
1043 | - gtk_widget_unmap(label); | |
1044 | - gtk_widget_map(label); | |
1041 | + gtk_widget_queue_draw(label); | |
1045 | 1042 | } |
1046 | 1043 | label = gtk_bin_get_child(GTK_BIN(idxbutton->button)); |
1047 | - gtk_widget_unmap(label); | |
1048 | - gtk_widget_map(label); | |
1044 | + gtk_widget_queue_draw(label); | |
1049 | 1045 | cwin->selected = idxbutton; |
1050 | 1046 | |
1051 | 1047 | /* show subwin */ |
@@ -298,8 +298,7 @@ button_clicked(GtkEventBox *button, GdkEventButton *event, gpointer data) | ||
298 | 298 | prev_selected = horizontal_cwin->selected; |
299 | 299 | if (prev_selected) { |
300 | 300 | GtkWidget *label = gtk_bin_get_child(GTK_BIN(prev_selected->button)); |
301 | - gtk_widget_unmap(label); | |
302 | - gtk_widget_map(label); | |
301 | + gtk_widget_queue_draw(label); | |
303 | 302 | } |
304 | 303 | |
305 | 304 | for (i = 0; i < (gint)horizontal_cwin->buttons->len; i++) { |
@@ -313,8 +312,7 @@ button_clicked(GtkEventBox *button, GdkEventButton *event, gpointer data) | ||
313 | 312 | if (p == button) { |
314 | 313 | GtkWidget *label = gtk_bin_get_child(GTK_BIN(button)); |
315 | 314 | idx = idxbutton->cand_index_in_page; |
316 | - gtk_widget_unmap(label); | |
317 | - gtk_widget_map(label); | |
315 | + gtk_widget_queue_draw(label); | |
318 | 316 | horizontal_cwin->selected = idxbutton; |
319 | 317 | break; |
320 | 318 | } |
@@ -454,12 +452,10 @@ uim_cand_win_horizontal_gtk_set_index(UIMCandWinHorizontalGtk *horizontal_cwin, | ||
454 | 452 | prev_selected = (gpointer)horizontal_cwin->selected; |
455 | 453 | if (prev_selected && prev_index != cwin->candidate_index) { |
456 | 454 | label = gtk_bin_get_child(GTK_BIN(prev_selected->button)); |
457 | - gtk_widget_unmap(label); | |
458 | - gtk_widget_map(label); | |
455 | + gtk_widget_queue_draw(label); | |
459 | 456 | } |
460 | 457 | label = gtk_bin_get_child(GTK_BIN(idxbutton->button)); |
461 | - gtk_widget_unmap(label); | |
462 | - gtk_widget_map(label); | |
458 | + gtk_widget_queue_draw(label); | |
463 | 459 | horizontal_cwin->selected = idxbutton; |
464 | 460 | |
465 | 461 | /* show subwin */ |