CountrySelect::CountrySelect() : QWidget(App::wnd()), _result("none"), _filter(this, st::inpCountry, lang(lng_country_ph)), _scroll(this, st::scrollCountries), _list(&_scroll), _doneButton(this, lang(lng_country_done), st::btnSelectDone), _cancelButton(this, lang(lng_cancel), st::btnSelectCancel), _innerLeft(0), _innerTop(0), _innerWidth(0), _innerHeight(0), a_alpha(0), a_bgAlpha(0), a_coord(st::countriesSlideShift), _shadow(st::boxShadow) { setGeometry(App::wnd()->rect()); App::wnd()->topWidget(this); connect(App::wnd(), SIGNAL(resized(const QSize &)), this, SLOT(onParentResize(const QSize &))); connect(&_doneButton, SIGNAL(clicked()), this, SLOT(onCountryChoose())); connect(&_cancelButton, SIGNAL(clicked()), this, SLOT(onCountryCancel())); connect(&_scroll, SIGNAL(scrollFinished()), this, SLOT(onScrollFinished())); connect(&_scroll, SIGNAL(geometryChanged()), &_list, SLOT(onParentGeometryChanged())); connect(&_scroll, SIGNAL(scrolled()), &_list, SLOT(onUpdateSelected())); connect(&_list, SIGNAL(countrySelected()), this, SLOT(onCountryChoose())); connect(&_filter, SIGNAL(changed()), this, SLOT(onFilterUpdate())); connect(&_list, SIGNAL(mustScrollTo(int, int)), &_scroll, SLOT(scrollToY(int, int))); show(); setFocus(); _scroll.setWidget(&_list); _scroll.setFocusPolicy(Qt::NoFocus); prepareAnimation(0); }
void UISlidingToolBar::prepare() { /* Do not count that window as important for application, * it will NOT be taken into account when other top-level windows will be closed: */ setAttribute(Qt::WA_QuitOnClose, false); /* Delete window when closed: */ setAttribute(Qt::WA_DeleteOnClose); #if defined(Q_WS_MAC) || defined(Q_WS_WIN) /* Make sure we have no background * until the first one paint-event: */ setAttribute(Qt::WA_NoSystemBackground); /* Use Qt API to enable translucency: */ setAttribute(Qt::WA_TranslucentBackground); #elif defined(Q_WS_X11) if (QX11Info::isCompositingManagerRunning()) { /* Use Qt API to enable translucency: */ setAttribute(Qt::WA_TranslucentBackground); } #endif /* Q_WS_X11 */ /* Prepare contents: */ prepareContents(); /* Prepare geometry: */ prepareGeometry(); /* Prepare animation: */ prepareAnimation(); }
void UIPopupPaneTextPane::prepare() { /* Prepare content: */ prepareContent(); /* Prepare animation: */ prepareAnimation(); /* Update size-hint: */ updateSizeHint(); }
void UIPopupPane::prepare() { /* Prepare this: */ installEventFilter(this); /* Prepare background: */ prepareBackground(); /* Prepare content: */ prepareContent(); /* Prepare animation: */ prepareAnimation(); /* Update size-hint: */ sltUpdateSizeHint(); }
void CountrySelect::finish(const QString &res) { _result = res; prepareAnimation(_result.length() ? -1 : 1); emit countryChosen(_result); }