diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-05-11 20:25:10 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-05-11 20:25:10 +0000 |
commit | aea4882f3b37f17c5b56bc77667e683c52254c30 (patch) | |
tree | ab57f2e9f5011386b7a579a30a4a2d2e1693680c /src/knutdock.cpp | |
parent | 0ab338256011c6b29494f9f69a2fba2afc147e16 (diff) | |
download | knutclient-aea4882f3b37f17c5b56bc77667e683c52254c30.tar.gz knutclient-aea4882f3b37f17c5b56bc77667e683c52254c30.zip |
Fixed accidental tray icon blurring at standard 22x22 icon size
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knutclient@1125612 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/knutdock.cpp')
-rwxr-xr-x | src/knutdock.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/knutdock.cpp b/src/knutdock.cpp index 9626f3b..b3973ae 100755 --- a/src/knutdock.cpp +++ b/src/knutdock.cpp @@ -38,6 +38,9 @@ //#include <iostream> +//#define ICON_SIZE 24 +#define ICON_SIZE 22 + KNutDock::KNutDock(KNutVarData::upsInfoDef* activeUpsInfo, KNutVarData::SettingDataDef* settingData, KNutUpsData* upsRecords){ QString valueName; @@ -68,13 +71,14 @@ KNutDock::KNutDock(KNutVarData::upsInfoDef* activeUpsInfo, KNutVarData::SettingD m_battPix = UserIcon ("knc_batt"); createMainMenu(); +#define ICON_SIZE 22 m_statusLayer = 0; m_runtimeLayer = 0; - m_loadLayer = new QPixmap(24,24); - m_chargeLayer = new QPixmap(24,24); - m_mainLayer = new QPixmap(24,24); + m_loadLayer = new QPixmap(ICON_SIZE,ICON_SIZE); + m_chargeLayer = new QPixmap(ICON_SIZE,ICON_SIZE); + m_mainLayer = new QPixmap(ICON_SIZE,ICON_SIZE); initImage(); @@ -139,14 +143,14 @@ void KNutDock::changeKIcon (void) { if (m_mainLayer) { delete m_mainLayer; - m_mainLayer=new QPixmap(24,24); + m_mainLayer=new QPixmap(ICON_SIZE,ICON_SIZE); } if (!m_statusLayer) { - m_statusLayer = new QPixmap(24,24); + m_statusLayer = new QPixmap(ICON_SIZE,ICON_SIZE); } if (!m_runtimeLayer) { - m_runtimeLayer = new QPixmap(24,24); + m_runtimeLayer = new QPixmap(ICON_SIZE,ICON_SIZE); } paintStatus(m_statusValue); paintRuntime(m_runtimeValue, m_statusValue); @@ -299,18 +303,18 @@ void KNutDock::repaintDock (const bool always) { switch (m_typeOfIcon) { case generalKI: m_mainLayer->fill(m_myBGColor); -// copyBlt (m_mainLayer,0,0,m_runtimeLayer,0,0,24,24); - bitBlt (m_mainLayer,0,0,m_runtimeLayer,0,0,24,24,AndROP); - bitBlt (m_mainLayer,0,0,m_loadLayer,0,0,24,24,AndROP); - bitBlt (m_mainLayer,0,0,m_chargeLayer,0,0,24,24,AndROP); - bitBlt (m_mainLayer,0,0,m_statusLayer,0,0,24,24,AndROP); +// copyBlt (m_mainLayer,0,0,m_runtimeLayer,0,0,ICON_SIZE,ICON_SIZE); + bitBlt (m_mainLayer,0,0,m_runtimeLayer,0,0,ICON_SIZE,ICON_SIZE,AndROP); + bitBlt (m_mainLayer,0,0,m_loadLayer,0,0,ICON_SIZE,ICON_SIZE,AndROP); + bitBlt (m_mainLayer,0,0,m_chargeLayer,0,0,ICON_SIZE,ICON_SIZE,AndROP); + bitBlt (m_mainLayer,0,0,m_statusLayer,0,0,ICON_SIZE,ICON_SIZE,AndROP); break; case pictureKI: -// if (m_statusValue & KNutNet::OL) bitBlt (m_mainLayer,0,0,m_loadLayer,0,0,24,24,AndROP); // icon of UPS +// if (m_statusValue & KNutNet::OL) bitBlt (m_mainLayer,0,0,m_loadLayer,0,0,ICON_SIZE,ICON_SIZE,AndROP); // icon of UPS if (m_statusValue & KNutNet::OL) { // ONLINE - icon of UPS int myLoad; QPainter paint; - copyBlt (m_mainLayer,0,0,&m_upsPix,0,0,24,24); // icon of UPS + copyBlt (m_mainLayer,0,0,&m_upsPix,0,0,ICON_SIZE,ICON_SIZE); // icon of UPS paint.begin(m_mainLayer); if (m_upsLoadValue == knc::numberVarError) myLoad=0; @@ -339,7 +343,7 @@ void KNutDock::repaintDock (const bool always) { } else { QPainter paint; - copyBlt (m_mainLayer,0,0,&m_battPix,0,0,24,24); // icon of Battery + copyBlt (m_mainLayer,0,0,&m_battPix,0,0,ICON_SIZE,ICON_SIZE); // icon of Battery paint.begin(m_mainLayer); if (m_batteryChargeValue != knc::numberVarError) { if (m_batteryChargeValue < 40) paint.setPen(Qt::red); @@ -802,7 +806,7 @@ void KNutDock::paintLoad (int load ) { QPainter paint; int myLoad; -// if (m_typeOfIcon != generalKI) bitBlt (m_loadLayer,0,0,m_upsLayer,0,0,24,24,AndROP); +// if (m_typeOfIcon != generalKI) bitBlt (m_loadLayer,0,0,m_upsLayer,0,0,ICON_SIZE,ICON_SIZE,AndROP); m_loadLayer->fill(Qt::white); paint.begin(m_loadLayer); if (load == knc::numberVarError) myLoad=0; |