mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-24 05:45:27 +00:00
Hide and resize hexdump sidebar with heuristics (#1798)
This commit is contained in:
parent
cae07d15db
commit
3e706ffd5a
@ -307,6 +307,11 @@ void HexdumpWidget::on_hexSideTab_2_currentChanged(int /*index*/)
|
|||||||
|
|
||||||
void HexdumpWidget::resizeEvent(QResizeEvent *event)
|
void HexdumpWidget::resizeEvent(QResizeEvent *event)
|
||||||
{
|
{
|
||||||
|
// Heuristics to hide sidebar when it hides the content of the hexdump. 600px looks just "okay"
|
||||||
|
// Only applied when widget width is decreased to avoid unwanted behavior
|
||||||
|
if (event->oldSize().width() > event->size().width() && event->size().width() < 600) {
|
||||||
|
showSidePanel(false);
|
||||||
|
}
|
||||||
QDockWidget::resizeEvent(event);
|
QDockWidget::resizeEvent(event);
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,12 @@
|
|||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<widget class="HexWidget" name="hexTextView">
|
<widget class="HexWidget" name="hexTextView">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -51,7 +57,7 @@
|
|||||||
<enum>QTabWidget::North</enum>
|
<enum>QTabWidget::North</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="usesScrollButtons">
|
<property name="usesScrollButtons">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
Loading…
Reference in New Issue
Block a user