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

List:       kde-commits
Subject:    [kdeplasma-addons/rshah/comicqml] applets/comic/package/contents/ui: fixed button bar layout inside
From:       Reza Shah <rshah0385 () kireihana ! com>
Date:       2012-10-31 22:41:03
Message-ID: 20121031224103.1606DA60C4 () git ! kde ! org
[Download RAW message or body]

Git commit 8aa9e8a84542618711456a9a2f6dd44853887eb4 by Reza Shah.
Committed on 31/10/2012 at 23:40.
Pushed by rshah into branch 'rshah/comicqml'.

fixed button bar layout inside ImageWidget

M  +23   -16   applets/comic/package/contents/ui/ImageWidget.qml

http://commits.kde.org/kdeplasma-addons/8aa9e8a84542618711456a9a2f6dd448538=
87eb4

diff --git a/applets/comic/package/contents/ui/ImageWidget.qml b/applets/co=
mic/package/contents/ui/ImageWidget.qml
index 0577e4d..e00c057 100644
--- a/applets/comic/package/contents/ui/ImageWidget.qml
+++ b/applets/comic/package/contents/ui/ImageWidget.qml
@@ -34,28 +34,35 @@ PlasmaExtras.ScrollArea {
         id: viewContainer
         anchors.fill:parent
 =

-        contentWidth: calculateContentWidth()
-        contentHeight: calculateContentHeight()
+        contentWidth: dummy.width
+        contentHeight: dummy.height
         clip: true
 =

-        QImageItem {
-            id: comicPicture
-            width: actualSize ? comicPicture.nativeWidth : viewContainer.w=
idth
-            height: actualSize ? comicPicture.nativeHeight : viewContainer=
.height
-            anchors.centerIn: parent
-            smooth: true
-            fillMode: QImageItem.PreserveAspectFit
+        Rectangle {
+            id: dummy
+            color:"transparent"
+            width: Math.max(comicPicture.width, viewContainer.width);
+            height: Math.max(comicPicture.height, viewContainer.height);
+
+            QImageItem {
+                id: comicPicture
+                width: actualSize ? comicPicture.nativeWidth : viewContain=
er.width
+                height: actualSize ? comicPicture.nativeHeight : viewConta=
iner.height
+                anchors.centerIn: parent
+                smooth: true
+                fillMode: QImageItem.PreserveAspectFit
+            }
 =

             MouseArea {
                 id:mouseArea
-                anchors.fill: comicPicture
+                anchors.fill: parent
                 hoverEnabled: true
                 preventStealing: false
                 acceptedButtons: Qt.LeftButton | Qt.MiddleButton
 =

                 PlasmaCore.ToolTip {
                     id: tooltip
-                    target: mouseArea
+                    //target: imageWidget
                 }
 =

                 onClicked: {
@@ -66,12 +73,12 @@ PlasmaExtras.ScrollArea {
 =

                 ButtonBar {
                     id: buttonBar
-                    visible: (comicApplet.arrowsOnHover && mouseArea.conta=
insMouse)
+                    visible: (comicApplet.arrowsOnHover && (mouseArea.cont=
ainsMouse || (mouseArea.containsMouse && buttonBar.visible)) )
                     opacity: 0
-                    anchors {
-                        horizontalCenter: parent.horizontalCenter
-                        //bottom: imageWidget.bottom
-                        //bottomMargin:10
+
+                    pos {
+                        y: viewContainer.height - buttonBar.height + viewC=
ontainer.contentY
+                        x: (viewContainer.width - buttonBar.width)/2 + vie=
wContainer.contentX
                     }
                     states: State {
                         name: "show"; when: (comicApplet.arrowsOnHover && =
mouseArea.containsMouse)
[prev in list] [next in list] [prev in thread] [next in thread] 

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