1*bb02e0acSNicolas Bonnefon /* 2*bb02e0acSNicolas Bonnefon * Copyright (C) 2009, 2010 Nicolas Bonnefon and other contributors 3*bb02e0acSNicolas Bonnefon * 4*bb02e0acSNicolas Bonnefon * This file is part of glogg. 5*bb02e0acSNicolas Bonnefon * 6*bb02e0acSNicolas Bonnefon * glogg is free software: you can redistribute it and/or modify 7*bb02e0acSNicolas Bonnefon * it under the terms of the GNU General Public License as published by 8*bb02e0acSNicolas Bonnefon * the Free Software Foundation, either version 3 of the License, or 9*bb02e0acSNicolas Bonnefon * (at your option) any later version. 10*bb02e0acSNicolas Bonnefon * 11*bb02e0acSNicolas Bonnefon * glogg is distributed in the hope that it will be useful, 12*bb02e0acSNicolas Bonnefon * but WITHOUT ANY WARRANTY; without even the implied warranty of 13*bb02e0acSNicolas Bonnefon * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14*bb02e0acSNicolas Bonnefon * GNU General Public License for more details. 15*bb02e0acSNicolas Bonnefon * 16*bb02e0acSNicolas Bonnefon * You should have received a copy of the GNU General Public License 17*bb02e0acSNicolas Bonnefon * along with glogg. If not, see <http://www.gnu.org/licenses/>. 18*bb02e0acSNicolas Bonnefon */ 19*bb02e0acSNicolas Bonnefon 20*bb02e0acSNicolas Bonnefon #ifndef INFOLINE_H 21*bb02e0acSNicolas Bonnefon #define INFOLINE_H 22*bb02e0acSNicolas Bonnefon 23*bb02e0acSNicolas Bonnefon #include <QLabel> 24*bb02e0acSNicolas Bonnefon #include <QPalette> 25*bb02e0acSNicolas Bonnefon 26*bb02e0acSNicolas Bonnefon // Information line with integrated completion gauge 27*bb02e0acSNicolas Bonnefon // used for the file name and the search results. 28*bb02e0acSNicolas Bonnefon class InfoLine : public QLabel 29*bb02e0acSNicolas Bonnefon { 30*bb02e0acSNicolas Bonnefon public: 31*bb02e0acSNicolas Bonnefon // Default constructor 32*bb02e0acSNicolas Bonnefon InfoLine(); 33*bb02e0acSNicolas Bonnefon 34*bb02e0acSNicolas Bonnefon // Display the gauge in the background with the passed value (0-100) 35*bb02e0acSNicolas Bonnefon // This function doesn't change the text of the widget. 36*bb02e0acSNicolas Bonnefon void displayGauge( int completion ); 37*bb02e0acSNicolas Bonnefon // Hide the gauge and make the widget like a normal QLabel 38*bb02e0acSNicolas Bonnefon void hideGauge(); 39*bb02e0acSNicolas Bonnefon 40*bb02e0acSNicolas Bonnefon protected: 41*bb02e0acSNicolas Bonnefon void paintEvent(QPaintEvent* paintEvent); 42*bb02e0acSNicolas Bonnefon 43*bb02e0acSNicolas Bonnefon private: 44*bb02e0acSNicolas Bonnefon // The original palette of the QLabel 45*bb02e0acSNicolas Bonnefon QPalette origPalette_; 46*bb02e0acSNicolas Bonnefon // Color of the background 47*bb02e0acSNicolas Bonnefon const QColor backgroundColor_; 48*bb02e0acSNicolas Bonnefon // Color of the darkened background (left part of the gauge) 49*bb02e0acSNicolas Bonnefon const QColor darkBackgroundColor_; 50*bb02e0acSNicolas Bonnefon }; 51*bb02e0acSNicolas Bonnefon 52*bb02e0acSNicolas Bonnefon #endif 53