mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
31 lines
568 B
C++
31 lines
568 B
C++
|
/*
|
||
|
* Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org>
|
||
|
*
|
||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||
|
*/
|
||
|
|
||
|
#include <Ladybird/Qt/TabBar.h>
|
||
|
#include <QEvent>
|
||
|
#include <QPushButton>
|
||
|
|
||
|
namespace Ladybird {
|
||
|
|
||
|
TabBarButton::TabBarButton(QIcon const& icon, QWidget* parent)
|
||
|
: QPushButton(icon, {}, parent)
|
||
|
{
|
||
|
resize({ 20, 20 });
|
||
|
setFlat(true);
|
||
|
}
|
||
|
|
||
|
bool TabBarButton::event(QEvent* event)
|
||
|
{
|
||
|
if (event->type() == QEvent::Enter)
|
||
|
setFlat(false);
|
||
|
if (event->type() == QEvent::Leave)
|
||
|
setFlat(true);
|
||
|
|
||
|
return QPushButton::event(event);
|
||
|
}
|
||
|
|
||
|
}
|