Commit 68e127da authored by zecke's avatar zecke

2007-09-28 Jan Michael Alonzo <jmalonzo@unpluggable.com>

        Reviewed by Mark.

        -Fix http://bugs.webkit.org/show_bug.cgi?id=15254.

        * platform/gtk/RenderThemeGtk.cpp:
        (WebCore::RenderThemeGtk::determineState):
            - Apply state if control is readonly
            - Added state GTK_STATE_SELECTED of object is checked
            - Apply GTK_STATE_ACTIVE if RenderObject isFocused()
        (WebCore::RenderThemeGtk::paintTextField):
        (WebCore::RenderThemeGtk::gtkEntry):
            - Implemented theme-aware text field based on gtk/gtkentry.c implementation


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 27a493df
2007-09-28 Jan Michael Alonzo <jmalonzo@unpluggable.com>
Reviewed by Mark.
-Fix http://bugs.webkit.org/show_bug.cgi?id=15254.
* platform/gtk/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::determineState):
- Apply state if control is readonly
- Added state GTK_STATE_SELECTED of object is checked
- Apply GTK_STATE_ACTIVE if RenderObject isFocused()
(WebCore::RenderThemeGtk::paintTextField):
(WebCore::RenderThemeGtk::gtkEntry):
- Implemented theme-aware text field based on gtk/gtkentry.c implementation
2007-09-29 Holger Hans Peter Freyther <zecke@selfish.org> 2007-09-29 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Eric. Reviewed by Eric.
...@@ -127,14 +127,16 @@ bool RenderThemeGtk::supportsFocus(EAppearance appearance) ...@@ -127,14 +127,16 @@ bool RenderThemeGtk::supportsFocus(EAppearance appearance)
GtkStateType RenderThemeGtk::determineState(RenderObject* o) GtkStateType RenderThemeGtk::determineState(RenderObject* o)
{ {
GtkStateType result = GTK_STATE_NORMAL; if (!isEnabled(o) || isReadOnlyControl(o))
if (!isEnabled(o)) return GTK_STATE_INSENSITIVE;
result = GTK_STATE_INSENSITIVE; if (isPressed(o) || isFocused(o))
else if (isPressed(o)) return GTK_STATE_ACTIVE;
result = GTK_STATE_ACTIVE; if (isHovered(o))
else if (isHovered(o)) return GTK_STATE_PRELIGHT;
result = GTK_STATE_PRELIGHT; if (isChecked(o))
return result; return GTK_STATE_SELECTED;
return GTK_STATE_NORMAL;
} }
GtkShadowType RenderThemeGtk::determineShadow(RenderObject* o) GtkShadowType RenderThemeGtk::determineShadow(RenderObject* o)
...@@ -239,10 +241,17 @@ void RenderThemeGtk::adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Eleme ...@@ -239,10 +241,17 @@ void RenderThemeGtk::adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Eleme
notImplemented(); notImplemented();
} }
bool RenderThemeGtk::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) bool RenderThemeGtk::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
{ {
// FIXME: should use theme-aware drawing // FIXME: should use theme-aware drawing
return true; GtkWidget* entry = gtkEntry();
IntPoint pos = i.context->translatePoint(rect.location());
gtk_paint_shadow(entry->style, i.context->gdkDrawable(),
determineState(o), determineShadow(o),
0, entry, "entry",
pos.x(), pos.y(), rect.width(), rect.height());
return false;
} }
bool RenderThemeGtk::paintTextArea(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) bool RenderThemeGtk::paintTextArea(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
...@@ -292,6 +301,17 @@ GtkWidget* RenderThemeGtk::gtkRadioButton() const ...@@ -292,6 +301,17 @@ GtkWidget* RenderThemeGtk::gtkRadioButton() const
return m_gtkRadioButton; return m_gtkRadioButton;
} }
GtkWidget* RenderThemeGtk::gtkEntry() const
{
if (!m_gtkEntry) {
m_gtkEntry = gtk_entry_new();
gtk_container_add(GTK_CONTAINER(gtkWindowContainer()), m_gtkEntry);
gtk_widget_realize(m_gtkEntry);
}
return m_gtkEntry;
}
GtkWidget* RenderThemeGtk::gtkWindowContainer() const GtkWidget* RenderThemeGtk::gtkWindowContainer() const
{ {
if (!m_container) { if (!m_container) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment