Exemple #1
0
void WNavigationBar::expandContents()
{
  WContainerWidget *contents = resolve<WContainerWidget *>("contents");
  WInteractWidget *collapseButton
    = resolve<WInteractWidget *>("collapse-button");
  WInteractWidget *expandButton
    = resolve<WInteractWidget *>("expand-button");

  collapseButton->show();
  expandButton->hide();

  if (!animatedResponsive())
    contents->show();
  else {
    if (canOptimizeUpdates())
      contents->show();
    else
      contents->animateShow(WAnimation(WAnimation::SlideInFromTop,
				       WAnimation::Ease));
  }
}
Exemple #2
0
void WDialog::setHidden(bool hidden, const WAnimation& animation)
{
  if (isHidden() != hidden) {
    if (modal_) {
      WApplication *app = WApplication::instance();
      WContainerWidget *cover = app->dialogCover();

      if (!cover)
	return; // when application is being destroyed

      if (!hidden) {
	saveCoverState(app, cover);

	if (cover->isHidden()) {
	  if (!animation.empty()) {
	    cover->animateShow(WAnimation(WAnimation::Fade, WAnimation::Linear,
					  animation.duration() * 4));
	  } else
	    cover->show();
	}

	cover->setZIndex(impl_->zIndex() - 1);
	app->pushExposedConstraint(this);

	// FIXME: this should only blur if the active element is outside
	// of the dialog
	doJavaScript
	  ("try {"
	   """if (document.activeElement && document.activeElement.blur)"
	   ""  "document.activeElement.blur();"
	   "} catch (e) { }");
      } else
	restoreCoverState(app, cover);
    }
  }

  WCompositeWidget::setHidden(hidden, animation);
}
Exemple #3
0
 virtual void setHidden(bool hidden, const WAnimation& animation = WAnimation()) {
   WWebWidget::setHidden(hidden, animation);
   rule_->modified();
 }