From b73c749ac6d731ec93052f0b2e9b24dfcc58d39a Mon Sep 17 00:00:00 2001 From: Oleksii Serdiuk Date: Tue, 7 Oct 2014 17:16:35 +0200 Subject: [PATCH] BB10: A small fix for BlackBerry 10.3 In BlackBerry 10.3 title in white theme is not branded anymore so title text is badly visible (white text on light background). --- qml/bb10/MainPage.qml | 2 +- src/main.cpp | 9 +++++++++ taot.pro | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/qml/bb10/MainPage.qml b/qml/bb10/MainPage.qml index ac81489..696bc69 100644 --- a/qml/bb10/MainPage.qml +++ b/qml/bb10/MainPage.qml @@ -37,7 +37,7 @@ Page { Label { text: translator.selectedService.name textStyle { - color: Color.White + color: osVersion < 0x0A0300 ? Color.White : undefined base: SystemDefaults.TextStyles.TitleText } verticalAlignment: VerticalAlignment.Center diff --git a/src/main.cpp b/src/main.cpp index 5f95e0b..5113a45 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -47,6 +47,7 @@ # include # include # include +# include # include using namespace bb::cascades; #elif defined(Q_OS_SYMBIAN) @@ -142,6 +143,14 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) TranslationInterface *translator = new TranslationInterface(app.data()); QmlDocument *qml = QmlDocument::create(QLatin1String("asset:///main.qml")) .property("translator", translator).parent(app.data()); + + const QStringList v = bb::platform::PlatformInfo().osVersion().split("."); + const int ver = v.count() >= 3 ? (v.at(0).toInt() << 16) + + (v.at(1).toInt() << 8) + + v.at(2).toInt() + : 0; + qml->documentContext()->setContextProperty("osVersion", ver); + #elif defined(MEEGO_EDITION_HARMATTAN) QDir dir(app->applicationDirPath()); dir.cdUp(); diff --git a/taot.pro b/taot.pro index efaaf5e..09f19bb 100644 --- a/taot.pro +++ b/taot.pro @@ -88,7 +88,7 @@ blackberry { src/bb10/clipboard.cpp \ src/bb10/repeater.cpp - LIBS += -lbbsystem + LIBS += -lbbplatform -lbbsystem } else { HEADERS += \ src/dictionarymodel.h \