| 1195 |
1196 |
| 1196 g_return_if_fail(GTK_IS_MENU(menu)); |
1197 g_return_if_fail(GTK_IS_MENU(menu)); |
| 1197 |
1198 |
| 1198 widget = GTK_WIDGET(menu); |
1199 widget = GTK_WIDGET(menu); |
| 1199 screen = gtk_widget_get_screen(widget); |
1200 screen = gtk_widget_get_screen(widget); |
| 1200 xthickness = gtk_widget_get_style(widget)->xthickness; |
1201 context = gtk_widget_get_style_context(widget); |
| 1201 ythickness = gtk_widget_get_style(widget)->ythickness; |
1202 gtk_style_context_get(context, gtk_style_context_get_state(context), |
| |
1203 "xthickness", &xthickness, |
| |
1204 "ythickness", &ythickness, NULL); |
| 1202 rtl = (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL); |
1205 rtl = (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL); |
| 1203 |
1206 |
| 1204 /* |
1207 /* |
| 1205 * We need the requisition to figure out the right place to |
1208 * We need the requisition to figure out the right place to |
| 1206 * popup the menu. In fact, we always need to ask here, since |
1209 * popup the menu. In fact, we always need to ask here, since |
| 1334 GtkWidget *widget = GTK_WIDGET(data); |
1337 GtkWidget *widget = GTK_WIDGET(data); |
| 1335 GtkTreeView *tv = GTK_TREE_VIEW(data); |
1338 GtkTreeView *tv = GTK_TREE_VIEW(data); |
| 1336 GtkTreePath *path; |
1339 GtkTreePath *path; |
| 1337 GtkTreeViewColumn *col; |
1340 GtkTreeViewColumn *col; |
| 1338 GdkRectangle rect; |
1341 GdkRectangle rect; |
| 1339 gint ythickness = gtk_widget_get_style(GTK_WIDGET(menu))->ythickness; |
1342 GtkStyleContext *context; |
| 1340 |
1343 gint ythickness; |
| |
1344 |
| |
1345 context = gtk_widget_get_style_context(GTK_WIDGET(menu)); |
| |
1346 gtk_style_context_get(context, gtk_style_context_get_state(context), |
| |
1347 "ythickness", &ythickness, NULL); |
| 1341 gdk_window_get_origin (gtk_widget_get_window(widget), x, y); |
1348 gdk_window_get_origin (gtk_widget_get_window(widget), x, y); |
| 1342 gtk_tree_view_get_cursor (tv, &path, &col); |
1349 gtk_tree_view_get_cursor (tv, &path, &col); |
| 1343 gtk_tree_view_get_cell_area (tv, path, col, &rect); |
1350 gtk_tree_view_get_cell_area (tv, path, col, &rect); |
| 1344 |
1351 |
| 1345 *x += rect.x+rect.width; |
1352 *x += rect.x+rect.width; |
| 2791 pixels[height * rowstride - 9] = 0xC0; |
2798 pixels[height * rowstride - 9] = 0xC0; |
| 2792 } |
2799 } |
| 2793 |
2800 |
| 2794 const char *pidgin_get_dim_grey_string(GtkWidget *widget) { |
2801 const char *pidgin_get_dim_grey_string(GtkWidget *widget) { |
| 2795 static char dim_grey_string[8] = ""; |
2802 static char dim_grey_string[8] = ""; |
| 2796 GtkStyle *style; |
2803 GtkStyleContext *context; |
| |
2804 GdkRGBA fg, bg; |
| 2797 |
2805 |
| 2798 if (!widget) |
2806 if (!widget) |
| 2799 return "dim grey"; |
2807 return "dim grey"; |
| 2800 |
2808 |
| 2801 style = gtk_widget_get_style(widget); |
2809 context = gtk_widget_get_style_context(widget); |
| 2802 if (!style) |
2810 if (!context) |
| 2803 return "dim grey"; |
2811 return "dim grey"; |
| 2804 |
2812 |
| |
2813 gtk_style_context_get_color(context, gtk_style_context_get_state(context), |
| |
2814 &fg); |
| |
2815 gtk_style_context_get_background_color(context, |
| |
2816 gtk_style_context_get_state(context), |
| |
2817 &bg); |
| 2805 snprintf(dim_grey_string, sizeof(dim_grey_string), "#%02x%02x%02x", |
2818 snprintf(dim_grey_string, sizeof(dim_grey_string), "#%02x%02x%02x", |
| 2806 style->text_aa[GTK_STATE_NORMAL].red >> 8, |
2819 (unsigned int)((fg.red + bg.red) * 0.5 * 255), |
| 2807 style->text_aa[GTK_STATE_NORMAL].green >> 8, |
2820 (unsigned int)((fg.green + bg.green) * 0.5 * 255), |
| 2808 style->text_aa[GTK_STATE_NORMAL].blue >> 8); |
2821 (unsigned int)((fg.blue + bg.blue) * 0.5 * 255)); |
| 2809 return dim_grey_string; |
2822 return dim_grey_string; |
| 2810 } |
2823 } |
| 2811 |
2824 |
| 2812 static void |
2825 static void |
| 2813 combo_box_changed_cb(GtkComboBoxText *combo_box, GtkEntry *entry) |
2826 combo_box_changed_cb(GtkComboBoxText *combo_box, GtkEntry *entry) |