void DiffAnalystWindow::onWindowsMenuAboutToShow() { m_pWindowsMenu->clear (); int cascadeId = m_pWindowsMenu->insertItem ("&Cascade", this, SLOT (onCascade ())); int tileId = m_pWindowsMenu->insertItem ("&Tile", this, SLOT (onTile ())); int close_all_id = m_pWindowsMenu->insertItem ("Close Al&l", this, SLOT (onCloseAllWindows ())); if (m_pWs->windowList ().isEmpty ()) { m_pWindowsMenu->setItemEnabled (cascadeId, FALSE); m_pWindowsMenu->setItemEnabled (tileId, FALSE); m_pWindowsMenu->setItemEnabled (close_all_id, FALSE); } m_pWindowsMenu->insertSeparator (); QWidgetList windows = m_pWs->windowList (); for (int i = 0; i < int (windows.count ()); ++i) { int id = m_pWindowsMenu->insertItem (windows.at (i)->caption (), this, SLOT (onWindowsMenuActivated (int))); m_pWindowsMenu->setItemParameter (id, i); m_pWindowsMenu->setItemChecked (id, m_pWs->activeWindow () == windows.at (i)); } }
void BackgroundWidget::createControls() { style::margins margin(0, 0, 0, st::settingsSmallSkip); style::margins slidedPadding(0, margin.bottom() / 2, 0, margin.bottom() - (margin.bottom() / 2)); addChildRow(_background, margin); connect(_background, SIGNAL(chooseFromGallery()), this, SLOT(onChooseFromGallery())); connect(_background, SIGNAL(chooseFromFile()), this, SLOT(onChooseFromFile())); addChildRow(_tile, margin, lang(lng_settings_bg_tile), SLOT(onTile()), Window::chatBackground()->tile()); addChildRow(_adaptive, margin, slidedPadding, lang(lng_settings_adaptive_wide), SLOT(onAdaptive()), Global::AdaptiveForWide()); if (Global::AdaptiveLayout() != Adaptive::WideLayout) { _adaptive->hideFast(); } }
static void readLayer(Reader &reader, const Table &data, const Table *flags, int ox, int oy, int w, int h, int z) { for (int y = 0; y < h; ++y) for (int x = 0; x < w; ++x) { int16_t tileID = tableGetWrapped(data, x+ox, y+oy, z); if (tileID <= 0) continue; onTile(reader, tileID, x, y, flags); } }