Changed snapshot SvgToolButton to a standard tool button with a rotated label

This commit is contained in:
Nav
2023-03-11 21:10:38 +00:00
parent eae33e9e0f
commit bea1af7e0b
5 changed files with 121 additions and 48 deletions

View File

@@ -2,7 +2,7 @@
<svg
width="15"
height="15"
viewBox="0 0 3.9687501 3.96875"
viewBox="0 0 3.96875 3.96875"
version="1.1"
id="svg974"
sodipodi:docname="manage-snapshots-icon.svg"
@@ -23,11 +23,11 @@
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="39.687885"
inkscape:cx="8.6802307"
inkscape:cy="7.5337852"
inkscape:zoom="52.309858"
inkscape:cx="3.0109048"
inkscape:cy="7.5989502"
inkscape:document-units="px"
inkscape:current-layer="layer2"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="false"
units="px"
@@ -37,10 +37,6 @@
inkscape:window-x="2560"
inkscape:window-y="34"
inkscape:window-maximized="1"
inkscape:snap-smooth-nodes="true"
inkscape:snap-bbox="true"
inkscape:snap-bbox-midpoints="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:pagecheckerboard="0" />
<metadata
id="metadata971">
@@ -54,21 +50,19 @@
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Main"
style="display:inline">
id="layer1">
<path
id="rect6137"
style="fill:#838382;fill-opacity:1;stroke:none;stroke-width:1.327;stroke-miterlimit:4;stroke-dasharray:none"
d="m 1,1 v 13 h 3 v -4 h 7 v 4 h 3 V 1 Z m 2,2 h 9 V 8 H 3 Z"
transform="scale(0.26458334)" />
id="rect1537"
style="fill:#838382;fill-opacity:1;stroke-width:0.202557"
d="M 0.52916668,0.52916668 V 3.4395833 H 1.3229167 v -0.79375 h 1.3229166 v 0.79375 h 0.79375 V 0.52916668 Z M 1.0583333,1.0583333 H 2.9104167 V 2.1166666 H 1.0583333 Z" />
<rect
style="fill:#838382;fill-opacity:1;stroke:none;stroke-width:0.568665;stroke-miterlimit:4;stroke-dasharray:none"
id="rect22557"
width="1.3229166"
height="0.5291667"
x="1.3229166"
style="fill:#838382;fill-opacity:1;stroke-width:0.180817"
id="rect930"
width="0.79374999"
height="0.52916664"
x="1.5875"
y="2.9104166" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -35,9 +35,7 @@
}
#target-memory-inspection-pane #top-bar QToolButton,
#target-memory-inspection-pane #bottom-bar QToolButton,
#target-memory-inspection-pane #lh-side-bar QToolButton,
#target-memory-inspection-pane #rh-side-bar QToolButton {
#target-memory-inspection-pane #bottom-bar QToolButton {
background-color: transparent;
border: none;
padding: 0;
@@ -211,13 +209,22 @@
/* Snapshot Manager */
#target-memory-inspection-pane #rh-side-bar #manage-memory-snapshots-btn {
border-bottom: 1px solid #41423f;
qproperty-buttonWidth: 31;
qproperty-buttonHeight: 28;
border: none;
}
#target-memory-inspection-pane #rh-side-bar #manage-memory-snapshots-btn #icon {
}
#target-memory-inspection-pane #rh-side-bar #manage-memory-snapshots-btn #label {
qproperty-bottomMargin: 4;
color: #999a9d;
}
#target-memory-inspection-pane #rh-side-bar #manage-memory-snapshots-btn:hover {
background-color: #2F2F2D;
border: none;
}
#target-memory-inspection-pane #rh-side-bar #manage-memory-snapshots-btn:checked {

View File

@@ -80,7 +80,7 @@ namespace Bloom::Widgets
this->subContainerLayout = this->container->findChild<QHBoxLayout*>("container-sub-layout");
this->manageMemoryRegionsButton = this->container->findChild<SvgToolButton*>("manage-memory-regions-btn");
this->manageMemorySnapshotsButton = this->container->findChild<SvgToolButton*>("manage-memory-snapshots-btn");
this->manageMemorySnapshotsButton = this->container->findChild<QToolButton*>("manage-memory-snapshots-btn");
this->refreshButton = this->container->findChild<SvgToolButton*>("refresh-memory-btn");
this->refreshOnTargetStopAction = this->refreshButton->findChild<QAction*>("refresh-target-stopped");
@@ -89,6 +89,8 @@ namespace Bloom::Widgets
this->detachPaneButton = this->container->findChild<SvgToolButton*>("detach-pane-btn");
this->attachPaneButton = this->container->findChild<SvgToolButton*>("attach-pane-btn");
this->manageMemorySnapshotsButton->layout()->setContentsMargins(0, 0, 0, 0);
auto* memoryCapacityLabel = this->container->findChild<Label*>("memory-capacity-label");
memoryCapacityLabel->setText(QLocale(QLocale::English).toString(this->targetMemoryDescriptor.size()) + " Bytes");

View File

@@ -5,6 +5,7 @@
#include <vector>
#include <QResizeEvent>
#include <QHBoxLayout>
#include <QToolButton>
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.hpp"
@@ -57,7 +58,7 @@ namespace Bloom::Widgets
QWidget* titleBar = nullptr;
SvgToolButton* manageMemoryRegionsButton = nullptr;
SvgToolButton* manageMemorySnapshotsButton = nullptr;
QToolButton* manageMemorySnapshotsButton = nullptr;
SvgToolButton* refreshButton = nullptr;
QAction* refreshOnTargetStopAction = nullptr;

View File

@@ -183,10 +183,10 @@
<item alignment="Qt::AlignLeft">
<widget class="QWidget" name="lh-side-bar">
<property name="minimumWidth">
<number>32</number>
<number>23</number>
</property>
<property name="maximumWidth">
<number>32</number>
<number>23</number>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding"/>
@@ -221,35 +221,21 @@
<item alignment="Qt::AlignLeft">
<widget class="QWidget" name="rh-side-bar">
<property name="minimumWidth">
<number>32</number>
<number>23</number>
</property>
<property name="maximumWidth">
<number>32</number>
<number>23</number>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding"/>
</property>
<layout class="QVBoxLayout" name="rh-side-bar-layout">
<property name="spacing">
<number>3</number>
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<!-- Button items here -->
<item alignment="Qt::AlignRight">
<widget class="SvgToolButton" name="manage-memory-snapshots-btn">
<property name="checkable">
<bool>true</bool>
</property>
<property name="svgFilePath">
<string>:/compiled/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/Images/manage-snapshots-icon.svg</string>
</property>
<property name="toolTip">
<string>Manage Memory Snapshots</string>
</property>
</widget>
</item>
<item>
<spacer name="vertical-spacer">
<property name="orientation">
@@ -257,6 +243,89 @@
</property>
</spacer>
</item>
<!-- Button items here -->
<item alignment="Qt::AlignRight">
<widget class="QToolButton" name="manage-memory-snapshots-btn">
<property name="minimumWidth">
<number>22</number>
</property>
<property name="maximumWidth">
<number>22</number>
</property>
<property name="minimumHeight">
<number>100</number>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Manage Memory Snapshots</string>
</property>
<layout class="QVBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<spacer name="vertical-spacer">
<property name="sizeHint">
<size>
<height>8</height>
</size>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
</spacer>
</item>
<item alignment="Qt::AlignTop">
<widget class="SvgWidget" name="icon">
<property name="containerHeight">
<number>15</number>
</property>
<property name="containerWidth">
<number>22</number>
</property>
<property name="svgFilePath">
<string>:/compiled/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/Images/manage-snapshots-icon.svg</string>
</property>
</widget>
</item>
<item>
<spacer name="vertical-spacer">
<property name="sizeHint">
<size>
<height>4</height>
</size>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
</spacer>
</item>
<item alignment="Qt::AlignTop">
<widget class="RotatableLabel" name="label">
<property name="angle">
<number>90</number>
</property>
<property name="text">
<string>Snapshots</string>
</property>
</widget>
</item>
<item>
<spacer name="vertical-spacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>