MSWSP: add parse_CNatLanguageRestriction()
[wireshark-wip.git] / ui / qt / accordion_frame.cpp
blob7704fa815c06866b13b58aebe0d09401fd23a04c
1 /* accordion_frame.cpp
3 * $Id$
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #include "config.h"
26 #include <glib.h>
28 #include "accordion_frame.h"
30 #include "ui/util.h"
32 const int duration_ = 150;
34 AccordionFrame::AccordionFrame(QWidget *parent) :
35 QFrame(parent)
37 QString subframe_style(
38 ".QFrame {"
39 " background: palette(window);"
40 " padding-top: 0.1em;"
41 " padding-bottom: 0.1em;"
42 " border-bottom: 1px solid palette(shadow);"
43 "}"
44 "QLineEdit#goToLineEdit {"
45 " max-width: 5em;"
46 "}"
48 setStyleSheet(subframe_style);
49 frame_height_ = height();
50 animation_ = new QPropertyAnimation(this, "maximumHeight");
51 animation_->setDuration(duration_);
52 animation_->setEasingCurve(QEasingCurve::InOutQuad);
53 connect(animation_, SIGNAL(finished()), this, SLOT(animationFinished()));
56 void AccordionFrame::animatedShow()
58 if (strlen (get_conn_cfilter()) < 1) {
59 animation_->setStartValue(0);
60 animation_->setEndValue(frame_height_);
61 animation_->start();
63 show();
66 void AccordionFrame::animatedHide()
68 if (strlen (get_conn_cfilter()) < 1) {
69 animation_->setStartValue(frame_height_);
70 animation_->setEndValue(0);
71 animation_->start();
72 } else {
73 hide();
77 void AccordionFrame::animationFinished()
79 if (animation_->currentValue().toInt() < 1) {
80 hide();
81 setMaximumHeight(frame_height_);
86 * Editor modelines
88 * Local Variables:
89 * c-basic-offset: 4
90 * tab-width: 8
91 * indent-tabs-mode: nil
92 * End:
94 * ex: set shiftwidth=4 tabstop=8 expandtab:
95 * :indentSize=4:tabSize=8:noTabs=true: