[SCM] ktp-contact-applet packaging branch, master, updated. debian/15.12.1-1-966-gde83ac5

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:18:18 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=bd38b62

The following commit has been merged in the master branch:
commit bd38b62f9ca9ebd941b472a616036110422bd857
Author: Aleix Pol <aleixpol at kde.org>
Date:   Sun Feb 24 13:46:57 2013 +0100

    Improve behavior on smaller sizes
    
    Improve the minimumHeight/Width implementation
    Provide a preferredHeight/Width implementation
    With this patch it will look properly when placed in a panel with limited
    space.
    
    REVIEW: 109089
---
 chat/org.kde.ktp-chat/contents/ui/main.qml | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/chat/org.kde.ktp-chat/contents/ui/main.qml b/chat/org.kde.ktp-chat/contents/ui/main.qml
index 3a9b74d..b0f7245 100644
--- a/chat/org.kde.ktp-chat/contents/ui/main.qml
+++ b/chat/org.kde.ktp-chat/contents/ui/main.qml
@@ -27,10 +27,15 @@ import org.kde.qtextracomponents 0.1 as ExtraComponents
 Grid {
     id: base
     property real minimumItemSize: 4
-    property real minimumHeight: 1+(flow===Flow.LeftToRight ? minimumItemSize : base.childrenRect.height)
-    property real minimumWidth: 1+(flow===Flow.LeftToRight ? base.childrenRect.width : minimumItemSize)
-    property real itemSize: Math.min(base.width, base.height)
+    property real preferredItemSize: Math.max(0, Math.min(width, height))
+    property real preferredHeight: flow===Flow.TopToBottom ? itemsCount*preferredItemSize : preferredItemSize
+    property real preferredWidth: flow===Flow.LeftToRight ? itemsCount*preferredItemSize : preferredItemSize
+    property real minimumHeight: flow===Flow.TopToBottom ? itemsCount*minimumItemSize : minimumItemSize
+    property real minimumWidth: flow===Flow.LeftToRight ? itemsCount*minimumItemSize : minimumItemSize
     property int currentIndex: -1
+    property int itemsCount: pinnedModel.count + handler.conversations.count
+    property real itemWidth: Math.max(0, flow===Flow.LeftToRight ? Math.min(height, width/itemsCount) : width)
+    property real itemHeight:Math.max(0, flow===Flow.TopToBottom ? Math.min(width, height/itemsCount) : height)
 
     clip: true
     spacing: 2
@@ -62,11 +67,12 @@ Grid {
             base.currentIndex = handler.conversations.nextActiveConversation(base.currentIndex+1 % handler.conversations)
         });
     }
+    onItemsCountChanged: reconsiderStatus()
 
     Repeater {
         delegate: ConversationDelegateButton {
-            width: base.itemSize
-            height: width
+            width: base.itemWidth
+            height: base.itemHeight
             visible: available && !alreadyChatting
             onClicked: handler.conversations.startChat(account, contact)
             avatar: decoration
@@ -98,11 +104,10 @@ Grid {
     Repeater {
         id: conversationsView
         delegate: ConversationDelegate {
-            width: base.itemSize
-            height: width
+            width: base.itemWidth
+            height: base.itemHeight
             popupBelow: base.flow === Flow.LeftToRight
         }
         model: handler.conversations
-        onCountChanged: reconsiderStatus()
     }
 }

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list