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.
28 #include "accordion_frame.h"
32 const int duration_
= 150;
34 AccordionFrame::AccordionFrame(QWidget
*parent
) :
37 QString
subframe_style(
39 " background: palette(window);"
40 " padding-top: 0.1em;"
41 " padding-bottom: 0.1em;"
42 " border-bottom: 1px solid palette(shadow);"
44 "QLineEdit#goToLineEdit {"
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_
);
66 void AccordionFrame::animatedHide()
68 if (strlen (get_conn_cfilter()) < 1) {
69 animation_
->setStartValue(frame_height_
);
70 animation_
->setEndValue(0);
77 void AccordionFrame::animationFinished()
79 if (animation_
->currentValue().toInt() < 1) {
81 setMaximumHeight(frame_height_
);
91 * indent-tabs-mode: nil
94 * ex: set shiftwidth=4 tabstop=8 expandtab:
95 * :indentSize=4:tabSize=8:noTabs=true: