From: Mateusz Półrola Date: Thu, 9 Sep 2010 09:50:35 +0000 (+0200) Subject: Fixed scroling on desktop in translation widget X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=2fd6e06508a68a60ec1d327c6f00b3adc471a9de;p=mdictionary Fixed scroling on desktop in translation widget --- diff --git a/data/gui.qrc b/data/gui.qrc index 03cab88..18cf9df 100644 --- a/data/gui.qrc +++ b/data/gui.qrc @@ -12,5 +12,6 @@ xsl/xsl.xsl translations/en_US.qm translations/pl_PL.qm + xsl/mask.png diff --git a/data/xsl/mask.png b/data/xsl/mask.png new file mode 100644 index 0000000..f3f986a Binary files /dev/null and b/data/xsl/mask.png differ diff --git a/data/xsl/style.css b/data/xsl/style.css index 74f0061..e4289dd 100644 --- a/data/xsl/style.css +++ b/data/xsl/style.css @@ -1,60 +1,82 @@ body { - background-color: #000000 +background-color: #000000 + + } + +div.tab { + -webkit-box-shadow: rgba(0, 0, 0, 0.7) 0px 3px 10px; + background-color: #D6E4FF; + border-bottom-left-radius: 8px 8px; + border-bottom-right-radius: 8px 8px; + border-top-left-radius: 8px 8px; + border-top-right-radius: 8px 8px; + color: black; + font-family: 'Lucida Sans MS', 'Lucida Grande', Helvetica, sans-serif; + font-size: 10pt; + padding: 10px 10px; + padding-left: 5px; + padding-right: 5px; + -webkit-box-reflect:below 5px -webkit-gradient(linear, 0% 0%, 0% 190%, from(transparent), color-stop(0.3, transparent), to(white)); +} + +div.dict { + -webkit-box-shadow: rgba(0, 0, 0, 0.7) 0px 3px 10px; + background: -webkit-gradient(linear, 50% 0%, 50% 100%, from(#FFFFFA), color-stop(0.3, #FED), color-stop(0.8, #FED), to(#FFFFFA)); + border-bottom-left-radius: 8px 8px; + border-bottom-right-radius: 8px 8px; + border-top-left-radius: 8px 8px; + border-top-right-radius: 8px 8px; + color: black; + font-family: 'Lucida Sans MS', 'Lucida Grande', Helvetica, sans-serif; + font-size: 10pt; + margin-bottom: 10px; + padding: 10px 18px; + padding-left: 5px; + padding-right: 5px; } -div.tab { - border-style : solid; - border-width : 1px; - -webkit-box-reflect:below 5px -webkit-gradient(linear, 0% 0%, 0% 180%, from(transparent), color-stop(0.3, transparent), to(white)); -} + div.info { font-weight : bold; text-align : center; -background: -webkit-gradient( + background: -webkit-gradient( linear, left top, left bottom, - color-stop(0.05, rgb(88,190,245)), - color-stop(0.85, rgb(0,49,61)) -); - /*background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f7ffff), to(#dfffff));*/ - + color-stop(0.05, rgb(255,190,245)), + color-stop(0.85, rgb(255,49,61))); - padding-bottom: 8px; - padding-left: 10px; - padding-right: 10px; - padding-top: 8px; + padding-bottom: 5px; + padding-left: 5px; + padding-right: 5px; + padding-top: 5px; + -webkit-mask-box-image: url(mask.png) 0 100 0 100 stretch stretch; } div.key { font-weight : bold; text-align : center; - padding-bottom: 8px; - padding-left: 10px; - padding-right: 10px; - padding-top: 8px; - background: -webkit-gradient( linear, - left bottom, left top, - color-stop(0.03, rgb(175,247,237)), - color-stop(0.44, rgb(28,176,230)), - color-stop(1, rgb(0,48,61))); - + left bottom, + color-stop(0.01, rgb(88,190,245)), + color-stop(0.95, rgb(0,49,61))); + padding-bottom: 5px; + padding-left: 5px; + padding-right: 5px; + padding-top: 5px; + -webkit-mask-box-image: url(mask.png) 0 100 0 100 stretch stretch; } div.cell { - - background: -webkit-gradient( - linear, - left top, - left bottom, - color-stop(0.03, rgb(175,247,237)), - color-stop(0.52, rgb(242,255,229))); + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fffcca), to(#FFFFFA)); + padding-top: 5px; + padding-left: 25px; + padding-right: 25px; + -webkit-mask-box-image: url(mask.png) 0 100 0 100 stretch stretch; } - span.i { font-style : italic; } @@ -64,7 +86,7 @@ span.b { } span.u { - text-decoration : underline; + text-decoration : underline; } diff --git a/data/xsl/xsl.xsl b/data/xsl/xsl.xsl index 01a19c4..ab99f61 100644 --- a/data/xsl/xsl.xsl +++ b/data/xsl/xsl.xsl @@ -3,24 +3,33 @@
- +
+ +
+
+ + -
+
+ + +
+
-
+
diff --git a/debian/mdictionary.install b/debian/mdictionary.install index 9f01a7a..d211746 100644 --- a/debian/mdictionary.install +++ b/debian/mdictionary.install @@ -1,6 +1,7 @@ usr/share/dbus-1/ usr/share/icons/ usr/share/mdictionary/staron.png +usr/share/mdictionary/mask.png usr/bin/mdictionary usr/lib/mdictionary/plugins/libxdxf.so usr/lib/mdictionary/plugins/eng-us.xdxf diff --git a/src/mdictionary/backbone/ConfigGenerator.cpp b/src/mdictionary/backbone/ConfigGenerator.cpp index 4a5f611..704a6ba 100644 --- a/src/mdictionary/backbone/ConfigGenerator.cpp +++ b/src/mdictionary/backbone/ConfigGenerator.cpp @@ -29,7 +29,7 @@ #include bool ConfigGenerator::generateCss(QString file) { - return generateFile(":/xsl/style.css", file); + generateFile(":/xsl/style.css", file); } diff --git a/src/mdictionary/gui/TranslationTextEdit.cpp b/src/mdictionary/gui/TranslationTextEdit.cpp index e7884d6..ed8c01a 100644 --- a/src/mdictionary/gui/TranslationTextEdit.cpp +++ b/src/mdictionary/gui/TranslationTextEdit.cpp @@ -55,6 +55,10 @@ void TranslationTextEdit::wheelEvent(QWheelEvent *e) { else { zoomOut(); } + e->ignore(); + } + else { + QWebView::wheelEvent(e); } } diff --git a/src/mdictionary/gui/TranslationWidget.cpp b/src/mdictionary/gui/TranslationWidget.cpp index 935323e..10358ee 100644 --- a/src/mdictionary/gui/TranslationWidget.cpp +++ b/src/mdictionary/gui/TranslationWidget.cpp @@ -29,6 +29,7 @@ #include #include #endif +#include TranslationWidget::TranslationWidget(QWidget *parent): QScrollArea(parent){ @@ -81,6 +82,10 @@ void TranslationWidget::show(QStringList translations) { trans=tr("") + tr("\n ") + trans + tr("\n "); + + + qDebug()<setHtml(trans, QUrl().fromLocalFile("/")); + qDebug()<page()->currentFrame()->toHtml(); + + //webkit->repaint(this->rect()); //update(this->rect()); diff --git a/src/mdictionary/mdictionary.pro b/src/mdictionary/mdictionary.pro index 9dd0c8e..91bb85b 100644 --- a/src/mdictionary/mdictionary.pro +++ b/src/mdictionary/mdictionary.pro @@ -89,13 +89,14 @@ unix { desktop.files += ../../data/other/$${TARGET}.desktop icon64.files += ../../data/icons/64x64/$${TARGET}.png - bookmarks.path = $$DATA_DIR - bookmarks.files += ../../data/icons/16x16/staron.png + shared.path = $$DATA_DIR + shared.files += ../../data/icons/16x16/staron.png + shared.files += ../../data/xsl/mask.png service.path = $$SHARE_DIR/dbus-1/services service.files += ../../data/other/com.comarch.mdictionary.service - INSTALLS += desktop icon64 bookmarks service + INSTALLS += desktop icon64 shared service }