source: lumina/lumina-desktop/panel-plugins/battery/LBattery.h @ 0e77750

releng/10.0.3releng/10.1
Last change on this file since 0e77750 was 0e77750, checked in by Ken Moore <ken@…>, 5 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.1 KB
Line 
1//===========================================
2//  Lumina-DE source code
3//  Copyright (c) 2014, Susanne Jaeckel
4//  Available under the 3-clause BSD license
5//  See the LICENSE file for full details
6//===========================================
7#ifndef _LUMINA_DESKTOP_BATTERY_H
8#define _LUMINA_DESKTOP_BATTERY_H
9
10#include <QTimer>
11#include <QWidget>
12#include <QString>
13#include <QLabel>
14
15#include <LuminaUtils.h>
16#include <LuminaXDG.h>
17
18#include "../../Globals.h"
19//#include "../LTBWidget.h"
20#include "../LPPlugin.h"
21
22class LBattery : public LPPlugin{
23        Q_OBJECT
24public:
25        LBattery(QWidget *parent = 0, QString id = "battery", bool horizontal=true);
26        ~LBattery();
27       
28private:
29        QTimer *timer;
30        QLabel *label;
31        int iconOld;
32       
33private slots:
34        void updateBattery(bool force = false);
35        QString getRemainingTime();
36
37public slots:
38        void OrientationChange(){
39          if(this->layout()->direction()==QBoxLayout::LeftToRight){
40            label->setFixedSize( QSize(this->height(), this->height()) );
41          }else{
42            label->setFixedSize( QSize(this->width(), this->width()) );
43          }
44          updateBattery(true); //force icon refresh
45        }
46};
47
48#endif
Note: See TracBrowser for help on using the repository browser.