~zsombi/ubuntu-ui-toolkit/theme-as-singleton

« back to all changes in this revision

Viewing changes to examples/ubuntu-ui-toolkit-gallery/TemplateRow.qml

  • Committer: Tarmac
  • Author(s): Florian Boucault
  • Date: 2014-01-24 11:56:52 UTC
  • mfrom: (901.1.7 rtl_support)
  • Revision ID: tarmac-20140124115652-nx51bfyrt68bna8e
Added Right-to-Left languages support to most widgets and to the UI Toolkit Gallery.
  
The following widgets now behave properly in RTL environments:
  - List Items
  - Popups
  - Slider
  - TextArea
  - TextField
  - Button
  - ProgressBar
  - Toolbar
  - Header
  - Switch
  
Tabs still need to be reversed.
Relayout issues had to be workarounded (QTBUG 35095) for Label and Row.
. Fixes: https://bugs.launchpad.net/bugs/1181740.

Approved by PS Jenkins bot, Zsombor Egri.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
        id: label
33
33
        text: templateRow.title
34
34
        width: templateRow.titleWidth
 
35
        anchors.left: parent.left
35
36
        anchors.verticalCenter: contentRow.verticalCenter
36
37
        elide: Text.ElideRight
37
38
        font.weight: Font.Light
44
45
        anchors.leftMargin: units.gu(2)
45
46
        anchors.right: parent.right
46
47
        spacing: units.gu(2)
 
48
 
 
49
        /* FIXME: workaround for QTBUG 35095 where Row's content is not relaidout
 
50
           when the width changes and LayoutMirroring is enabled.
 
51
 
 
52
           Ref.: https://bugreports.qt-project.org/browse/QTBUG-35095
 
53
        */
 
54
        onWidthChanged: if (LayoutMirroring.enabled) forceRelayout()
 
55
 
 
56
        function forceRelayout() {
 
57
            spacing = spacing + 0.00001;
 
58
        }
47
59
    }
48
60
}