mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 19:07:57 +00:00
Simplify Models panel and dialog layout
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>
This commit is contained in:
@@ -232,9 +232,11 @@ QWidget* MainWindow::buildHomeRibbonPage() {
|
||||
dialog.exec();
|
||||
});
|
||||
|
||||
row->addWidget(components::buttons::makeButtonGroup("PROJECT", {new_project, open_project, open_cloud, open_recent, save_project}, this));
|
||||
row->addWidget(components::buttons::makeButtonGroup("MODELS", {add_model, sync_from_cloud}, this));
|
||||
row->addWidget(components::buttons::makeButtonGroup("SETTINGS", {settings_button}, this));
|
||||
components::buttons::addButtonGroups(row, {
|
||||
components::buttons::makeButtonGroup("PROJECT", {new_project, open_project, open_cloud, open_recent, save_project}, this),
|
||||
components::buttons::makeButtonGroup("MODELS", {add_model, sync_from_cloud}, this),
|
||||
components::buttons::makeButtonGroup("SETTINGS", {settings_button}, this),
|
||||
});
|
||||
row->addStretch(1);
|
||||
return page;
|
||||
}
|
||||
@@ -296,9 +298,11 @@ QWidget* MainWindow::buildNavigateRibbonPage() {
|
||||
modules::viewport::commands::toggleSection(*session_state_, *viewport_widget_->viewport());
|
||||
});
|
||||
|
||||
row->addWidget(components::buttons::makeButtonGroup("CAMERA", {set_home, go_home, view_all, view_selected}, this));
|
||||
row->addWidget(components::buttons::makeButtonGroup("ORIENTATION", {plan_view, front_view, side_view, align_object, projection_button}, this));
|
||||
row->addWidget(components::buttons::makeButtonGroup("MODE", {fly_mode, section_mode}, this));
|
||||
components::buttons::addButtonGroups(row, {
|
||||
components::buttons::makeButtonGroup("CAMERA", {set_home, go_home, view_all, view_selected}, this),
|
||||
components::buttons::makeButtonGroup("ORIENTATION", {plan_view, front_view, side_view, align_object, projection_button}, this),
|
||||
components::buttons::makeButtonGroup("MODE", {fly_mode, section_mode}, this),
|
||||
});
|
||||
row->addStretch(1);
|
||||
return page;
|
||||
}
|
||||
@@ -340,8 +344,10 @@ QWidget* MainWindow::buildInspectRibbonPage() {
|
||||
modules::viewport::commands::toggleVolume(*viewport_widget_->viewport());
|
||||
});
|
||||
|
||||
row->addWidget(components::buttons::makeButtonGroup("SELECTION", {hide_selected, isolate_selected, show_all, invert_selection}, this));
|
||||
row->addWidget(components::buttons::makeButtonGroup("MEASURE", {distance, area, volume}, this));
|
||||
components::buttons::addButtonGroups(row, {
|
||||
components::buttons::makeButtonGroup("SELECTION", {hide_selected, isolate_selected, show_all, invert_selection}, this),
|
||||
components::buttons::makeButtonGroup("MEASURE", {distance, area, volume}, this),
|
||||
});
|
||||
row->addStretch(1);
|
||||
return page;
|
||||
}
|
||||
@@ -353,22 +359,24 @@ QWidget* MainWindow::buildPanelsRibbonPage() {
|
||||
row->setContentsMargins(2, 4, 2, 4);
|
||||
row->setSpacing(0);
|
||||
|
||||
row->addWidget(components::buttons::makeButtonGroup("DATA", {
|
||||
makePanelToggle("Models", models_panel_),
|
||||
makePanelToggle("Spatial", spatial_panel_),
|
||||
makePanelToggle("Layers", layers_panel_),
|
||||
makePanelToggle("Properties", properties_panel_)
|
||||
}, this));
|
||||
row->addWidget(components::buttons::makeButtonGroup("QUERY", {
|
||||
makePanelToggle("Views", stored_views_panel_),
|
||||
makePanelToggle("Search", search_panel_),
|
||||
makePanelToggle("Sheets", spreadsheet_panel_),
|
||||
makePanelToggle("Audit", audit_panel_)
|
||||
}, this));
|
||||
row->addWidget(components::buttons::makeButtonGroup("COLLABORATE", {
|
||||
makePanelToggle("Clash", clash_panel_),
|
||||
makePanelToggle("Issues", issues_panel_)
|
||||
}, this));
|
||||
components::buttons::addButtonGroups(row, {
|
||||
components::buttons::makeButtonGroup("DATA", {
|
||||
makePanelToggle("Models", models_panel_),
|
||||
makePanelToggle("Spatial", spatial_panel_),
|
||||
makePanelToggle("Layers", layers_panel_),
|
||||
makePanelToggle("Properties", properties_panel_)
|
||||
}, this),
|
||||
components::buttons::makeButtonGroup("QUERY", {
|
||||
makePanelToggle("Views", stored_views_panel_),
|
||||
makePanelToggle("Search", search_panel_),
|
||||
makePanelToggle("Sheets", spreadsheet_panel_),
|
||||
makePanelToggle("Audit", audit_panel_)
|
||||
}, this),
|
||||
components::buttons::makeButtonGroup("COLLABORATE", {
|
||||
makePanelToggle("Clash", clash_panel_),
|
||||
makePanelToggle("Issues", issues_panel_)
|
||||
}, this),
|
||||
});
|
||||
row->addStretch(1);
|
||||
return page;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user