summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-08-28 09:18:40 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-08-28 09:20:05 (GMT)
commit66f820c2c7e2d7c6d883c995bf7b2da37aa963c7 (patch)
tree19b495dc2d215b84da103af0c7e62a196de6049a /Swift/QtUI/QtWebView.cpp
parent6d74e548e9e748007f6541dbcb0ed148e572332e (diff)
downloadswift-66f820c2c7e2d7c6d883c995bf7b2da37aa963c7.zip
swift-66f820c2c7e2d7c6d883c995bf7b2da37aa963c7.tar.bz2
Disable the 'Decrease font size' menu item in chats when it's already minimal.
Resolves: #968
Diffstat (limited to 'Swift/QtUI/QtWebView.cpp')
-rw-r--r--Swift/QtUI/QtWebView.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/Swift/QtUI/QtWebView.cpp b/Swift/QtUI/QtWebView.cpp
index 5d25071..5f9539e 100644
--- a/Swift/QtUI/QtWebView.cpp
+++ b/Swift/QtUI/QtWebView.cpp
@@ -39,6 +39,10 @@ void QtWebView::dragEnterEvent(QDragEnterEvent*) {
}
+void QtWebView::setFontSizeIsMinimal(bool minimum) {
+ fontSizeIsMinimal = minimum;
+}
+
void QtWebView::contextMenuEvent(QContextMenuEvent* ev) {
// Filter out the relevant actions from the standard actions
QMenu* menu = page()->createStandardContextMenu();
@@ -60,7 +64,10 @@ void QtWebView::contextMenuEvent(QContextMenuEvent* ev) {
// Add our own custom actions
menu->addAction(tr("Clear"), this, SIGNAL(clearRequested()));
menu->addAction(tr("Increase font size"), this, SIGNAL(fontGrowRequested()));
- menu->addAction(tr("Decrease font size"), this, SIGNAL(fontShrinkRequested()));
+ QAction* shrink = new QAction(tr("Decrease font size"), this);
+ shrink->setEnabled(!fontSizeIsMinimal);
+ connect(shrink, SIGNAL(triggered()), this, SIGNAL(fontShrinkRequested()));
+ menu->addAction(shrink);
menu->exec(ev->globalPos());
delete menu;