Mercurial > hg > easaier-soundaccess
changeset 159:685e31447355
add videoIcon and new LNF for the advanced toolbox
author | benoitrigolleau |
---|---|
date | Thu, 15 Nov 2007 14:41:11 +0000 |
parents | 9441b45b1e7f |
children | 925b77f25cd9 |
files | sv/icons/videoIcon.png widgets/AdvancedToolBox.cpp widgets/AdvancedToolBox.h widgets/RadialLNFButton.cpp widgets/RadialLNFButton.h widgets/SearchWidget.cpp widgets/svwidgets.vcproj |
diffstat | 7 files changed, 165 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/widgets/AdvancedToolBox.cpp Thu Nov 15 13:47:07 2007 +0000 +++ b/widgets/AdvancedToolBox.cpp Thu Nov 15 14:41:11 2007 +0000 @@ -41,7 +41,7 @@ m_layout = new QVBoxLayout; m_layout->setMargin(0); m_layout->setSpacing(0); - m_button = new QPushButton(QIcon(), text); + m_button = new RadialLNFButton(QIcon(), text); m_button->setMaximumHeight(m_btnHeight); m_button->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
--- a/widgets/AdvancedToolBox.h Thu Nov 15 13:47:07 2007 +0000 +++ b/widgets/AdvancedToolBox.h Thu Nov 15 14:41:11 2007 +0000 @@ -21,6 +21,8 @@ #include <QLayout> #include <QSplitter> #include <QWidget> +#include <QIcon> +#include "RadialLNFButton.h" class PrivateWidget : public QWidget @@ -37,7 +39,7 @@ private : void refreshButtonIcone(); - QPushButton *m_button; + RadialLNFButton *m_button; QWidget *m_widget; QLayout *m_layout;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgets/RadialLNFButton.cpp Thu Nov 15 14:41:11 2007 +0000 @@ -0,0 +1,81 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Sound Access + EASAIER client application. + Silogic 2007. Benoit Rigolleau. + + 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. See the file + COPYING included with this distribution for more information. +*/ + + +#include "RadialLNFButton.h" +#include <QPainter> +#include <QPalette> + +RadialLNFButton::RadialLNFButton(QWidget *parent):QPushButton(parent) +{ + this->setFlat(true); +} + +RadialLNFButton::RadialLNFButton (const QIcon & icon, const QString & text, QWidget * parent ):QPushButton(icon,text,parent) +{ + this->setFlat(true); +} + +void RadialLNFButton::paintEvent(QPaintEvent *event) +{ + + + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing, false); + draw(&painter); + QPushButton::paintEvent(event); +} + +void RadialLNFButton::draw(QPainter *painter) +{ + + QPalette actualPalette; + QColor color1 = actualPalette.color(QPalette::Highlight); + QColor color2 = actualPalette.color(QPalette::Button); + //QColor color3(QRgb(0xffffcc15)); + + color1.setAlpha(90); + //color3.setAlpha(70) + //color2.setAlpha(80); + + //QColor color1(QRgb(0xffaaaaaa)); + + //QColor color2(QRgb(0xffdbf756)); + //color2.setAlpha(100); + + + painter->setPen(QPen(palette().foreground(),1,Qt::NoPen,Qt::RoundCap)); + + /* + int rectsize = this->width()/20; + for(int i=0;i<=20;i++){ + if((i+m_ind)%2){ + painter->setBrush(QBrush(color1, Qt::SolidPattern)); + } + else{ + painter->setBrush(QBrush(Qt::white, Qt::SolidPattern)); + } + painter->drawRect(i*rectsize,0,this->width(), this->height()); + } + */ + + QLinearGradient rectRadian(0,0,this->width(),0); + rectRadian.setColorAt(0,color1); + rectRadian.setColorAt(0.8,color2); + rectRadian.setColorAt(1,color2); + + painter->setPen(QPen(palette().foreground(),1,Qt::NoPen,Qt::RoundCap)); + painter->setBrush(rectRadian); + painter->drawRect(0,0,this->width(), this->height()); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgets/RadialLNFButton.h Thu Nov 15 14:41:11 2007 +0000 @@ -0,0 +1,45 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Sound Access + EASAIER client application. + Silogic 2007. Benoit Rigolleau. + + 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. See the file + COPYING included with this distribution for more information. +*/ + +#ifndef RADIAL_LNF_BUTTON +#define RADIAL_LNF_BUTTON + +#include <QPushButton> +#include <QPaintEvent> +#include <QPainter> + +class RadialLNFButton : public QPushButton{ + Q_OBJECT + +public: + RadialLNFButton(QWidget *parent=0); + RadialLNFButton ( const QIcon & icon, const QString & text, QWidget * parent = 0 ); +/*public slots: + void setAnimation(bool animate);*/ + +protected: + void paintEvent(QPaintEvent *event); + void draw(QPainter *painter); +// void timerEvent(QTimerEvent *e); + +private: +// int m_ind; +// QBasicTimer timer; + +}; + + + + +#endif \ No newline at end of file
--- a/widgets/SearchWidget.cpp Thu Nov 15 13:47:07 2007 +0000 +++ b/widgets/SearchWidget.cpp Thu Nov 15 14:41:11 2007 +0000 @@ -189,6 +189,7 @@ case PropertyContainer::ValueProperty: { QComboBox* box = new QComboBox(); + box->addItems(curTheme->getPropertyRange(name)); connect(box, SIGNAL(currentIndexChanged(int)), curTheme, SLOT(setProperty(int)));
--- a/widgets/svwidgets.vcproj Thu Nov 15 13:47:07 2007 +0000 +++ b/widgets/svwidgets.vcproj Thu Nov 15 14:41:11 2007 +0000 @@ -290,6 +290,10 @@ > </File> <File + RelativePath=".\RadialLNFButton.cpp" + > + </File> + <File RelativePath="RangeInputDialog.cpp" > </File> @@ -1120,6 +1124,32 @@ </FileConfiguration> </File> <File + RelativePath=".\RadialLNFButton.h" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCustomBuildTool" + Description="MOC $(InputFileName)" + CommandLine="$(QTDIR)\bin\moc.exe -DNDEBUG -DBUILD_RELEASE -DUSE_VC -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_BZ2 -DHAVE_PORTAUDIO -DHAVE_PORTAUDIO_V18 -DHAVE_OGGZ -DHAVE_FISHSOUND -DHAVE_FFTW3F -DHAVE_VAMP -DHAVE_VAMP_HOSTSDK -DHAVE_SNDFILE -DHAVE_SAMPLERATE -DQT_THREAD_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include\QtXml" -I "$(QTDIR)\include\QtXml" -I "$(QTDIR)\include" -I "." -I ".." -I "$(QTDIR)\include\ActiveQt" -I "tmp_moc" -I "." -I"$(QTDIR)\mkspecs\win32-msvc2005" $(InputPath) -o tmp_moc\moc_$(InputName).cpp" + AdditionalDependencies="$(QTDIR)\bin\moc.exe" + Outputs="tmp_moc\moc_$(InputName).cpp" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCustomBuildTool" + Description="MOC $(InputFileName)" + CommandLine="$(QTDIR)\bin\moc.exe -DBUILD_DEBUG -DUSE_VC -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_BZ2 -DHAVE_PORTAUDIO -DHAVE_PORTAUDIO_V18 -DHAVE_OGGZ -DHAVE_FISHSOUND -DHAVE_FFTW3F -DHAVE_VAMP -DHAVE_VAMP_HOSTSDK -DHAVE_SNDFILE -DHAVE_SAMPLERATE -DQT_THREAD_SUPPORT -DQT_DLL -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include\QtXml" -I "$(QTDIR)\include\QtXml" -I "$(QTDIR)\include" -I "." -I ".." -I "$(QTDIR)\include\ActiveQt" -I "tmp_moc" -I "." -I"$(QTDIR)\mkspecs\win32-msvc2005" $(InputPath) -o tmp_moc\moc_$(InputName).cpp" + AdditionalDependencies="$(QTDIR)\bin\moc.exe" + Outputs="tmp_moc\moc_$(InputName).cpp" + /> + </FileConfiguration> + </File> + <File RelativePath="RangeInputDialog.h" > <FileConfiguration @@ -1682,6 +1712,10 @@ > </File> <File + RelativePath=".\tmp_moc\moc_RadialLNFButton.cpp" + > + </File> + <File RelativePath="tmp_moc\moc_RangeInputDialog.cpp" > </File>