Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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


Canonical link: https://commits.webkit.org/20245@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
zecke committed Sep 29, 2007
1 parent bd65c7e commit 3b600d5
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 10 deletions.
15 changes: 15 additions & 0 deletions WebCore/ChangeLog
@@ -1,3 +1,18 @@
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.
Expand Down
40 changes: 30 additions & 10 deletions WebCore/platform/gtk/RenderThemeGtk.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 3b600d5

Please sign in to comment.