Gui: remove taskheader animation

This commit is contained in:
Alfredo Monclus
2025-06-07 19:40:50 -06:00
committed by Kacper Donat
parent 0386189c51
commit d48dcd8bb0
4 changed files with 0 additions and 83 deletions

View File

@@ -63,7 +63,6 @@ ActionPanelScheme::ActionPanelScheme()
{
QFontMetrics fm(QApplication::font());
headerSize = fm.height() + 10;
headerAnimation = true;
QPalette p = QApplication::palette();

View File

@@ -58,11 +58,6 @@ public:
*/
int headerSize;
/**
* @brief Whether mouseover on the header triggers a slow opacity change.
*/
bool headerAnimation;
/**
* @brief Image of the folding button when the group is expanded.
*/

View File

@@ -25,7 +25,6 @@ TaskHeader::TaskHeader(const QIcon &icon, const QString &title, bool expandable,
m_over(false),
m_buttonOver(false),
m_fold(true),
m_opacity(0.1),
myButton(nullptr)
{
setProperty("class", "header");
@@ -120,71 +119,6 @@ void TaskHeader::setScheme(ActionPanelScheme *scheme)
}
}
void TaskHeader::paintEvent ( QPaintEvent * event )
{
QPainter p(this);
if (myScheme->headerAnimation) {
p.setOpacity(m_opacity+0.7);
}
BaseClass::paintEvent(event);
}
void TaskHeader::animate()
{
if (!myScheme->headerAnimation) {
return;
}
if (!isEnabled()) {
m_opacity = 0.1;
update();
return;
}
if (m_over) {
if (m_opacity >= 0.3) {
m_opacity = 0.3;
return;
}
m_opacity += 0.05;
} else {
if (m_opacity <= 0.1) {
m_opacity = 0.1;
return;
}
m_opacity = qMax(0.1, m_opacity-0.05);
}
QTimer::singleShot(100, this, &TaskHeader::animate);
update();
}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
void TaskHeader::enterEvent ( QEvent * /*event*/ )
#else
void TaskHeader::enterEvent ( QEnterEvent * /*event*/ )
#endif
{
m_over = true;
if (isEnabled()) {
QTimer::singleShot(100, this, &TaskHeader::animate);
}
update();
}
void TaskHeader::leaveEvent ( QEvent * /*event*/ )
{
m_over = false;
if (isEnabled()) {
QTimer::singleShot(100, this, &TaskHeader::animate);
}
update();
}
void TaskHeader::fold()
{
if (myExpandable) {

View File

@@ -43,17 +43,7 @@ public:
public Q_SLOTS:
void fold();
protected Q_SLOTS:
void animate();
protected:
void paintEvent ( QPaintEvent * event ) override;
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
void enterEvent ( QEvent * event ) override;
#else
void enterEvent ( QEnterEvent * event ) override;
#endif
void leaveEvent ( QEvent * event ) override;
void mouseReleaseEvent ( QMouseEvent * event ) override;
void keyPressEvent ( QKeyEvent * event ) override;
void keyReleaseEvent ( QKeyEvent * event ) override;
@@ -66,7 +56,6 @@ protected:
bool myExpandable;
bool m_over, m_buttonOver, m_fold;
double m_opacity;
ActionLabel *myTitle;
QLabel *myButton;