void StatusBarItemGroup::addItem(StatusBarItem* item) { if(!item) return; item->setParentItem(this); m_items.append(item); connect(item,SIGNAL(signalBoundingRectChanged()), this, SLOT(slotChildBoundingRectChanged())); layout(); }
StatusBar::StatusBar(StatusBarType type, int width, int height) : m_type(type) , m_showRssiIndicators(false) , m_rssiIndex(RSSI_0) , m_rssi1xIndex(RSSI_1X_0) , m_rssiShown(false) , m_rssi1xShown(false) , m_appMaximized(false) , m_showAppTitle(false) , m_svcConnector(0) , m_bkgPixmap(0) , m_battery(0) , m_clock(0) , m_title(0) , m_infoItems(0) , m_notif(0) , m_systemUiGroup(0) , m_titleGroup(0) , m_notifGroup(0) , m_forceOpaque(false) , m_platformHasPhoneRadio(false) { m_carrierText = kDefaultCarrierName; m_appTitle = " "; m_bounds = QRect(-width/2, -height/2, width, height); // Charging icon m_battery = new StatusBarBattery(); unsigned int clockPadding = 0; if(m_type == TypeDockMode) clockPadding = 5; // Text for clock m_clock = new StatusBarClock(clockPadding); m_infoItems = new StatusBarInfo(m_type); // Title Bar (a value of true on the third arg turns on non-tablet UI) m_title = new StatusBarTitle(Settings::LunaSettings()->statusBarTitleMaxWidth, height, false); if(Settings::LunaSettings()->tabletUi) { m_systemUiGroup = new StatusBarItemGroup(height, (m_type == TypeNormal || m_type == TypeDockMode), (m_type == TypeNormal || m_type == TypeDockMode), StatusBarItemGroup::AlignRight); connect(m_systemUiGroup, SIGNAL(signalBoundingRectChanged()), this, SLOT(slotChildBoundingRectChanged())); connect(m_systemUiGroup, SIGNAL(signalActivated(StatusBarItemGroup*)), this, SLOT(slotMenuGroupActivated(StatusBarItemGroup*))); m_systemUiGroup->setParentItem(this); if(m_clock) { if (m_type == TypeLockScreen) m_clock->setParentItem(this); else m_systemUiGroup->addItem(m_clock); } m_systemUiGroup->addItem(m_battery); m_systemUiGroup->addItem(m_infoItems); m_titleGroup = new StatusBarItemGroup(height, (m_type == TypeNormal || m_type == TypeDockMode), (m_type == TypeNormal || m_type == TypeDockMode), StatusBarItemGroup::AlignLeft); connect(m_titleGroup, SIGNAL(signalBoundingRectChanged()), this, SLOT(slotChildBoundingRectChanged())); connect(m_titleGroup, SIGNAL(signalActivated(StatusBarItemGroup*)), this, SLOT(slotMenuGroupActivated(StatusBarItemGroup*))); m_titleGroup->setParentItem(this); m_titleGroup->addItem(m_title); if(m_type == TypeNormal || m_type == TypeDockMode || m_type == TypeFirstUse) { m_titleGroup->setActionable(false); connect(m_titleGroup, SIGNAL(signalActionTriggered(bool)), this, SLOT(slotAppMenuMenuAction(bool))); }