summaryrefslogtreecommitdiffstats
path: root/redhat/applications/gtk-qt-engine/1387965535:0330b848db129b3dc4daa2a57272ec3b2fb7984c.diff
blob: 66b20659127f80cc3e8e508ceb059ac5c139a24c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
commit 0330b848db129b3dc4daa2a57272ec3b2fb7984c
Author: Timothy Pearson <[email protected]>
Date:   1387965535 -0600

    Fix Firefox text edit widget glitches
    Clean up minor build warnings

diff --git a/src/qt_theme_draw.c b/src/qt_theme_draw.c
index 4a2ee12..c7992d5 100644
--- a/src/qt_theme_draw.c
+++ b/src/qt_theme_draw.c
@@ -29,7 +29,7 @@
 extern gboolean tde_showIconsOnPushButtons;
 
 static GdkPixbuf * (*stockRenderIcon)() = NULL;
-static void * (*stockDrawString)() = NULL;
+// static void * (*stockDrawString)() = NULL;
 
 static void qtengine_style_init       (QtEngineStyle      *style);
 static void qtengine_style_class_init (QtEngineStyleClass *klass);
@@ -128,13 +128,17 @@ draw_hline(GtkStyle* style,
            gint x2,
            gint y)
 {
-	if (gtkQtDebug)
+	if (gtkQtDebug) {
 		printf("HLINE (%d,%p,%d) Widget: %s  Detail: %s\n",x1,y1,y,gtk_widget_get_name(widget),detail);
+	}
 
-	if (DETAIL("vscale"))
+	if (DETAIL("vscale")) {
 		return;
+	}
 
+	if (area) gdk_gc_set_clip_rectangle(style->bg_gc[state_type], area);
 	drawHLine(window,style,state_type,y,x1,x2);
+	if (area) gdk_gc_set_clip_rectangle(style->bg_gc[state_type], NULL);
 }
 
 
@@ -149,13 +153,17 @@ draw_vline(GtkStyle* style,
            gint yDest,
            gint x)
 {
-	if (gtkQtDebug)
+	if (gtkQtDebug) {
 		printf("VLINE (%d,%d,%d) Widget: %s  Detail: %s\n",ySource ,yDest ,x,gtk_widget_get_name(widget),detail);
+	}
 
 
-	if (DETAIL("hscale"))
+	if (DETAIL("hscale")) {
 		return;
+	}
+	if (area) gdk_gc_set_clip_rectangle(style->bg_gc[state_type], area);
 	drawVLine(window,style,state_type,x,ySource,yDest);
+	if (area) gdk_gc_set_clip_rectangle(style->bg_gc[state_type], NULL);
 }
 
 static void
@@ -192,7 +200,9 @@ draw_shadow(GtkStyle     *style,
 		return;
 	if (DETAIL("entry"))
 	{
+		if (area) gdk_gc_set_clip_rectangle(style->bg_gc[state_type], area);
 		drawLineEdit(window,style,state_type,gtk_widget_is_focus(widget),x,y,width,height);
+		if (area) gdk_gc_set_clip_rectangle(style->bg_gc[state_type], NULL);
 		return;
 	}
 	if (DETAIL("frame") || DETAIL("trough") || DETAIL("viewport"))
@@ -200,7 +210,9 @@ draw_shadow(GtkStyle     *style,
 		if (!GTK_IS_SCALE(widget))
 		{
 			/*printf("Frame (%d,%d) %dx%d   %d %d\n", x,y,width,height,state_type, shadow_type);*/
+			if (area) gdk_gc_set_clip_rectangle(style->bg_gc[state_type], area);
 			drawFrame(window,style,state_type,shadow_type,x,y,width,height);
+			if (area) gdk_gc_set_clip_rectangle(style->bg_gc[state_type], NULL);
 			return;
 		}
 	}
@@ -644,20 +656,20 @@ draw_diamond(GtkStyle * style,
 {
 }
 
-static void
-draw_string(GtkStyle		*style,
-				 GdkWindow		*window,
-				 GtkStateType		 state_type,
-				 GdkRectangle		*area,
-				 GtkWidget		*widget,
-				 const gchar		*detail,
-				 gint			 x,
-				 gint			 y,
-				 const gchar		*string)
-{
-	if (gtkQtDebug)
-		printf("STRING Widget: %s  Detail: %s\n",gtk_widget_get_name(widget),detail);
-}
+// static void
+// draw_string(GtkStyle		*style,
+// 				 GdkWindow		*window,
+// 				 GtkStateType		 state_type,
+// 				 GdkRectangle		*area,
+// 				 GtkWidget		*widget,
+// 				 const gchar		*detail,
+// 				 gint			 x,
+// 				 gint			 y,
+// 				 const gchar		*string)
+// {
+// 	if (gtkQtDebug)
+// 		printf("STRING Widget: %s  Detail: %s\n",gtk_widget_get_name(widget),detail);
+// }
 
 static void
 draw_box(GtkStyle * style,
@@ -1464,13 +1476,11 @@ void  draw_layout  (GtkStyle *style,
 			PangoAttrList *layoutattr;
 		
 			const gchar *text;
-			gint text_length = 0;
 			gint text_bytelen = 0;
 			text = pango_layout_get_text (layout);
 			if (text != 0)
 			{
 				PangoAttribute *textcolorattr;
-				text_length = g_utf8_strlen (text, -1);
 				text_bytelen = strlen (text);
 				
 				textcolorattr = pango_attr_foreground_new(color.red, color.green, color.blue);
@@ -2040,7 +2050,7 @@ qtengine_style_class_init (QtEngineStyleClass *klass)
 	parent_class = g_type_class_peek_parent (klass);
 
 	stockRenderIcon = style_class->render_icon;
-	stockDrawString = style_class->draw_string;
+// 	stockDrawString = style_class->draw_string;
 
 	style_class->render_icon = draw_icon;