void AccordionFrame::animatedShow() { if (isVisible()) { show(); return; } if (!display_is_remote()) { QWidget *parent = parentWidget(); if (parent && parent->layout()) { // Force our parent layout to update its geometry. There are a number // of ways of doing this. Calling invalidate + activate seems to // be the best. show(); parent->layout()->invalidate(); // Calls parent->layout()->update() parent->layout()->activate(); // Calculates sizes then calls parent->updateGeometry() frame_height_ = height(); hide(); } if (frame_height_ > 0) { animation_->setStartValue(0); animation_->setEndValue(frame_height_); animation_->start(); } } show(); }
SplashOverlay::SplashOverlay(QWidget *parent) : QWidget(parent), so_ui_(new Ui::SplashOverlay), blurred_(false), last_action_(RA_NONE), register_cur_(0) { so_ui_->setupUi(this); // Number of register action transitions (e.g. RA_NONE -> RA_DISSECTORS, // RA_DISSECTORS -> RA_PLUGIN_REGISTER) minus two. int register_add = 5; #ifdef HAVE_LUA register_add += wslua_count_plugins(); /* get count of lua plugins */ #endif so_ui_->progressBar->setMaximum((int)register_count() + register_add); elapsed_timer_.start(); QColor bg = QColor(tango_aluminium_6); bg.setAlphaF(0.4); QPalette pal; pal.setColor(QPalette::Background, bg); setPalette(pal); setAutoFillBackground(true); setStyleSheet(QString( "QLabel {" " color: white;" " background: rgba(0,0,0,0);" "}" "QProgressBar {" " height: 1em;" " width: 20em;" " border: 0.1em solid white;" " border-radius: 0.2em;" " color: white;" " background: rgba(0,0,0,0);" "}" "QProgressBar::chunk {" " width: 0.1em;" " background: rgba(255, 255, 255, 50%);" "}" )); #ifndef THROTTLE_STARTUP // Check for a remote connection if (display_is_remote()) info_update_freq_ = 1000; #endif connect(wsApp, SIGNAL(splashUpdate(register_action_e,const char*)), this, SLOT(splashUpdate(register_action_e,const char*))); }
void AccordionFrame::animatedHide() { if (!isVisible()) { hide(); return; } if (!display_is_remote()) { animation_->setStartValue(frame_height_); animation_->setEndValue(0); animation_->start(); } else { hide(); } }