source: lumina/lumina-desktop/panel-plugins/systemtray/LSysTray.h @ 9d0ec76

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

Update lumina-desktop to use the new abilities in LuminaOS instead of the GLobals.h file. Now all the OS-specific stuff is contained in a single location.

  • Property mode set to 100644
File size: 1.6 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#include <QCoreApplication>
17
18//Local includes
19#include "../../LSession.h"
20#include "../LPPlugin.h"
21#include "TrayIcon.h"
22
23class LSysTray : public LPPlugin{
24        Q_OBJECT
25public:
26        LSysTray(QWidget *parent = 0, QString id="systemtray", bool horizontal=true);
27        ~LSysTray();
28
29        void start();
30        void stop();
31       
32private:
33        bool isRunning;
34        QList<TrayIcon*> trayIcons;
35        QFrame *frame;
36        QBoxLayout *LI; //layout items
37       
38private slots:
39        void addTrayIcon(WId win);
40        void updateStatus();
41        void trayAppClosed();
42
43public slots:
44        virtual void OrientationChange(){
45           //make sure the internal layout has the same orientation as the main widget
46           LI->setDirection( this->layout()->direction() );
47           //Re-adjust the maximum widget size
48          int sz;
49          if(this->layout()->direction()==QBoxLayout::LeftToRight){
50            this->setMaximumSize( trayIcons.length()*this->height(), 10000);
51            sz = this->height()-2*frame->frameWidth();
52          }else{
53            this->setMaximumSize(10000, trayIcons.length()*this->width());
54            sz = this->width()-2*frame->frameWidth();
55          }
56          for(int i=0; i<trayIcons.length(); i++){
57            trayIcons[i]->setSizeSquare(sz);
58            trayIcons[i]->updateIcon();
59          }
60        }
61};
62
63#endif
Note: See TracBrowser for help on using the repository browser.