Bug 15254 - [gtk] implement theme-aware drawing of text field or text area
Summary: [gtk] implement theme-aware drawing of text field or text area
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC Linux
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-21 18:39 PDT by Jan Alonzo
Modified: 2007-09-29 08:53 PDT (History)
0 users

See Also:


Attachments
implement theme-aware drawing of text fields and text area (3.01 KB, patch)
2007-09-21 18:42 PDT, Jan Alonzo
aroben: review-
Details | Formatted Diff | Diff
theme drawing of text entries (3.05 KB, patch)
2007-09-22 14:50 PDT, Jan Alonzo
aroben: review+
Details | Formatted Diff | Diff
gtk theme-based drawing of text entries (3.10 KB, patch)
2007-09-28 15:25 PDT, Jan Alonzo
mrowe: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Alonzo 2007-09-21 18:39:46 PDT
Hi! Attached is a patch that makes the text field or text area conform to the current gtk theme.
Comment 1 Jan Alonzo 2007-09-21 18:42:01 PDT
Created attachment 16344 [details]
implement theme-aware drawing of text fields and text area
Comment 2 Adam Roben (:aroben) 2007-09-22 13:24:51 PDT
Comment on attachment 16344 [details]
implement theme-aware drawing of text fields and text area

+    else if (isChecked(o))
+        result = GTK_STATE_SELECTED;

Is this really needed for drawing text fields? Or is this just something that was missing and you added it while you were touching the code?

+    gtk_paint_shadow(entry->style, i.context->gdkDrawable(),
+                     determineState(o), determineShadow(o),
+                     NULL, entry, "entry",
+                     pos.x(), pos.y(), rect.width(), rect.height());

Since this is C++ code, please use 0 instead of NULL.

+    if (GTK_WIDGET_HAS_FOCUS(entry))
+    {

As per <http://webkit.org/coding/coding-style.html>, please pur the brace on the same line as the if.

r- so the above can be fixed. Once that's done I'll r+ it.
Comment 3 Jan Alonzo 2007-09-22 14:50:28 PDT
Created attachment 16351 [details]
theme drawing of text entries 

This patch incorporates aroben's coding style suggestions. I left the isChecked in determineState but added a separate line in the ChangeLog for the change, not really required to fix this bug but nevertheless missing from the checks.

Thanks.
Comment 4 Adam Roben (:aroben) 2007-09-22 14:53:03 PDT
Comment on attachment 16351 [details]
theme drawing of text entries 

r=me. Thanks for fixing it up!
Comment 5 Holger Freyther 2007-09-28 08:21:32 PDT
(In reply to comment #4)
> (From update of attachment 16351 [details] [edit])
> r=me. Thanks for fixing it up!
> 

I'm not going to say r=- but I think
if (GTK_WIDGET_HAS_FOCUS(entry)) {} is a dead code path and something like if (isFocused(renderObject)) should be used.
Comment 6 Jan Alonzo 2007-09-28 15:25:25 PDT
Created attachment 16435 [details]
gtk theme-based drawing of text entries

Update the patch based on zecke and bdash's comments
Comment 7 Mark Rowe (bdash) 2007-09-28 15:29:45 PDT
Comment on attachment 16435 [details]
gtk theme-based drawing of text entries

Two comments:  You have tabs in your ChangeLog entry, and you don't need the "else"s when you have a series of if's with early returns.
Comment 8 Mark Rowe (bdash) 2007-09-28 15:30:35 PDT
Comment on attachment 16435 [details]
gtk theme-based drawing of text entries

Those two issues can be fixed by whomever lands the change.  No need to jump through the hoops of uploading a new patch to get those minor points addressed.
Comment 9 Holger Freyther 2007-09-29 08:53:43 PDT
Landed in r25807. The comments by Mark were taken into account.