summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/knutdock.cpp34
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;