Guest User

Untitled

a guest
Nov 16th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 5.41 KB | None | 0 0
  1. --- launcher/StatusBar/source/statusbar.cpp
  2. +++ launcher/StatusBar/source/statusbar.cpp
  3. @@ -106,7 +106,7 @@ Net::SignalStrength StatusBar::m_mbbSignalStrength = Net::SIGNAL_ABSENT;
  4.  
  5.  //======================= STATUS BAR GUI SECTION ========================//
  6.  
  7. -int StatusBarUiHandler::STATUSBAR_HEIGHT = 20;
  8. +int StatusBarUiHandler::STATUSBAR_HEIGHT;
  9.  
  10.  /// GUI Status Bar Default Constructor
  11.  StatusBarUiHandler::StatusBarUiHandler(QWidget* parent)
  12. @@ -119,6 +119,8 @@ StatusBarUiHandler::StatusBarUiHandler(QWidget* parent)
  13.       m_colorChangeDisabled(false),
  14.       m_sliderTimerInterval(3000)
  15.  {
  16. +    STATUSBAR_HEIGHT = parent->height(); //S920: W = 241; H = 20
  17. +
  18.      m_notificationsSlots = new QLabel[MAX_NOTIFICATIONS_SHOWN];
  19.      m_userSlotsTags      = new QString[MAX_NOTIFICATIONS_SHOWN];
  20.      m_layout             = new QHBoxLayout(this);
  21. @@ -129,42 +131,42 @@ StatusBarUiHandler::StatusBarUiHandler(QWidget* parent)
  22.  
  23.      for(int i = 0; i < MAX_NOTIFICATIONS_SHOWN; i++)
  24.      {
  25. -        m_notificationsSlots[i].setFixedSize(20, STATUSBAR_HEIGHT);
  26. +        m_notificationsSlots[i].setFixedSize(STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
  27.          m_layout->addWidget(&m_notificationsSlots[i]);
  28.      }
  29.  
  30.      // GPRS Icon
  31.      m_gprsSlot = new QLabel(this);
  32.      m_gprsSlot->setIndent(Qt::AlignRight);
  33. -    m_gprsSlot->setFixedSize(20, STATUSBAR_HEIGHT);
  34. +    m_gprsSlot->setFixedSize(STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
  35.      m_gprsSlot->setContentsMargins(0,0,0,0);
  36.      m_layout->addWidget(m_gprsSlot);
  37.  
  38.      // WiFi Icon
  39.      m_wifiSlot = new QLabel(this);
  40.      m_wifiSlot->setIndent(Qt::AlignRight);
  41. -    m_wifiSlot->setFixedSize(22, STATUSBAR_HEIGHT);
  42. +    m_wifiSlot->setFixedSize(1.1*STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
  43.      m_wifiSlot->setContentsMargins(0,0,0,0);
  44.      m_layout->addWidget(m_wifiSlot);
  45.  
  46.      // Supply Percentage
  47.      m_supplyPercentSlot = new QLabel(this);
  48.      m_supplyPercentSlot->setIndent(Qt::AlignHCenter);
  49. -    m_supplyPercentSlot->setFixedSize(34, STATUSBAR_HEIGHT);
  50. +    m_supplyPercentSlot->setFixedSize(1.7*STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
  51.      m_supplyPercentSlot->setContentsMargins(0,0,0,0);
  52.      m_layout->addWidget(m_supplyPercentSlot);
  53.  
  54.      // Power Supply Icon
  55.      m_supplySlot = new QLabel(this);
  56.      m_supplySlot->setIndent(Qt::AlignRight);
  57. -    m_supplySlot->setFixedSize(8, STATUSBAR_HEIGHT);
  58. +    m_supplySlot->setFixedSize(0.4*STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
  59.      m_supplySlot->setContentsMargins(0,0,0,0);
  60.      m_layout->addWidget(m_supplySlot);
  61.  
  62.      // Time Icon
  63.      m_timeSlot = new QLabel(this);
  64.      m_timeSlot->setIndent(Qt::AlignLeft);
  65. -    m_timeSlot->setFixedSize(35, STATUSBAR_HEIGHT);
  66. +    m_timeSlot->setFixedSize(1.75*STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
  67.      m_timeSlot->setContentsMargins(0,0,0,0);
  68.      m_layout->addWidget(m_timeSlot);
  69.  
  70. @@ -231,7 +233,7 @@ void StatusBarUiHandler::initSlider(bool refresh)
  71.      {
  72.          m_sliderSlot = new QLabel(this);
  73.          m_sliderSlot->setIndent(Qt::AlignLeft);
  74. -        m_sliderSlot->setFixedSize(105, STATUSBAR_HEIGHT);
  75. +        m_sliderSlot->setFixedSize(5.25*STATUSBAR_HEIGHT, STATUSBAR_HEIGHT);
  76.          m_sliderSlot->setContentsMargins(0,0,0,0);
  77.          m_layout->addWidget(m_sliderSlot);
  78.  
  79. @@ -246,18 +248,17 @@ void StatusBarUiHandler::initSlider(bool refresh)
  80.  
  81.      // System version
  82.      std::ostringstream str;
  83. -    str << "<font color=\"white\">" << System::App::getVersion().toString() << "</font>";
  84. -
  85. -    m_sliderItens.push_back(QString::fromStdString(str.str()));
  86. +    str << System::App::getVersion().toString();
  87.  
  88.      // Merchant Name if have more than one and if it is valid.
  89.      if ((Transac::getAllMerchants().size() > 1) && (Transac::getCurrentMerchant().isValid()))
  90.      {
  91.          str.str(std::string());
  92. -        str << "<font color=\"white\">" << cropMerchantName(Transac::getCurrentMerchant().getFullName()) << "</font>";
  93. -        m_sliderItens.push_back(QString::fromStdString(str.str()));
  94. +        str << cropMerchantName(Transac::getCurrentMerchant().getFullName());
  95.      }
  96.  
  97. +    m_sliderItens.push_back("<font color=\"white\">"+QString::fromStdString(str.str())+"</font>");
  98. +
  99.      m_sliderTimer->start();
  100.  }
  101.  
  102. @@ -417,7 +418,6 @@ void StatusBarUiHandler::hideIcon(const std::string& idTag)
  103.  void StatusBarUiHandler::updateTime(System::Time::Date *actualTime)
  104.  {
  105.      std::ostringstream os;
  106. -    os << "<font color=\"white\">";
  107.  
  108.      if(actualTime->hour <= 9)
  109.         os << "0";
  110. @@ -427,10 +427,10 @@ void StatusBarUiHandler::updateTime(System::Time::Date *actualTime)
  111.      if(actualTime->minute <= 9)
  112.         os << "0";
  113.  
  114. -    os << static_cast<unsigned> (actualTime->minute) << "</font>";
  115. +    os << static_cast<unsigned> (actualTime->minute);
  116.  
  117.      QString time(os.str().c_str());
  118. -    m_timeSlot->setText(time);
  119. +    m_timeSlot->setText("<font color=\"white\">"+time+"</font>");
  120.      m_timeSlot->update();
  121.  }
  122.  
  123. @@ -611,17 +611,14 @@ void StatusBarUiHandler::refreshSupplyPercentage()
  124.          }
  125.  
  126.          std::ostringstream str;
  127. -        str << "<font color=\"white\">";
  128.  
  129.          if (m_supplyPercentage > 0)
  130.          {
  131.              str << m_supplyPercentage << "%";
  132.          }
  133.  
  134. -        str << "</font>";
  135. -
  136.          QString version(str.str().c_str());
  137. -        m_supplyPercentSlot->setText(version);
  138. +        m_supplyPercentSlot->setText("<font color=\"white\">"+version+"</font>");
  139.  
  140.          m_mutex.unlock();
  141.      }
Advertisement
Add Comment
Please, Sign In to add comment