From 81afc587aa8e81d2767e89472b7519b1df0c17b3 Mon Sep 17 00:00:00 2001
From: Jens Bache-Wiig <jensb.bache-wiig@nokia.com>
Date: Sat, 3 Sep 2011 15:13:07 +0200
Subject: [PATCH] Fixed Frame component

---
 components/Frame.qml | 31 ++++++++++++++-----------------
 components/qmldir    |  1 +
 2 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/components/Frame.qml b/components/Frame.qml
index 450316889..8233c455e 100644
--- a/components/Frame.qml
+++ b/components/Frame.qml
@@ -1,24 +1,21 @@
 import QtQuick 1.0
 import "custom" as Components
-
-
-QStyleBackground {
-
-    width: 100
-    height: 100
-
+Item {
     default property alias children: content.children
-
-    style: QStyleItem {
-        id: styleitem
-        elementType: "frame"
-    }
-
-    Item {
-        id: content
+    width: Math.max(100, content.childrenRect.width + 2 * content.frameWidth)
+    height: Math.max(100, content.childrenRect.height + 2 * content.frameWidth)
+    property alias raised: style.raised
+    property alias sunken: style.sunken
+    QStyleItem {
+        id: style
         anchors.fill: parent
-        anchors.margins: frameWidth
-        property int frameWidth: styleitem.pixelMetric("defaultframewidth");
+        elementType: "frame"
+        Item {
+            id: content
+            anchors.fill: parent
+            anchors.margins: frameWidth
+            property int frameWidth: styleitem.pixelMetric("defaultframewidth");
+        }
     }
 }
 
diff --git a/components/qmldir b/components/qmldir
index 3aaf43475..ae9e9eff9 100644
--- a/components/qmldir
+++ b/components/qmldir
@@ -6,6 +6,7 @@ ToolBar 0.1 ToolBar.qml
 TabFrame 0.1 TabFrame.qml
 TabBar 0.1 TabBar.qml
 Tab 0.1 Tab.qml
+Frame 0.1 Frame.qml
 ScrollArea 0.1 ScrollArea.qml
 ScrollBar 0.1 ScrollBar.qml
 ChoiceList 0.1 ChoiceList.qml
-- 
GitLab