Removed pointless container in HexViewerWidget and tidied QSS styles

This commit is contained in:
Nav
2022-12-29 18:50:01 +00:00
parent b2e20b8c1d
commit f41e60d0af
4 changed files with 18 additions and 29 deletions

View File

@@ -46,6 +46,8 @@ namespace Bloom::Widgets
this->container->setFixedSize(this->size());
this->container->setContentsMargins(0, 0, 0, 0);
auto* containerLayout = this->container->findChild<QVBoxLayout*>("hex-viewer-layout");
this->toolBar = this->container->findChild<QWidget*>("tool-bar");
this->bottomBar = this->container->findChild<QWidget*>("bottom-bar");
@@ -72,7 +74,6 @@ namespace Bloom::Widgets
this->hoveredAddressLabel = this->bottomBar->findChild<Label*>("byte-address-label");
this->loadingHexViewerLabel = this->container->findChild<Label*>("loading-hex-viewer-label");
this->byteItemGraphicsViewContainer = this->container->findChild<QWidget*>("graphics-view-container");
this->byteItemGraphicsView = new ByteItemContainerGraphicsView(
this->targetMemoryDescriptor,
@@ -80,9 +81,11 @@ namespace Bloom::Widgets
this->excludedMemoryRegions,
this->settings,
this->hoveredAddressLabel,
this->byteItemGraphicsViewContainer
this->container
);
containerLayout->insertWidget(2, this->byteItemGraphicsView);
this->setHoveredRowAndColumnHighlightingEnabled(this->settings.highlightHoveredRowAndCol);
this->setFocusedMemoryHighlightingEnabled(this->settings.highlightFocusedMemory);
this->setAnnotationsEnabled(this->settings.displayAnnotations);
@@ -174,8 +177,7 @@ namespace Bloom::Widgets
[this] {
this->byteItemGraphicsScene = this->byteItemGraphicsView->getScene();
this->loadingHexViewerLabel->hide();
this->byteItemGraphicsViewContainer->show();
this->byteItemGraphicsView->setFixedSize(this->byteItemGraphicsViewContainer->size());
this->byteItemGraphicsView->show();
emit this->ready();
}
@@ -207,12 +209,10 @@ namespace Bloom::Widgets
this->width(),
this->height()
);
this->byteItemGraphicsView->setFixedSize(this->byteItemGraphicsViewContainer->size());
}
void HexViewerWidget::showEvent(QShowEvent* event) {
this->byteItemGraphicsView->setFixedSize(this->byteItemGraphicsViewContainer->size());
QWidget::showEvent(event);
}
void HexViewerWidget::onTargetStateChanged(Targets::TargetState newState) {

View File

@@ -58,7 +58,6 @@ namespace Bloom::Widgets
QWidget* bottomBar = nullptr;
Label* loadingHexViewerLabel = nullptr;
QWidget* byteItemGraphicsViewContainer = nullptr;
ByteItemContainerGraphicsView* byteItemGraphicsView = nullptr;
ByteItemGraphicsScene* byteItemGraphicsScene = nullptr;
Label* hoveredAddressLabel = nullptr;

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<widget class="QWidget" name="hex-viewer-container">
<layout class="QVBoxLayout">
<layout class="QVBoxLayout" name="hex-viewer-layout">
<property name="spacing">
<number>0</number>
</property>
@@ -194,16 +194,6 @@
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="graphics-view-container">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"/>
</property>
<property name="visible">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="bottom-bar">
<property name="minimumHeight">

View File

@@ -80,8 +80,14 @@
margin-top: 2px;
}
#hex-viewer-container {
background-color: transparent;
border: none;
}
#hex-viewer-container #tool-bar,
#hex-viewer-container #search-bar {
background-color: transparent;
border-bottom: 1px solid #41423f;
}
@@ -160,30 +166,24 @@
}
#hex-viewer-container QScrollArea,
#hex-viewer-container #graphics-view-container,
#hex-viewer-container #graphics-view-container #graphics-view {
#hex-viewer-container #graphics-view {
background-color: #323330;
border: none;
font-size: 11px;
}
#hex-viewer-container #graphics-view-container {
background-color: #50504b;
border: none;
}
#hex-viewer-container #graphics-view-container #address-container {
#hex-viewer-container #address-container {
background-color: #353633;
border-right: 1px solid #41423f;
}
#hex-viewer-container #graphics-view-container #address-container QLabel {
#hex-viewer-container #address-container QLabel {
background-color: transparent;
font-size: 5px;
color: rgba(175, 177, 179, 0.72);
}
#hex-viewer-container #graphics-view-container #address-container QLabel:disabled {
#hex-viewer-container #address-container QLabel:disabled {
color: rgba(175, 177, 179, 0.3);
}