Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- launcher/StatusBar/source/statusbar.cpp
- +++ launcher/StatusBar/source/statusbar.cpp
- @@ -106,7 +106,7 @@ Net::SignalStrength StatusBar::m_mbbSignalStrength = Net::SIGNAL_ABSENT;
- //======================= STATUS BAR GUI SECTION ========================//
- -int StatusBarUiHandler::STATUSBAR_HEIGHT = 20;
- +int StatusBarUiHandler::STATUSBAR_HEIGHT;
- /// GUI Status Bar Default Constructor
- StatusBarUiHandler::StatusBarUiHandler(QWidget* parent)
- @@ -119,6 +119,8 @@ StatusBarUiHandler::StatusBarUiHandler(QWidget* parent)
- m_colorChangeDisabled(false),
- m_sliderTimerInterval(3000)
- {
- + STATUSBAR_HEIGHT = parent->height(); //S920: W = 241; H = 20
- +
- m_notificationsSlots = new QLabel[MAX_NOTIFICATIONS_SHOWN];
- m_userSlotsTags = new QString[MAX_NOTIFICATIONS_SHOWN];
- m_layout = new QHBoxLayout(this);
- @@ -129,42 +131,42 @@ StatusBarUiHandler::StatusBarUiHandler(QWidget* parent)
- for(int i = 0; i < MAX_NOTIFICATIONS_SHOWN; i++)
- {
- - m_notificationsSlots[i].setFixedSize(20, STATUSBAR_HEIGHT);
- + m_notificationsSlots[i].setFixedSize(STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
- m_layout->addWidget(&m_notificationsSlots[i]);
- }
- // GPRS Icon
- m_gprsSlot = new QLabel(this);
- m_gprsSlot->setIndent(Qt::AlignRight);
- - m_gprsSlot->setFixedSize(20, STATUSBAR_HEIGHT);
- + m_gprsSlot->setFixedSize(STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
- m_gprsSlot->setContentsMargins(0,0,0,0);
- m_layout->addWidget(m_gprsSlot);
- // WiFi Icon
- m_wifiSlot = new QLabel(this);
- m_wifiSlot->setIndent(Qt::AlignRight);
- - m_wifiSlot->setFixedSize(22, STATUSBAR_HEIGHT);
- + m_wifiSlot->setFixedSize(1.1*STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
- m_wifiSlot->setContentsMargins(0,0,0,0);
- m_layout->addWidget(m_wifiSlot);
- // Supply Percentage
- m_supplyPercentSlot = new QLabel(this);
- m_supplyPercentSlot->setIndent(Qt::AlignHCenter);
- - m_supplyPercentSlot->setFixedSize(34, STATUSBAR_HEIGHT);
- + m_supplyPercentSlot->setFixedSize(1.7*STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
- m_supplyPercentSlot->setContentsMargins(0,0,0,0);
- m_layout->addWidget(m_supplyPercentSlot);
- // Power Supply Icon
- m_supplySlot = new QLabel(this);
- m_supplySlot->setIndent(Qt::AlignRight);
- - m_supplySlot->setFixedSize(8, STATUSBAR_HEIGHT);
- + m_supplySlot->setFixedSize(0.4*STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
- m_supplySlot->setContentsMargins(0,0,0,0);
- m_layout->addWidget(m_supplySlot);
- // Time Icon
- m_timeSlot = new QLabel(this);
- m_timeSlot->setIndent(Qt::AlignLeft);
- - m_timeSlot->setFixedSize(35, STATUSBAR_HEIGHT);
- + m_timeSlot->setFixedSize(1.75*STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
- m_timeSlot->setContentsMargins(0,0,0,0);
- m_layout->addWidget(m_timeSlot);
- @@ -231,7 +233,7 @@ void StatusBarUiHandler::initSlider(bool refresh)
- {
- m_sliderSlot = new QLabel(this);
- m_sliderSlot->setIndent(Qt::AlignLeft);
- - m_sliderSlot->setFixedSize(105, STATUSBAR_HEIGHT);
- + m_sliderSlot->setFixedSize(5.25*STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
- m_sliderSlot->setContentsMargins(0,0,0,0);
- m_layout->addWidget(m_sliderSlot);
- @@ -246,18 +248,17 @@ void StatusBarUiHandler::initSlider(bool refresh)
- // System version
- std::ostringstream str;
- - str << "<font color=\"white\">" << System::App::getVersion().toString() << "</font>";
- -
- - m_sliderItens.push_back(QString::fromStdString(str.str()));
- + str << System::App::getVersion().toString();
- // Merchant Name if have more than one and if it is valid.
- if ((Transac::getAllMerchants().size() > 1) && (Transac::getCurrentMerchant().isValid()))
- {
- str.str(std::string());
- - str << "<font color=\"white\">" << cropMerchantName(Transac::getCurrentMerchant().getFullName()) << "</font>";
- - m_sliderItens.push_back(QString::fromStdString(str.str()));
- + str << cropMerchantName(Transac::getCurrentMerchant().getFullName());
- }
- + m_sliderItens.push_back("<font color=\"white\">"+QString::fromStdString(str.str())+"</font>");
- +
- m_sliderTimer->start();
- }
- @@ -417,7 +418,6 @@ void StatusBarUiHandler::hideIcon(const std::string& idTag)
- void StatusBarUiHandler::updateTime(System::Time::Date *actualTime)
- {
- std::ostringstream os;
- - os << "<font color=\"white\">";
- if(actualTime->hour <= 9)
- os << "0";
- @@ -427,10 +427,10 @@ void StatusBarUiHandler::updateTime(System::Time::Date *actualTime)
- if(actualTime->minute <= 9)
- os << "0";
- - os << static_cast<unsigned> (actualTime->minute) << "</font>";
- + os << static_cast<unsigned> (actualTime->minute);
- QString time(os.str().c_str());
- - m_timeSlot->setText(time);
- + m_timeSlot->setText("<font color=\"white\">"+time+"</font>");
- m_timeSlot->update();
- }
- @@ -611,17 +611,14 @@ void StatusBarUiHandler::refreshSupplyPercentage()
- }
- std::ostringstream str;
- - str << "<font color=\"white\">";
- if (m_supplyPercentage > 0)
- {
- str << m_supplyPercentage << "%";
- }
- - str << "</font>";
- -
- QString version(str.str().c_str());
- - m_supplyPercentSlot->setText(version);
- + m_supplyPercentSlot->setText("<font color=\"white\">"+version+"</font>");
- m_mutex.unlock();
- }
Advertisement
Add Comment
Please, Sign In to add comment