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

List:       kde-commits
Subject:    playground/base/plasma/applets/welcome/cpp
From:       Matthew Adams <roguestar191 () comcast ! net>
Date:       2009-02-16 12:52:21
Message-ID: 1234788741.399322.6281.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 926925 by madams:

set a location to allow popupApplets to autoexpand
Remove white background from Plasma::View
Minor other tweaks?


 M  +1 -0      source/containment/CMakeLists.txt  
 M  +18 -2     source/containment/floatpanel.cpp  
 M  +20 -14    source/containment/panel.cpp  
 M  +6 -6      todo  


--- trunk/playground/base/plasma/applets/welcome/cpp/source/containment/CMakeLists.txt \
#926924:926925 @@ -5,6 +5,7 @@
 )
 set(floatpanel_SRCS
 	floatpanel.cpp
+	panel.cpp
    
 )
 find_package(KDE4 REQUIRED)
--- trunk/playground/base/plasma/applets/welcome/cpp/source/containment/floatpanel.cpp \
#926924:926925 @@ -6,6 +6,8 @@
 #include <Plasma/View>
 #include <QGraphicsProxyWidget>
 #include <KDebug>
+#include "panel.h"
+
 class MyView : public Plasma::View {
 	public:
 		Plasma::Containment *containment;
@@ -14,6 +16,8 @@
 			setAttribute(Qt::WA_NoSystemBackground);
 			setWallpaperEnabled(false);
 			kDebug() << isWallpaperEnabled() << " " << trackContainmentChanges();
+			setWindowFlags (Qt::FramelessWindowHint);
+			setStyleSheet("background: transparent"); 
 		}
 		void setContainment(Plasma::Containment *_c) {
 			Plasma::View::setContainment(_c);
@@ -29,6 +33,8 @@
 			containment->resize(e->size());
 			containment->setGeometry(geometry());
 			containment->mapToView(this, geometry());
+			 containment->updateConstraints(Plasma::AllConstraints);
+			containment->flushPendingConstraintsEvents();
 		}
 		void moveEvent(QMoveEvent *e) {
 			Plasma::View::moveEvent(e);
@@ -54,14 +60,23 @@
 				kDebug() << "Warning: No corona.. Making one";
 				corona = new Plasma::Corona(this);
 			}
-			containment = corona->addContainment("welcomepanel");
+			QString name = "welcomepanel";
+			uint id = 0;
+			QVariantList appletargs;
+			appletargs << "welcomepanel" << "0";
+//			containment = new welcome_plasmoid::Panel(const_cast<FloatPanel*>(this), \
appletargs); +
+			containment = corona->addContainment("welcomepanel", QVariantList());
 //			corona->addOffscreenWidget(containment);
+
 			setAcceptDrops(true);
 			containment->setAcceptDrops(true);
 			containment->setMinimumSize(1,1);
 			containment->setMaximumSize(167722,167722);
+			containment->init();
+			containment->updateConstraints(Plasma::AllConstraints);
+			corona->addItem(containment);			
 
-			
 			QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(mainWidget);
 			QGraphicsLinearLayout *widgetLayout = new QGraphicsLinearLayout(mainWidget);
 			MyView *view = new MyView(containment, corona, this->view());
@@ -72,6 +87,7 @@
 			widgetLayout->addItem(proxy);
 			proxy->setWidget(view);
 			mainLayout->addItem(mainWidget);
+//			mainLayout->addItem(containment);
 			kDebug() << "Containments Scene: " << containment->scene();
 		}
 		
--- trunk/playground/base/plasma/applets/welcome/cpp/source/containment/panel.cpp \
#926924:926925 @@ -155,7 +155,7 @@
     } else {
         m_currentSize.expandedTo(QSize(35, 0));
     }
-
+	setLocation(Plasma::BottomEdge);
     setMinimumSize(cg.readEntry("minimumSize", m_currentSize));
     setMaximumSize(cg.readEntry("maximumSize", m_currentSize));
 //    setDrawWallpaper(false);
@@ -520,8 +520,8 @@
 
         QGraphicsView *panelView = view();
         if (panelView) {
-           // updateBorders(panelView->geometry());
-        }
+            updateBorders(panelView->geometry());
+        } else updateBorders(geometry().toRect());
     }
 }
 
@@ -586,9 +586,9 @@
         m_lastViewGeom = viewGeom;
 
         updateBorders(viewGeom);
-        if (containmentOpt && containmentOpt->view) {
+//        if (containmentOpt && containmentOpt->view) {
 //            containmentOpt->view->setMask(m_background->mask());
-        }
+//        }
     }
 
     // blit the background (saves all the per-pixel-products that blending does)
@@ -616,6 +616,7 @@
         case Plasma::Floating:
             //TODO: implement a form factor for floating panels
             kDebug() << "Floating is unimplemented.";
+		setFormFactor(Plasma::Horizontal);
             break;
         default:
             kDebug() << "invalid location!!";
@@ -654,9 +655,13 @@
 }
 void Panel::addApplet(Applet *applet, const QPointF &pos, bool delayInit)
  {
-//	)this)->addApplet(applet, pos, delayInit);
-//	return;
-/* 
+	Plasma::Containment::addApplet(applet, pos, false);
+	applet->updateConstraints(Plasma::StartupCompletedConstraint);
+	applet->updateConstraints(Plasma::AllConstraints);
+	applet->flushPendingConstraintsEvents();
+         applet->setParentItem(this);
+
+	/*
      if (!applet) {
          kDebug() << "adding null applet!?!";
          return;
@@ -668,10 +673,10 @@
  
      Containment *currentContainment = applet->containment();
  
-     if (d->type == PanelContainment) {
+//     if (d->type == PanelContainment) {
          //panels don't want backgrounds, which is important when setting geometry
          setBackgroundHints(NoBackground);
-     }
+//     }
  
      if (currentContainment && currentContainment != this) {
          emit currentContainment->appletRemoved(applet);
@@ -682,6 +687,7 @@
          if (currentContainment->d->handles.contains(applet)) {
              currentContainment->d->handles.remove(applet);
          }
+
          applet->setParentItem(this);
  
          // now move the old config to the new location
@@ -731,10 +737,10 @@
          }
     }
  
-    if (!delayInit) {
-         applet->d->scheduleModificationNotification();
-     }
- */
+//    if (!delayInit) {
+//         applet->d->scheduleModificationNotification();
+//     }
+*/
  }
 
 
--- trunk/playground/base/plasma/applets/welcome/cpp/todo #926924:926925
@@ -1,14 +1,14 @@
+1*) = highest priority, higher numbers = lower priority.
 High priority bug fix's:
 
-Remove white background from Plasma::View
-Get popupPosition to work properly on applets inside floatpanel applet containing \
                welcomepanel containment
-save/load welcomepanel containment from floatpanel applet properly and not as it's \
own entry in plasma-desktop-appletsrc +1*)Get popupPosition to work properly on \
applets inside floatpanel applet containing welcomepanel containment  
+1*)save/load welcomepanel containment from floatpanel applet properly and not as \
it's own entry in plasma-desktop-appletsrc +
+2*)make sure floatpanel properly resizes width when starting up
+
 High priority Enhancements possible:
 
-Reload sub-applet on the fly
-Allow resizing of sub-applet frame, and act like panel (When shrunk small enough \
                show icon only, when big enough pop out graphicsWidget() in a \
                popupWindow..)
-
 Add plasma tooltips to everything
 
 ---------------------------------


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

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