mirror of
https://github.com/Linloir/SceneEditor.git
synced 2025-12-18 16:08:11 +08:00
[UI][FIX] Sidebar effect update
- Change animation curve - Change collapsed width
This commit is contained in:
parent
67bf979db5
commit
c873268885
@ -86,8 +86,8 @@ SideBar::~SideBar() {}
|
|||||||
void SideBar::expand() {
|
void SideBar::expand() {
|
||||||
// Add animation to expand the side bar
|
// Add animation to expand the side bar
|
||||||
QPropertyAnimation* expandAnimation = new QPropertyAnimation(this, "maximumWidth");
|
QPropertyAnimation* expandAnimation = new QPropertyAnimation(this, "maximumWidth");
|
||||||
expandAnimation->setDuration(200);
|
expandAnimation->setDuration(650);
|
||||||
expandAnimation->setEasingCurve(QEasingCurve::InOutQuad);
|
expandAnimation->setEasingCurve(QEasingCurve::OutExpo);
|
||||||
expandAnimation->setStartValue(width());
|
expandAnimation->setStartValue(width());
|
||||||
expandAnimation->setEndValue(_expandedWidth);
|
expandAnimation->setEndValue(_expandedWidth);
|
||||||
expandAnimation->start(QAbstractAnimation::DeleteWhenStopped);
|
expandAnimation->start(QAbstractAnimation::DeleteWhenStopped);
|
||||||
@ -103,8 +103,8 @@ void SideBar::expand() {
|
|||||||
void SideBar::collapse() {
|
void SideBar::collapse() {
|
||||||
// Add animation to collapse the side bar
|
// Add animation to collapse the side bar
|
||||||
QPropertyAnimation* collapseAnimation = new QPropertyAnimation(this, "maximumWidth");
|
QPropertyAnimation* collapseAnimation = new QPropertyAnimation(this, "maximumWidth");
|
||||||
collapseAnimation->setDuration(200);
|
collapseAnimation->setDuration(650);
|
||||||
collapseAnimation->setEasingCurve(QEasingCurve::InOutQuad);
|
collapseAnimation->setEasingCurve(QEasingCurve::OutExpo);
|
||||||
collapseAnimation->setStartValue(width());
|
collapseAnimation->setStartValue(width());
|
||||||
collapseAnimation->setEndValue(_collapsedWidth);
|
collapseAnimation->setEndValue(_collapsedWidth);
|
||||||
collapseAnimation->start(QAbstractAnimation::DeleteWhenStopped);
|
collapseAnimation->start(QAbstractAnimation::DeleteWhenStopped);
|
||||||
|
|||||||
@ -24,7 +24,7 @@ private:
|
|||||||
|
|
||||||
// UI control variables
|
// UI control variables
|
||||||
QColor _backgroundColor = QColor(230, 230, 230);
|
QColor _backgroundColor = QColor(230, 230, 230);
|
||||||
int _collapsedWidth = 90;
|
int _collapsedWidth = 86;
|
||||||
int _expandedWidth = 200;
|
int _expandedWidth = 200;
|
||||||
|
|
||||||
// UI widgets
|
// UI widgets
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user