Project

General

Profile

Bug #4642

WAnimation doesn't work in WPopupMenu

Added by Jaak Kivinukk over 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
12/29/2015
Due date:
% Done:

0%

Estimated time:

Description

I'm trying to open popup menu using animation "SlideInFromTop", but it doesn't work at all. If I put both methods, popup() and animateShow(), then only popup menu happens to fade away when going on it with mouse. What I'm doing wrong and what I should do instead?

Webpage::Webpage(const Wt::WEnvironment &env) : Wt::WApplication(env) {

appName = "JKProjects";

setTitle(appName);

Wt::WApplication::internalPathChanged().connect(this, &Webpage::onInternalPathChange);

Wt::WApplication::instance()->useStyleSheet("CSS/Style.css");

text1 = new Wt::WText(appName);

text1->setStyleClass("logo");

text1->decorationStyle().setForegroundColor(Wt::WColor::WColor(255, 255, 255));

numbersMenu = new Wt::WPopupMenu();

numbersMenu->addItem("Add/Subtract/Multiply/Divide Fractions");

numbersMenu->addItem("Alarm Clock");

numbersMenu->addItem("Binary to Decimal and Back Converter");

numbersMenu->addItem("Calculator");

numbersMenu->setStyleClass("Wt-popupmenu");

numbersMenu->setAutoHide(true, 0);

numbersMenuButton = new Wt::WPushButton("Numbers");

numbersMenuButton->setMenu(numbersMenu);

numbersMenuButton->setStyleClass("dropdownButton");

numbersMenuButton->clicked().setNotExposed();

numbersMenuButton->mouseWentOver().connect(std::bind([=]() {

numbersMenu->popup(numbersMenuButton);

//numbersMenu->animateShow(Wt::WAnimation(Wt::WAnimation::SlideInFromTop, Wt::WAnimation::Linear, 1000));

}));

numbersMenu->aboutToHide().connect(std::bind([=]() {

//numbersMenuButton->decorationStyle().setBackgroundColor(Wt::black);

}));

layout = new Wt::WHBoxLayout();

mainContainer = new Wt::WContainerWidget(Wt::WApplication::root());

mainContainer->setLayout(layout);

layout->addWidget(text1);

layout->addWidget(numbersMenuButton);

layout->addStretch(10000);

//onInternalPathChange();

}

No data to display

Also available in: Atom PDF