forked from qt-creator/qt-creator
Utils: Add AspectList::addToLayout
Added a new, clean IconButton that mimiks the ToolButton with the compact/relaxed background. Change-Id: I582c6aac404724af5459bab2ca9023aa63171f93 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
27
src/libs/utils/iconbutton.h
Normal file
27
src/libs/utils/iconbutton.h
Normal file
@@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <QAbstractButton>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT IconButton : public QAbstractButton
|
||||
{
|
||||
public:
|
||||
IconButton(QWidget *parent = nullptr);
|
||||
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
void enterEvent(QEnterEvent *e) override;
|
||||
void leaveEvent(QEvent *e) override;
|
||||
|
||||
QSize sizeHint() const override;
|
||||
|
||||
private:
|
||||
bool m_containsMouse{false};
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
Reference in New Issue
Block a user