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>
Reviewed by Eric.
......@@ -127,14 +127,16 @@ bool RenderThemeGtk::supportsFocus(EAppearance appearance)
GtkStateType RenderThemeGtk::determineState(RenderObject* o)
{
GtkStateType result = GTK_STATE_NORMAL;
if (!isEnabled(o))
result = GTK_STATE_INSENSITIVE;
else if (isPressed(o))
result = GTK_STATE_ACTIVE;
else if (isHovered(o))
result = GTK_STATE_PRELIGHT;
return result;
if (!isEnabled(o) || isReadOnlyControl(o))
return GTK_STATE_INSENSITIVE;
if (isPressed(o) || isFocused(o))
return GTK_STATE_ACTIVE;
if (isHovered(o))
return GTK_STATE_PRELIGHT;
if (isChecked(o))
return GTK_STATE_SELECTED;
return GTK_STATE_NORMAL;
}
GtkShadowType RenderThemeGtk::determineShadow(RenderObject* o)
......@@ -239,10 +241,17 @@ void RenderThemeGtk::adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Eleme
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
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)
......@@ -292,6 +301,17 @@ GtkWidget* RenderThemeGtk::gtkRadioButton() const
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
{
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