mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-16 10:34:31 +00:00
96941463c0
Models panel: replace the manual resizeEvent column-sizing hack with QHeaderView Stretch/Fixed modes, re-applied via sectionCountChanged so they survive the model rebuilds that QHeaderView resets them on. Dialog: only wrap the body in a QScrollArea when scrollable, mirroring Panel. The scroll area caps its sizeHint at 36x24 cells, which turned wide fixed-size dialog content into spurious scrollbars. Add Model dialog: reserve a stable, font-metrics-measured height for the hover description so longer text never reflows the buttons; regroup the buttons into LOCAL / CLOUD / TOOLS. Buttons: move the trailing-separator decision out of makeButtonGroup into a new addButtonGroups row builder, so the last group in a row never draws a dangling divider. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
49 lines
2.4 KiB
C++
49 lines
2.4 KiB
C++
// This file was generated with the assistance of an AI coding tool.
|
|
/********************************************************************************
|
|
* *
|
|
* This file is part of IfcOpenShell. *
|
|
* *
|
|
* IfcOpenShell is free software: you can redistribute it and/or modify *
|
|
* it under the terms of the Lesser GNU General Public License as published by *
|
|
* the Free Software Foundation, either version 3.0 of the License, or *
|
|
* (at your option) any later version. *
|
|
* *
|
|
* IfcOpenShell is distributed in the hope that it will be useful, *
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
* Lesser GNU General Public License for more details. *
|
|
* *
|
|
* You should have received a copy of the Lesser GNU General Public License *
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
* *
|
|
********************************************************************************/
|
|
|
|
#ifndef IFCINTERFACE_COMPONENTS_BUTTONS_H
|
|
#define IFCINTERFACE_COMPONENTS_BUTTONS_H
|
|
|
|
#include <QList>
|
|
|
|
class QBoxLayout;
|
|
class QToolButton;
|
|
class QWidget;
|
|
|
|
namespace bonsaiviewer::components::buttons {
|
|
|
|
QToolButton* makeButton(const QString& text,
|
|
const QString& icon_path,
|
|
QWidget* parent);
|
|
|
|
QWidget* makeButtonGroup(const QString& title,
|
|
const QList<QToolButton*>& buttons,
|
|
QWidget* parent,
|
|
int vertical_spacing = 4);
|
|
|
|
// Adds button groups to a ribbon row, drawing a vertical divider between
|
|
// adjacent groups but never after the last one. Centralising the decision
|
|
// here means a row can't end up with a dangling trailing separator.
|
|
void addButtonGroups(QBoxLayout* row, const QList<QWidget*>& groups);
|
|
|
|
} // namespace bonsaiviewer::components::buttons
|
|
|
|
#endif
|