summaryrefslogtreecommitdiff
path: root/client/collapser.h
diff options
context:
space:
mode:
Diffstat (limited to 'client/collapser.h')
-rw-r--r--client/collapser.h52
1 files changed, 20 insertions, 32 deletions
diff --git a/client/collapser.h b/client/collapser.h
index 27d0810..8eea84a 100644
--- a/client/collapser.h
+++ b/client/collapser.h
@@ -37,33 +37,20 @@
class Collapser : public QWidget {
Q_OBJECT
public:
- Collapser(QWidget *collapsed = NULL, QWidget *expanded = NULL,
- bool setcollapsed = true, QScrollArea *scrollarea = NULL);
+ Collapser(QWidget *current = NULL, QScrollArea *scrollarea = NULL);
- bool isCollapsed();
- void setCollapsed(bool setcollapsed);
-
- void setWidgets(QWidget *collapsed, QWidget *expanded);
+ void updateHeight();
- QWidget *collapsedWidget();
- QWidget *expandedWidget();
+ void animateToWidget(QWidget *widget, bool scroll_to_view = false);
- void setCollapsedWidget(QWidget *collapsed);
- void setExpandedWidget(QWidget *expanded);
-
- void updateHeight();
+ QWidget *currentWidget();
public slots:
- void collapse();
- void expand();
- void toggleCollapse();
void anim();
signals:
- void collapsing();
- void expanding();
- void doneCollapsing();
- void doneExpanding();
+ void animating(QWidget *);
+ void doneAnimating(QWidget *);
protected:
// void timerEvent(QTimerEvent *);
@@ -71,34 +58,35 @@ protected:
private:
class Placeholder : public QWidget {
public:
- QPixmap pixmap_from;
- QPixmap pixmap_to;
-
- void grab_from(QWidget *w);
- void grab_to(QWidget *w);
+ void grabFrom(QWidget *w);
+ void grabTo(QWidget *w);
void setWeight(double weight);
+ int toHeight();
+ int fromHeight();
+
protected:
void paintEvent(QPaintEvent*);
private:
+ QPixmap pixmap_from;
+ QPixmap pixmap_to;
+
+ int to_height;
+ int from_height;
double weight;
};
Placeholder placeholder;
+ QWidget *current_widget;
- QWidget *collapsed;
- QWidget *expanded;
-
- QScrollArea *scrollarea;
-
- bool is_collapsed;
-
+ bool scroll_to_view;
+ QTimer *timer;
QTime t_anim;
int timer_id;
- QTimer *timer;
+ QScrollArea *scrollarea;
};
#endif/*__PRACRO_COLLAPSER_H__*/