mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
- Fix vergilius_to_rcx.py to detect function pointer syntax (*Name)(params) and emit FuncPtr64 - Re-fetch 85 structs to recover proper field names (697/716 fixed) - Remove pin button from dock tabs and all pin-related context menu items - Fix newClass() creating duplicate tabs - Set workspace tree font to match tab bar (size 10) - Flatten workspace tree: remove redundant Project group node (VS Code Explorer style) - Add middle-click to close dock widget tabs - Allow type chooser to show cross-doc types for root nodes
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <QWidget>
|
|
#include <QToolButton>
|
|
#include <QHBoxLayout>
|
|
#include <QIcon>
|
|
|
|
// Dock tab button widget (close button)
|
|
// Placed on the right side of each dock tab via QTabBar::setTabButton.
|
|
class DockTabButtons : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
QToolButton* closeBtn;
|
|
|
|
explicit DockTabButtons(QWidget* parent = nullptr) : QWidget(parent) {
|
|
auto* hl = new QHBoxLayout(this);
|
|
hl->setContentsMargins(0, 0, 0, 0);
|
|
hl->setSpacing(0);
|
|
|
|
closeBtn = new QToolButton(this);
|
|
closeBtn->setAutoRaise(true);
|
|
closeBtn->setCursor(Qt::PointingHandCursor);
|
|
closeBtn->setFixedSize(16, 16);
|
|
closeBtn->setToolTip("Close tab");
|
|
closeBtn->setIcon(QIcon(":/vsicons/close.svg"));
|
|
closeBtn->setIconSize(QSize(12, 12));
|
|
hl->addWidget(closeBtn);
|
|
}
|
|
|
|
void applyTheme(const QColor& hover) {
|
|
QString style = QStringLiteral(
|
|
"QToolButton { border: none; padding: 1px; border-radius: 0px; }"
|
|
"QToolButton:hover { background: %1; }").arg(hover.name());
|
|
closeBtn->setStyleSheet(style);
|
|
}
|
|
};
|