Added "No differences" placeholder to ChangeListPane widget

This commit is contained in:
Nav
2023-08-26 16:51:57 +01:00
parent cbc17dc17e
commit 370112c4c7
4 changed files with 25 additions and 0 deletions

View File

@@ -44,6 +44,8 @@ namespace Widgets
this->container->setFixedSize(this->size());
this->container->setContentsMargins(0, 0, 0, 0);
this->placeHolderLabel = this->container->findChild<Label*>("placeholder-label");
auto* containerLayout = this->container->findChild<QVBoxLayout*>();
this->changeListView = new ListView({}, this);
@@ -116,6 +118,9 @@ namespace Widgets
this->changeListScene->refreshGeometry();
this->changeListView->setVisible(!diffRanges.empty());
this->placeHolderLabel->setVisible(diffRanges.empty());
// Trigger a resize event
this->resize(this->size());
}

View File

@@ -7,6 +7,7 @@
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/ListView/ListView.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotDiff/DifferentialHexViewerWidget/DifferentialHexViewerWidget.hpp"
#include "src/Targets/TargetMemory.hpp"
@@ -42,6 +43,7 @@ namespace Widgets
DifferentialHexViewerWidget* hexViewerWidgetB;
QWidget* container = nullptr;
Label* placeHolderLabel = nullptr;
ListView* changeListView = nullptr;
ListScene* changeListScene = nullptr;

View File

@@ -58,6 +58,19 @@
</layout>
</widget>
</item>
<item>
<widget class="Label" name="placeholder-label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"/>
</property>
<property name="alignment">
<enum>Qt::AlignCenter</enum>
</property>
<property name="text">
<string>No differences</string>
</property>
</widget>
</item>
</layout>
</widget>
</ui>

View File

@@ -97,6 +97,11 @@
border-left: 1px solid #41423f;
}
#change-list-pane #placeholder-label {
color: #737375;
font-size: 14px;
}
#snapshot-diff #data-details-container {
border-bottom: 1px solid #41423f;
color: #8a8a8d;