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

View File

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

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<widget class="QWidget" name="hex-viewer-container"> <widget class="QWidget" name="hex-viewer-container">
<layout class="QVBoxLayout"> <layout class="QVBoxLayout" name="hex-viewer-layout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
@@ -194,16 +194,6 @@
</property> </property>
</widget> </widget>
</item> </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> <item>
<widget class="QWidget" name="bottom-bar"> <widget class="QWidget" name="bottom-bar">
<property name="minimumHeight"> <property name="minimumHeight">

View File

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