[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/base/plasma/declarative-applets/replacements/news/package
From:       Marco Martin <notmart () gmail ! com>
Date:       2011-04-09 15:56:19
Message-ID: 20110409155619.5C418AC8D1 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1227499 by mart:

use a common main.qml


 M  +6 -6      contents/ui/ComplexComponents/Toolbar.qml  
 A             contents/ui/MainUi (directory)  
 A             contents/ui/MainUi/MainUi.qml   [License: LGPL (v2+)]
 A             contents/ui/MainUi/qmldir  
 M  +3 -61     contents/ui/main.qml  
 A             platformcontents/application/tablet/ui/MainUi (directory)  
 A             platformcontents/application/tablet/ui/MainUi/MainUi.qml   [License: \
LGPL (v2+)]  A             platformcontents/application/tablet/ui/MainUi/qmldir  
 D             platformcontents/application/tablet/ui/main.qml  


--- trunk/playground/base/plasma/declarative-applets/replacements/news/package/contents/ui/ComplexComponents/Toolbar.qml \
#1227498:1227499 @@ -24,7 +24,7 @@
 
 PlasmaCore.FrameSvgItem {
     id: toolbarFrame
-    width: mainWindow.width
+    width: mainUi.width
     height: backButton.height + margins.top + margins.bottom
     clip: true
 
@@ -62,10 +62,10 @@
 
         onClicked: {
             if (!bodyView.customUrl) {
-                if (mainWindow.state == "item") {
-                    mainWindow.state = "items"
-                } else if (mainWindow.state == "items") {
-                    mainWindow.state = "feeds"
+                if (mainUi.state == "item") {
+                    mainUi.state = "items"
+                } else if (mainUi.state == "items") {
+                    mainUi.state = "feeds"
                 }
             }
             backRequested()
@@ -82,7 +82,7 @@
         maximumSize: minimumSize
 
         anchors.left: backButton.right
-        y: (mainWindow.state == "item")?toolbarFrame.margins.top:-height-5
+        y: (mainUi.state == "item")?toolbarFrame.margins.top:-height-5
 
         onClicked: {
             openOriginalRequested();
--- trunk/playground/base/plasma/declarative-applets/replacements/news/package/contents/ui/main.qml \
#1227498:1227499 @@ -18,13 +18,9 @@
  */
 
 import Qt 4.7
-import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
 import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.plasma.graphicslayouts 4.7 as GraphicsLayouts
 
-import "plasmapackage:/ui/BasicComponents"
-import "plasmapackage:/ui/ComplexComponents"
-import "plasmapackage:/code/utils.js" as Utils
+import "plasmapackage:/ui/MainUi"
 import "plasmapackage:/code/bookkeeping.js" as BookKeeping
 
 Item {
@@ -36,21 +32,6 @@
     property string source
     signal unreadCountChanged();
 
-    states: [
-         State {
-             name: "feeds"
-             PropertyChanges { target: mainView; currentIndex: 0 }
-         },
-         State {
-             name: "items"
-             PropertyChanges { target: mainView; currentIndex: 1 }
-         },
-         State {
-             name: "item"
-             PropertyChanges { target: mainView; currentIndex: 2 }
-         }
-     ]
-
     Component.onCompleted: {
         BookKeeping.mainWindow = mainWindow
         BookKeeping.loadReadArticles();
@@ -84,46 +65,7 @@
         id: theme
     }
 
-    Column {
-        Toolbar {
-            id: toolbarFrame
-            onOpenOriginalRequested: bodyView.url = Url(bodyView.articleUrl)
-            onBackRequested: bodyView.html = bodyView.articleHtml
+    MainUi {
+        anchors.fill: parent
         }
-
-        PlasmaWidgets.TabBar {
-            id : mainView
-            width : mainWindow.width
-            height: mainWindow.height-toolbarFrame.height
-            tabBarShown: false
-
-            onCurrentChanged: {
-                toolbarFrame.backEnabled = currentIndex > 0
-                toolbarFrame.searchEnabled = currentIndex < 2
             }
-
-            QGraphicsWidget {
-                id: feedListContainer
-                FeedList {
-                    id: feedList
-                    anchors.fill: feedListContainer
-                    onItemClicked: mainWindow.state = "items"
-                }
-            }
-            QGraphicsWidget {
-                id: listContainer
-
-                ItemsList {
-                    id: itemsList
-                    anchors.fill: listContainer
-                    feedCategory: feedList.feedCategory
-                    onItemClicked: mainWindow.state = "item"
-                }
-            }
-
-            ArticleView {
-                id : bodyView
-            }
-        }
-    }
-}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic