Commit 7f28eacb authored by hausmann's avatar hausmann

Added support for the Bold/Italic/Underline toggle actions.

Signed-off-by: Nikolas


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 63f4d94f
......@@ -157,6 +157,9 @@ static QWebPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuAct
case WebCore::ContextMenuItemTagDefaultDirection: return QWebPage::SetTextDirectionDefault;
case WebCore::ContextMenuItemTagLeftToRight: return QWebPage::SetTextDirectionLeftToRight;
case WebCore::ContextMenuItemTagRightToLeft: return QWebPage::SetTextDirectionRightToLeft;
case WebCore::ContextMenuItemTagBold: return QWebPage::ToggleBold;
case WebCore::ContextMenuItemTagItalic: return QWebPage::ToggleItalic;
case WebCore::ContextMenuItemTagUnderline: return QWebPage::ToggleUnderline;
default: break;
}
return QWebPage::NoWebAction;
......@@ -587,6 +590,16 @@ void QWebPage::triggerAction(WebAction action, bool checked)
editor->setBaseWritingDirection("rtl");
break;
case ToggleBold:
command = "ToggleBold";
break;
case ToggleItalic:
command = "ToggleItalic";
break;
case ToggleUnderline:
editor->toggleUnderline();
break;
default: break;
}
......@@ -715,6 +728,19 @@ QAction *QWebPage::action(WebAction action) const
checkable = true;
break;
case ToggleBold:
text = contextMenuItemTagBold();
checkable = true;
break;
case ToggleItalic:
text = contextMenuItemTagItalic();
checkable = true;
break;
case ToggleUnderline:
text = contextMenuItemTagUnderline();
checkable = true;
break;
case NoWebAction:
return 0;
}
......
......@@ -126,6 +126,10 @@ public:
SetTextDirectionLeftToRight,
SetTextDirectionRightToLeft,
ToggleBold,
ToggleItalic,
ToggleUnderline,
WebActionCount
};
......
2007-11-10 Simon Hausmann <hausmann@kde.org>
Reviewed by Nikolas.
Added support for the Bold/Italic/Underline toggle actions.
* Api/qwebpage.cpp:
(webActionForContextMenuAction):
(QWebPage::triggerAction):
(QWebPage::action):
* Api/qwebpage.h:
2007-11-10 Simon Hausmann <hausmann@kde.org>
Reviewed by Nikolas.
......
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