Commit df52ae62 authored by hyatt's avatar hyatt

Rename m_isFocused on the frame to m_isActive, since it isn't really

        about focus but is instead about whether or not the top-level window is
        active.

        Pull code that was incorrectly factored into Mac-only code out of FrameMac
        and back up into Frame.

        Reviewed by andersca

        * bridge/mac/FrameMac.h:
        * bridge/mac/FrameMac.mm:
        * page/Frame.cpp:
        (WebCore::Frame::setFocusNodeIfNeeded):
        (WebCore::Frame::isActive):
        (WebCore::Frame::setIsActive):
        * page/FramePrivate.h:
        (WebCore::FramePrivate::FramePrivate):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@14791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 90ffc77d
2006-06-09 David Hyatt <hyatt@apple.com>
Rename m_isFocused on the frame to m_isActive, since it isn't really
about focus but is instead about whether or not the top-level window is
active.
Pull code that was incorrectly factored into Mac-only code out of FrameMac
and back up into Frame.
Reviewed by andersca
* bridge/mac/FrameMac.h:
* bridge/mac/FrameMac.mm:
* page/Frame.cpp:
(WebCore::Frame::setFocusNodeIfNeeded):
(WebCore::Frame::isActive):
(WebCore::Frame::setIsActive):
* page/FramePrivate.h:
(WebCore::FramePrivate::FramePrivate):
2006-06-09 David Hyatt <hyatt@apple.com>
Rework selection coloring. Rename displaysWithFocusAttributes
......
......@@ -149,7 +149,6 @@ public:
virtual void restoreDocumentState();
virtual void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID);
virtual void setIsActive(bool);
NSView* nextKeyView(Node* startingPoint, KWQSelectionDirection);
NSView* nextKeyViewInFrameHierarchy(Node* startingPoint, KWQSelectionDirection);
......
......@@ -2846,24 +2846,6 @@ String FrameMac::overrideMediaType() const
return String();
}
void FrameMac::setIsActive(bool flag)
{
if (d->m_isFocused == flag)
return;
Frame::setIsActive(flag);
Document *doc = document();
// Mac Specific: Changing the tint of controls from clear to aqua/graphite and vice versa. We
// do a "fake" paint. When the theme gets a paint call, it can then do an invalidate.
if (doc && d->m_view && d->m_view->getDocumentView() && theme()->supportsControlTints() && renderer()) {
doc->updateLayout(); // Ensure layout is up to date.
IntRect visibleRect(enclosingIntRect(d->m_view->visibleContentRect()));
GraphicsContext context(0);
context.setUpdatingControlTints(true);
paint(&context, visibleRect);
}
}
NSColor *FrameMac::bodyBackgroundColor() const
{
if (document() && document()->body() && document()->body()->renderer()) {
......
......@@ -1255,7 +1255,7 @@ static bool isFrameElement(const Node *n)
void Frame::setFocusNodeIfNeeded()
{
if (!document() || d->m_selection.isNone() || !d->m_isFocused)
if (!document() || d->m_selection.isNone() || !d->m_isActive)
return;
Node *startNode = d->m_selection.start().node();
......@@ -3284,15 +3284,15 @@ void Frame::setSelectionFromNone()
bool Frame::isActive() const
{
return d->m_isFocused;
return d->m_isActive;
}
void Frame::setIsActive(bool flag)
{
if (d->m_isFocused == flag)
if (d->m_isActive == flag)
return;
d->m_isFocused = flag;
d->m_isActive = flag;
// This method does the job of updating the view based on whether the view is "active".
// This involves three kinds of drawing updates:
......@@ -3316,6 +3316,17 @@ void Frame::setIsActive(bool flag)
theme()->stateChanged(node->renderer(), FocusState);
}
}
// 4, Changing the tint of controls from clear to aqua/graphite and vice versa. We
// do a "fake" paint. When the theme gets a paint call, it can then do an invalidate. This is only
// done if the theme supports control tinting.
if (doc && d->m_view && d->m_view->getDocumentView() && theme()->supportsControlTints() && renderer()) {
doc->updateLayout(); // Ensure layout is up to date.
IntRect visibleRect(enclosingIntRect(d->m_view->visibleContentRect()));
GraphicsContext context(0);
context.setUpdatingControlTints(true);
paint(&context, visibleRect);
}
}
void Frame::setWindowHasFocus(bool flag)
......
......@@ -86,7 +86,7 @@ namespace WebCore {
, m_caretPaint(true)
, m_bFirstData(true)
, m_bCleared(true)
, m_isFocused(false)
, m_isActive(false)
, m_opener(0)
, m_openedByJS(false)
, m_bPendingChildRedirection(false)
......@@ -190,7 +190,7 @@ namespace WebCore {
bool m_caretPaint : 1;
bool m_bFirstData : 1;
bool m_bCleared : 1;
bool m_isFocused : 1;
bool m_isActive : 1;
EditCommandPtr m_lastEditCommand;
int m_xPosForVerticalArrowNavigation;
......
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