mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-05-30 02:49:12 -04:00
feat: Add agents and agents settings
This commit is contained in:
39
settings/TagChip.hpp
Normal file
39
settings/TagChip.hpp
Normal file
@@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2024-2026 Petr Mironychev
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QFrame>
|
||||
#include <QString>
|
||||
|
||||
class QLabel;
|
||||
|
||||
namespace QodeAssist::Settings {
|
||||
|
||||
class TagChip : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit TagChip(const QString &tag, int count, QWidget *parent = nullptr);
|
||||
|
||||
void setActive(bool on);
|
||||
QString tag() const { return m_tag; }
|
||||
|
||||
signals:
|
||||
void clicked(const QString &tag);
|
||||
|
||||
protected:
|
||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
void changeEvent(QEvent *event) override;
|
||||
|
||||
private:
|
||||
void applyTheme();
|
||||
|
||||
QString m_tag;
|
||||
bool m_active = false;
|
||||
bool m_inApplyTheme = false;
|
||||
QLabel *m_label = nullptr;
|
||||
QLabel *m_count = nullptr;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Settings
|
||||
Reference in New Issue
Block a user