Interface mockup 6

This commit is contained in:
Dion Moult
2026-05-06 12:36:28 +10:00
parent 802ddf8ff9
commit 0d5fa0c20c
12 changed files with 90 additions and 62 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ namespace ifcinterface::components {
KeyValueTable::KeyValueTable(const QList<KeyValueTableRow>& rows, QWidget* parent)
: QWidget(parent)
{
setObjectName("attributeList");
setObjectName("keyValueTable");
auto* layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
@@ -57,7 +57,7 @@ KeyValueTable::KeyValueTable(const QList<KeyValueTableRow>& rows, QWidget* paren
auto* value = new QLabel(row_data.value, row);
value->setObjectName(row_data.value_object_name.isEmpty()
? "propertyValueLabel"
? "keyValueValueLabel"
: row_data.value_object_name);
value->setWordWrap(true);
value->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+1 -1
View File
@@ -30,7 +30,7 @@ namespace ifcinterface::components {
struct KeyValueTableRow {
QString key;
QString value;
QString value_object_name = "propertyValueLabel";
QString value_object_name = "keyValueValueLabel";
QString trailing_icon_path;
QString trailing_icon_object_name;
int key_minimum_width = 0;
+20 -2
View File
@@ -28,6 +28,7 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QMenu>
#include <QScrollArea>
#include <QToolButton>
#include <QVBoxLayout>
@@ -70,7 +71,7 @@ public:
} // namespace
Panel::Panel(const QString& title, QWidget* content, QWidget* parent, bool has_settings)
Panel::Panel(const QString& title, QWidget* content, QWidget* parent, bool has_settings, bool scrollable)
: QDockWidget(title, parent)
{
auto* outer = new QFrame();
@@ -86,7 +87,24 @@ Panel::Panel(const QString& title, QWidget* content, QWidget* parent, bool has_s
auto* frame_layout = new QVBoxLayout(frame);
frame_layout->setContentsMargins(0, style::metrics::padding, 0, style::metrics::padding);
frame_layout->setSpacing(0);
frame_layout->addWidget(content);
if (scrollable) {
auto* scroll = new QScrollArea(frame);
scroll->setWidgetResizable(true);
scroll->setFrameShape(QFrame::NoFrame);
auto* scroll_body = new QWidget(scroll);
scroll_body->setObjectName("panelScrollBody");
auto* scroll_body_layout = new QVBoxLayout(scroll_body);
scroll_body_layout->setContentsMargins(0, 0, 0, 0);
scroll_body_layout->setSpacing(0);
scroll_body_layout->addWidget(content);
scroll->setWidget(scroll_body);
frame_layout->addWidget(scroll);
} else {
frame_layout->addWidget(content);
}
outer_layout->addWidget(frame);
setObjectName(title);
+5 -1
View File
@@ -31,7 +31,11 @@ class Panel : public QDockWidget {
Q_OBJECT
public:
explicit Panel(const QString& title, QWidget* content, QWidget* parent = nullptr, bool has_settings = false);
explicit Panel(const QString& title,
QWidget* content,
QWidget* parent = nullptr,
bool has_settings = false,
bool scrollable = false);
};
} // namespace ifcinterface::components
+3 -17
View File
@@ -164,7 +164,7 @@ QString buildAppStyleSheet() {
color: #9aa4b3;
background: transparent;
}
QWidget#attributeList {
QWidget#keyValueTable {
background: transparent;
}
QTreeView::item, QListView::item, QTableView::item {
@@ -237,7 +237,7 @@ QString buildAppStyleSheet() {
QLabel#relationshipIconLabel {
background: transparent;
}
QWidget#inspectorPanel {
QWidget#panelScrollBody {
background: #2b2f36;
}
QFrame#panelSectionHeader {
@@ -274,24 +274,10 @@ QString buildAppStyleSheet() {
color: #9aa4b3;
background: transparent;
}
QLabel#propertyValueLabel {
QLabel#keyValueValueLabel {
color: #dce2eb;
background: transparent;
}
QLabel#relationshipValueLabel {
color: #dce2eb;
background: transparent;
}
QLabel#todoPanelTitle {
font-size: 14px;
font-weight: 600;
color: #e1e6ee;
background: transparent;
}
QLabel#todoPanelBody {
color: #8f98a6;
background: transparent;
}
)")
.arg(metrics::panel_radius)
.arg(metrics::control_padding_y)