I have made the following changes intended for :
  CE:MW:Shared / qt-components

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/8281

Thank You,
Robin Burchell

[This message was auto-generated]

---

Request # 8281:

Messages from BOSS:

State: review at 2013-03-03T00:04:39 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: home:w00t:branches:CE:MW:Shared / qt-components -> CE:MW:Shared / 
qt-components
  
changes files:
--------------
--- qt-components.changes
+++ qt-components.changes
@@ -0,0 +1,5 @@
+* Sun Mar 03 2013 Robin Burchell <[email protected]> - 1.4.8
+- Remove javascript font family methods from all components and replace
+  with C++ properties. This improves performance. (from Robin)
+- Introduce ViewPlaceholder component to unify empty state views (from Robin)
+

old:
----
  qt-components-1.4.7.tar.bz2

new:
----
  qt-components-1.4.8.tar.bz2

spec files:
-----------
--- qt-components.spec
+++ qt-components.spec
@@ -9,7 +9,7 @@
 # << macros
 
 Summary:    Qt Quick UX Components
-Version:    1.4.7
+Version:    1.4.8
 Release:    1
 Group:      System/Libraries
 License:    BSD

other changes:
--------------

++++++ qt-components-1.4.7.tar.bz2 -> qt-components-1.4.8.tar.bz2
--- doc/src/meego/qt-components-buttonstyle.qdoc
+++ doc/src/meego/qt-components-buttonstyle.qdoc
@@ -71,7 +71,7 @@
 /*!
     \qmlproperty string ButtonStyle::fontFamily
 
-    Property default value is \c UI.FONT_FAMILY.
+    Property default value is \c UiConstants.DefaultFontFamily.
 
     Defines the font family for the button.
 */
--- doc/src/meego/qt-components-contextmenustyle.qdoc
+++ doc/src/meego/qt-components-contextmenustyle.qdoc
@@ -62,7 +62,7 @@
 /*!
     \qmlproperty string ContextMenuStyle::titleFontFamily
 
-    Property default value is \c UI.FONT_FAMILY
+    Property default value is \c UiConstants.DefaultFontFamily.
 
     Font family.
 */
--- doc/src/meego/qt-components-labelstyle.qdoc
+++ doc/src/meego/qt-components-labelstyle.qdoc
@@ -70,7 +70,7 @@
 /*!
     \qmlproperty string LabelStyle::fontFamily
 
-    Property default value is \c UI.FONT_FAMILY
+    Property default value is \c UiConstants.DefaultFontFamily.
 
     Font family.
 */
--- doc/src/meego/qt-components-sliderstyle.qdoc
+++ doc/src/meego/qt-components-sliderstyle.qdoc
@@ -75,7 +75,7 @@
 /*!
     \qmlproperty string SliderStyle::fontFamily
 
-    Property default value is \c UI.FONT_FAMILY.
+    Property default value is \c UiConstants.DefaultFontFamily.
 
     Font family.
 */
--- src/meego/UIConstants.js
+++ src/meego/UIConstants.js
@@ -40,13 +40,6 @@
 
 .pragma library
 
-var FONT_FAMILY = "Nokia Pure Text";
-var FONT_FAMILY_LIGHT = "Nokia Pure Text Light"
-
-// we use a fallback font when language is set to farsi
-var FONT_FAMILY_FARSI = "Arial"
-var FONT_FAMILY_LIGHT_FARSI = "Arial"
-
 var FONT_DEFAULT_SIZE = 24; // DEPRECATED
 
 var FONT_XLARGE  = 32;
--- src/meego/ViewPlaceholder.qml
+++ src/meego/ViewPlaceholder.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Robin Burchell <[email protected]>
+**
+** This file is part of the Qt Components project.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.1
+import com.nokia.meego 1.2
+
+Label {
+    enabled: false
+    opacity: enabled ? 1.0 : 0.0
+    anchors.horizontalCenter: parent.horizontalCenter
+    horizontalAlignment: Text.AlignHCenter
+    width: parent.width - UiConstants.DefaultMargin * 2
+    y: (parent.height - height) / 2
+    x: UiConstants.DefaultMargin
+    wrapMode: Text.Wrap
+    color: theme.inverted ? "#8c8c8c" : "#848284"
+    font.family: UiConstants.DefaultFontFamilyLight
+    font.pixelSize: 85
+}
--- src/meego/extras/CountBubble.qml
+++ src/meego/extras/CountBubble.qml
@@ -40,7 +40,6 @@
 
 import QtQuick 1.1
 import com.nokia.meego 1.0
-import "constants.js" as C
 
 /*
    Class: CountBubble
@@ -77,7 +76,7 @@
         height: parent.height
         y:1
         color: largeSized ? "#FFFFFF" : "black"
-        font.family: C.FONT_FAMILY
+        font.family: UiConstants.DefaultFontFamily
         anchors.horizontalCenter: parent.horizontalCenter
         verticalAlignment: Text.AlignVCenter
         font.pixelSize: largeSized ? 22:18
--- src/meego/extras/DatePickerDialog.qml
+++ src/meego/extras/DatePickerDialog.qml
@@ -40,7 +40,6 @@
 
 import QtQuick 1.1
 import com.nokia.meego 1.0
-import "constants.js" as C
 import "TumblerIndexHelper.js" as TH
 
 /*
@@ -117,7 +116,7 @@
         text: "Pick Date"
         visible: text.length > 0
         color: theme.selectionColor
-        font { pixelSize: 32; family: C.FONT_FAMILY_BOLD }
+        font { pixelSize: 32; family: UiConstants.DefaultFontFamilyBold }
         elide: Text.ElideRight
     }
     content: Item {
--- src/meego/extras/ListDelegate.qml
+++ src/meego/extras/ListDelegate.qml
@@ -50,13 +50,13 @@
 
     property int titleSize: UI.LIST_TILE_SIZE
     property int titleWeight: Font.Bold
-    property string titleFont: (locale && locale.language == "fa") ? 
UI.FONT_FAMILY_FARSI : UI.FONT_FAMILY
+    property string titleFont: UiConstants.DefaultFontFamily
     property color titleColor: theme.inverted ? UI.LIST_TITLE_COLOR_INVERTED : 
UI.LIST_TITLE_COLOR
     property color titleColorPressed: theme.inverted ? 
UI.LIST_TITLE_COLOR_PRESSED_INVERTED : UI.LIST_TITLE_COLOR_PRESSED
 
     property int subtitleSize: UI.LIST_SUBTILE_SIZE
     property int subtitleWeight: Font.Normal
-    property string subtitleFont: (locale && locale.language == "fa") ? 
UI.FONT_FAMILY_LIGHT_FARSI : UI.FONT_FAMILY_LIGHT
+    property string subtitleFont: UiConstants.DefaultFontFamilyLight
     property color subtitleColor: theme.inverted ? 
UI.LIST_SUBTITLE_COLOR_INVERTED : UI.LIST_SUBTITLE_COLOR
     property color subtitleColorPressed: theme.inverted ? 
UI.LIST_SUBTITLE_COLOR_PRESSED_INVERTED : UI.LIST_SUBTITLE_COLOR_PRESSED
 
--- src/meego/extras/TimePickerDialog.qml
+++ src/meego/extras/TimePickerDialog.qml
@@ -41,7 +41,6 @@
 import QtQuick 1.1
 import com.nokia.meego 1.0
 import com.nokia.extras 1.1
-import "constants.js" as C
 import "TumblerIndexHelper.js" as TH
 
 /*
@@ -132,7 +131,7 @@
         text: "Pick Time"
         visible: text.length > 0
         color: theme.selectionColor
-        font { pixelSize: 32; family: C.FONT_FAMILY_BOLD }
+        font { pixelSize: 32; family: UiConstants.DefaultFontFamilyBold }
         elide: Text.ElideRight
     }
     content: Item {
--- src/meego/extras/TumblerTemplate.qml
+++ src/meego/extras/TumblerTemplate.qml
@@ -156,7 +156,7 @@
             elide: Text.ElideRight
             horizontalAlignment: "AlignHCenter"
             color: C.TUMBLER_COLOR_LABEL
-            font { family: C.FONT_FAMILY_LIGHT; pixelSize: C.FONT_LIGHT_SIZE }
+            font { family: UiConstants.DefaultFontFamilyLight; pixelSize: 
C.FONT_LIGHT_SIZE }
             anchors { fill: parent; margins: C.TUMBLER_MARGIN}
         }
     }
--- src/meego/extras/constants.js
+++ src/meego/extras/constants.js
@@ -63,16 +63,9 @@
 var LIST_SUBTITLE_COLOR_PRESSED_INVERTED = "#797979"
 
 /* Font properties */
-var FONT_FAMILY = "Nokia Pure Text";
-var FONT_FAMILY_BOLD = "Nokia Pure Text Bold";
-var FONT_FAMILY_LIGHT = "Nokia Pure Text Light";
 var FONT_DEFAULT_SIZE = 24;
 var FONT_LIGHT_SIZE = 22;
 
-// we use a fallback font when language is set to farsi
-var FONT_FAMILY_FARSI = "Arial"
-var FONT_FAMILY_LIGHT_FARSI = "Arial"
-
 /* TUMBLER properties */
 var TUMBLER_COLOR_TEXT = "#FFFFFF";
 var TUMBLER_COLOR_LABEL = "#8C8C8C";
--- src/meego/meego.pro
+++ src/meego/meego.pro
@@ -236,6 +236,7 @@
         Switch.qml \
         style/SwitchStyle.qml \
         UIConstants.js \
+        ViewPlaceholder.qml \
         Window.qml \
         SipSimulator.qml \
         SoftwareInputPanel.qml \
--- src/meego/plugin.cpp
+++ src/meego/plugin.cpp
@@ -166,6 +166,9 @@
         }
 
         QDeclarativePropertyMap *uiConstantsData = new 
QDeclarativePropertyMap();
+        uiConstantsData->insert("DefaultFontFamily", defaultFontFamily);
+        uiConstantsData->insert("DefaultFontFamilyLight", 
defaultFontFamilyLight);
+        uiConstantsData->insert("DefaultFontFamilyBold", "Nokia Pure Text 
Bold");
         uiConstantsData->insert("DefaultMargin", QVariant(16));
         uiConstantsData->insert("ButtonSpacing", QVariant(6));
         uiConstantsData->insert("HeaderDefaultHeightPortrait", QVariant(72));
--- src/meego/qmldir
+++ src/meego/qmldir
@@ -1,4 +1,8 @@
 plugin meegoplugin
+SelectableLabel 1.2 SelectableLabel.qml
+PageHeader 1.2 PageHeader.qml
+ViewPlaceholder 1.2 ViewPlaceholder.qml
+
 ApplicationWindow 1.0 ApplicationWindow.qml
 ApplicationWindowStyle 1.0 ApplicationWindowStyle.qml
 BusyIndicator 1.0 BusyIndicator.qml
@@ -21,7 +25,6 @@
 MultiSelectionDialog 1.0 MultiSelectionDialog.qml
 SelectionDialogStyle 1.0 SelectionDialogStyle.qml
 Label 1.0 Label.qml
-SelectableLabel 1.2 SelectableLabel.qml
 LabelStyle 1.0 LabelStyle.qml
 Menu 1.0 Menu.qml
 MenuLayout 1.0 MenuLayout.qml
@@ -30,7 +33,6 @@
 MenuItemStyle 1.0 MenuItemStyle.qml
 MouseAreaDebug 1.0 MouseAreaDebug.qml
 Page 1.0 Page.qml
-PageHeader 1.2 PageHeader.qml
 PageStack 1.0 PageStack.qml
 PageStackWindow 1.0 PageStackWindow.qml
 PageStackWindowStyle 1.0 PageStackWindowStyle.qml
--- src/meego/style/ButtonStyle.qml
+++ src/meego/style/ButtonStyle.qml
@@ -43,7 +43,7 @@
 
 Style {
     // Font
-    property string fontFamily: __fontFamily()
+    property string fontFamily: UiConstants.DefaultFontFamily
     property int fontPixelSize: UI.FONT_DEFAULT_SIZE
     property int fontCapitalization: Font.MixedCase
     property int fontWeight: Font.Bold
--- src/meego/style/ContextMenuStyle.qml
+++ src/meego/style/ContextMenuStyle.qml
@@ -42,8 +42,8 @@
 import "UIConstants.js" as UI
 
 MenuStyle {
- id: root
- property string titleFontFamily: __fontFamily()
+     id: root
+     property string titleFontFamily: UiConstants.DefaultFontFamily
      property int titleFontPixelSize: UI.FONT_SMALL
      property int titleFontCapitalization: Font.MixedCase
      property color titleTextColor: "white"
--- src/meego/style/EditBubbleButtonStyle.qml
+++ src/meego/style/EditBubbleButtonStyle.qml
@@ -43,7 +43,7 @@
 
 Style {
     // Font
-    property string fontFamily: __fontFamily()
+    property string fontFamily: UiConstants.DefaultFontFamily
     property int fontPixelSize: UI.FONT_DEFAULT_SIZE
     property int fontCapitalization: Font.MixedCase
     property int fontWeight: Font.Normal
--- src/meego/style/LabelStyle.qml
+++ src/meego/style/LabelStyle.qml
@@ -48,6 +48,6 @@
     property color selectionColor: theme.selectionColor
 
     // Font
-    property string fontFamily: __fontFamily()
+    property string fontFamily: UiConstants.DefaultFontFamily
     property int fontPixelSize: UI.FONT_DEFAULT_SIZE
 }
--- src/meego/style/MenuItemStyle.qml
+++ src/meego/style/MenuItemStyle.qml
@@ -44,7 +44,7 @@
 Style {
     id: root
     // Font
-    property string fontFamily: __fontFamily()
+    property string fontFamily: UiConstants.DefaultFontFamily
     property int fontPixelSize: 26 // UI.FONT_DEFAULT_SIZE
     property int fontCapitalization: Font.MixedCase
     property int fontWeight: Font.Bold
--- src/meego/style/QueryDialogStyle.qml
+++ src/meego/style/QueryDialogStyle.qml
@@ -42,7 +42,7 @@
 import "UIConstants.js" as UI
 
 DialogStyle {
-    property string titleFontFamily: __fontFamily()
+    property string titleFontFamily: UiConstants.DefaultFontFamily
     property int titleFontPixelSize: UI.FONT_XLARGE
     property int titleFontCapitalization: Font.MixedCase
     property bool titleFontBold: true
@@ -62,7 +62,7 @@
     rightMargin: 33
     titleElideMode: Text.ElideNone
 
-    property string messageFontFamily: __fontFamily()
+    property string messageFontFamily: UiConstants.DefaultFontFamily
     property int messageFontPixelSize: UI.FONT_DEFAULT
     property color messageTextColor: "#ffffff"
 }
--- src/meego/style/SelectionDialogStyle.qml
+++ src/meego/style/SelectionDialogStyle.qml
@@ -89,7 +89,7 @@
 
     Text {
         id: titleText
-        font.family: __fontFamily()
+        font.family: UiConstants.DefaultFontFamily
         font.pixelSize: UI.FONT_XLARGE
         font.capitalization: Font.MixedCase
         font.bold: false
@@ -97,7 +97,7 @@
 
     Text {
         id: itemText
-        font.family: __fontFamily()
+        font.family: UiConstants.DefaultFontFamily
         font.pixelSize: UI.FONT_DEFAULT_SIZE
         font.capitalization: Font.MixedCase
         font.bold: true
--- src/meego/style/SliderStyle.qml
+++ src/meego/style/SliderStyle.qml
@@ -43,7 +43,7 @@
 
 Style {
     // Font
-    property string fontFamily: __fontFamily()
+    property string fontFamily: UiConstants.DefaultFontFamily
     property int fontPixelSize: UI.FONT_DEFAULT_SIZE
 
     // Color
--- src/meego/style/Style.qml
+++ src/meego/style/Style.qml
@@ -52,24 +52,4 @@
     // which isn't allowed by QtObject; this fix makes this possible
     default property alias children: styleClass.__defaultPropertyFix
     property list<QtObject> __defaultPropertyFix: [Item {}] //QML doesn't 
allow an empty list here
-
-    // styles must not set font families with referencing to UI.FONT_FAMILY
-    // as there may exist languages that request a different font;
-    // use __fontFamily() and __fontFamilyLight instead.
-    //
-    // app developers should use the UiConstants context property
-    function __fontFamily() {
-        if (locale && locale.language == "fa") {
-            return UI.FONT_FAMILY_FARSI;
-        }
-        return UI.FONT_FAMILY;
-    }
-
-    function __fontFamilyLight() {
-        if (locale && locale.language == "fa") {
-            return UI.FONT_FAMILY_LIGHT_FARSI;
-        }
-        return UI.FONT_FAMILY_LIGHT;
-    }
-
 }
--- src/meego/style/TextFieldStyle.qml
+++ src/meego/style/TextFieldStyle.qml
@@ -67,7 +67,7 @@
 
     Text {
         id: textProperties
-        font.family: (locale && locale.language == "fa") ? 
UI.FONT_FAMILY_LIGHT_FARSI : UI.FONT_FAMILY_LIGHT
+        font.family: UiConstants.DefaultFontFamilyLight
         font.pixelSize: UI.FONT_DEFAULT
         visible: false
     }

++++++ qt-components.yaml
--- qt-components.yaml
+++ qt-components.yaml
@@ -1,6 +1,6 @@
 Name: qt-components
 Summary: Qt Quick UX Components
-Version: 1.4.7
+Version: 1.4.8
 Release: 1
 Group: System/Libraries
 License: BSD



Reply via email to