Annotation of /trunk/mozilla-firefox/patches/mozilla-firefox-1.0.7-tooltip-borders.patch
Parent Directory | Revision Log
Revision 153 -
(hide annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 1 month ago) by niro
File size: 2308 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 1 month ago) by niro
File size: 2308 byte(s)
-import
1 | niro | 153 | Index: embedding/browser/gtk/src/EmbedWindow.cpp |
2 | =================================================================== | ||
3 | RCS file: /cvsroot/mozilla/embedding/browser/gtk/src/EmbedWindow.cpp,v | ||
4 | retrieving revision 1.30 | ||
5 | diff -p -u -u -p -r1.30 EmbedWindow.cpp | ||
6 | --- embedding/browser/gtk/src/EmbedWindow.cpp 28 Jul 2004 20:54:50 -0000 1.30 | ||
7 | +++ embedding/browser/gtk/src/EmbedWindow.cpp 26 Oct 2004 13:12:27 -0000 | ||
8 | @@ -383,6 +383,19 @@ EmbedWindow::SetVisibility(PRBool aVisib | ||
9 | |||
10 | // nsITooltipListener | ||
11 | |||
12 | +static gint | ||
13 | +tooltips_paint_window(GtkWidget *window) | ||
14 | +{ | ||
15 | + // draw tooltip style border around the text | ||
16 | + gtk_paint_flat_box(window->style, window->window, | ||
17 | + GTK_STATE_NORMAL, GTK_SHADOW_OUT, | ||
18 | + NULL, window, "tooltip", | ||
19 | + 0, 0, | ||
20 | + window->allocation.width, window->allocation.height); | ||
21 | + | ||
22 | + return FALSE; | ||
23 | +} | ||
24 | + | ||
25 | NS_IMETHODIMP | ||
26 | EmbedWindow::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, | ||
27 | const PRUnichar *aTipText) | ||
28 | @@ -433,12 +446,15 @@ EmbedWindow::OnShowTooltip(PRInt32 aXCoo | ||
29 | // realize the widget | ||
30 | gtk_widget_realize(sTipWindow); | ||
31 | |||
32 | + gtk_signal_connect(GTK_OBJECT(sTipWindow), "expose_event", | ||
33 | + GTK_SIGNAL_FUNC(tooltips_paint_window), NULL); | ||
34 | + | ||
35 | // set up the label for the tooltip | ||
36 | GtkWidget *label = gtk_label_new(tipString); | ||
37 | // wrap automatically | ||
38 | gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | ||
39 | gtk_container_add(GTK_CONTAINER(sTipWindow), label); | ||
40 | - gtk_container_set_border_width(GTK_CONTAINER(sTipWindow), 3); | ||
41 | + gtk_container_set_border_width(GTK_CONTAINER(sTipWindow), 4); | ||
42 | // set the coords for the widget | ||
43 | gtk_widget_set_uposition(sTipWindow, aXCoords + root_x, | ||
44 | aYCoords + root_y); | ||
45 | @@ -446,13 +462,6 @@ EmbedWindow::OnShowTooltip(PRInt32 aXCoo | ||
46 | // and show it. | ||
47 | gtk_widget_show_all(sTipWindow); | ||
48 | |||
49 | - // draw tooltip style border around the text | ||
50 | - gtk_paint_flat_box(sTipWindow->style, sTipWindow->window, | ||
51 | - GTK_STATE_NORMAL, GTK_SHADOW_OUT, | ||
52 | - NULL, GTK_WIDGET(sTipWindow), "tooltip", | ||
53 | - 0, 0, | ||
54 | - sTipWindow->allocation.width, sTipWindow->allocation.height); | ||
55 | - | ||
56 | #ifdef MOZ_WIDGET_GTK | ||
57 | gtk_widget_popup(sTipWindow, aXCoords + root_x, aYCoords + root_y); | ||
58 | #endif /* MOZ_WIDGET_GTK */ |