mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-18 22:10:37 -04:00
added new xProgressBar, thanks to xesk
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@338 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
b7abbda1fb
commit
81fcc83bdc
6 changed files with 405 additions and 51 deletions
67
retroshare-gui/src/gui/xprogressbar.h
Normal file
67
retroshare-gui/src/gui/xprogressbar.h
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* xProgressBar: A custom progress bar for Qt 4.
|
||||
* Author: xEsk (Xesc & Technology 2008)
|
||||
*
|
||||
* Changelog:
|
||||
*
|
||||
* v1.0:
|
||||
* -----
|
||||
* - First release
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#ifndef XPROGRESSBAR_H
|
||||
#define XPROGRESSBAR_H
|
||||
//
|
||||
#include <QRect>
|
||||
#include <QColor>
|
||||
#include <QPainter>
|
||||
#include <QLinearGradient>
|
||||
#include <QLocale>
|
||||
//
|
||||
class xProgressBar : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
// progress vlues
|
||||
float progressValue;
|
||||
int schemaIndex;
|
||||
bool displayText;
|
||||
int vSpan;
|
||||
int hSpan;
|
||||
// painter config
|
||||
QRect rect;
|
||||
QPainter *painter;
|
||||
// text color
|
||||
QColor textColor;
|
||||
// progress colors
|
||||
QColor backgroundBorderColor;
|
||||
QColor backgroundColor;
|
||||
QColor gradBorderColor;
|
||||
QColor gradColor1;
|
||||
QColor gradColor2;
|
||||
// configure the color
|
||||
void setColor();
|
||||
public:
|
||||
xProgressBar(QRect rect, QPainter *painter, int schemaIndex = 0);
|
||||
void paint();
|
||||
void setValue(const float value);
|
||||
void setDisplayText(const bool display);
|
||||
void setVerticalSpan(const int value);
|
||||
void setHorizontalSpan(const int value);
|
||||
};
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue