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

List:       kde-panel-devel
Subject:    Re: [Panel-devel] trashcan applet
From:       Marco Martin <martkive () gmail ! com>
Date:       2007-11-28 21:55:41
Message-ID: 200711282255.41665.martkive () gmail ! com
[Download RAW message or body]

Hi,
third patch...
in the update of yesterday i've seen more or less all the applets that used 
plasma::Icon like the trashcan, the launcher and lock/logout seems to be 
broken, only a little chunk of the icon is displayed, it's my build (uhm 
updated and rebuilt everything two time for that :P) or it's "normal"?
by the way in this patch i have more or less fixed the issue.
maybe tomorrow i will make a patch for the launcher, i would like to make it 
like the trash applet (no background and text uner it), does it make sense?

it still has the problem that it is impossible to resize it, i've tried to put 
this code in constraintsUpdated()
if (constraints & Plasma::SizeConstraint && m_icon) {
        m_icon->setIconSize(contentSize().toSize());
        update();
    }
and that of course doesn't work at all :) what is wrong?

one other thing. in the svn of today now clicking on open it seems to work, 
but it opens konqueror insted of dolphin: it seems konqueror is still the 
default for the inode/directory mimetype

Cheers,
Marco Martin


["3_trash-patch.diff" (text/x-diff)]

Only in /opt/svn/trash/: Messages.sh
Only in /opt/svn/trash/: .svn
diff -Eb -U 3 -d /opt/svn/trash/trash.cpp trash/trash.cpp
--- /opt/svn/trash/trash.cpp	2007-11-26 16:28:54.000000000 +0100
+++ trash/trash.cpp	2007-11-28 22:37:34.000000000 +0100
@@ -32,7 +32,6 @@
 
 
 #include <konq_operations.h>
-#include <plasma/layouts/boxlayout.h>
 #include <plasma/widgets/icon.h>
 #include <plasma/containment.h>
 
@@ -56,7 +55,9 @@
 
     createMenu();
 
-    new Plasma::HBoxLayout(this);
+    m_layout = new Plasma::HBoxLayout(this);
+    m_layout->setMargin(0);
+    m_layout->setSpacing(0);
 
     m_icon = new Plasma::Icon(KIcon("user-trash"),QString(),this);
 
@@ -64,6 +65,9 @@
             this, SLOT(popup(bool,QGraphicsSceneMouseEvent*)));
     m_icon->setIconSize(size, size);
     resize(m_icon->sizeHint());
+    setMinimumSize(QSize(48,48));
+    setMaximumSize(QSize(400,400));
+    m_layout->addItem(m_icon);
 
     setAcceptDrops(true);
 
@@ -137,9 +141,14 @@
             m_icon->setInfoText(0);
             m_showText = false;
         }
-        updateGeometry();
         setIcon();
     }
+    /*if (constraints & Plasma::SizeConstraint && m_icon) {
+        m_icon->setIconSize(contentSize().toSize());
+        update();
+    }*/
+
+    updateGeometry();
 }
 
 void Trash::slotOpen()
diff -Eb -U 3 -d /opt/svn/trash/trash.h trash/trash.h
--- /opt/svn/trash/trash.h	2007-11-26 16:28:54.000000000 +0100
+++ trash/trash.h	2007-11-28 22:37:34.000000000 +0100
@@ -29,6 +29,7 @@
 #include <KDirLister>
 
 #include <plasma/applet.h>
+#include <plasma/layouts/boxlayout.h>
 
 class KPropertiesDialog;
 
@@ -73,6 +74,7 @@
         KPropertiesDialog *m_dialog;
         KDirLister *m_dirLister;
         KUrl m_trashUrl;
+        Plasma::HBoxLayout *m_layout;
         KMenu m_menu;
         int m_count;
         bool m_showText;


_______________________________________________
Panel-devel mailing list
Panel-devel@kde.org
https://mail.kde.org/mailman/listinfo/panel-devel


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

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