source: lumina/lumina-desktop/panel-plugins/systemtray/LSysTray.h @ 0e77750

releng/10.0.3releng/10.1releng/10.1.1
Last change on this file since 0e77750 was 0e77750, checked in by Ken Moore <ken@…>, 8 months ago

Large update to the Lumina Panel Plugins:
1) Now all the buttons/plugins should resize to fit the panel appropriately
2) All buttons/plugins operate when the panel is either horizontal *or* vertical3) Task Manager buttons will now only display the icon for a window if the application supplies one (similar to windows/mac, application icons are assumed to be unique). If an icon could *not* be found, it will provide a generic one as well as list the application on the button (to distinguish between multiple apps that show the same icon). The application name is also set as the tooltip for the button, so users can easily check what app an icon refers to if necessary.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1//===========================================
2//  Lumina-DE source code
3//  Copyright (c) 2012, Ken Moore
4//  Available under the 3-clause BSD license
5//  See the LICENSE file for full details
6//===========================================
7#ifndef _LUMINA_DESKTOP_SYSTRAY_H
8#define _LUMINA_DESKTOP_SYSTRAY_H
9
10//Qt includes
11#include <QFrame>
12#include <QHBoxLayout>
13#include <QDebug>
14#include <QX11Info>
15#include <QX11EmbedContainer>
16
17//Local includes
18#include "../../LSession.h"
19#include "../LPPlugin.h"
20#include "TrayIcon.h"
21
22class LSysTray : public LPPlugin{
23        Q_OBJECT
24public:
25        LSysTray(QWidget *parent = 0, QString id="systemtray", bool horizontal=true);
26        ~LSysTray();
27
28        void start();
29        void stop();
30       
31private:
32        bool isRunning;
33        QList<TrayIcon*> trayIcons;
34        QFrame *frame;
35        QBoxLayout *LI; //layout items
36       
37private slots:
38        void addTrayIcon(WId win);
39        void updateStatus();
40        void trayAppClosed();
41
42public slots:
43        virtual void OrientationChange(){
44           //make sure the internal layout has the same orientation as the main widget
45           LI->setDirection( this->layout()->direction() );
46           //Re-adjust the maximum widget size
47          int sz;
48          if(this->layout()->direction()==QBoxLayout::LeftToRight){
49            this->setMaximumSize( trayIcons.length()*this->height(), 10000);
50            sz = this->height()-2*frame->frameWidth();
51          }else{
52            this->setMaximumSize(10000, trayIcons.length()*this->width());
53            sz = this->width()-2*frame->frameWidth();
54          }
55          for(int i=0; i<trayIcons.length(); i++){
56            trayIcons[i]->setSizeSquare(sz);
57            trayIcons[i]->updateIcon();
58          }
59        }
60};
61
62#endif
Note: See TracBrowser for help on using the repository browser.