Make HexdumpWidget more resizable

This commit is contained in:
Florian Märkl 2018-03-05 15:10:17 +01:00
parent e115cbc9e9
commit 4a8352169b
2 changed files with 595 additions and 603 deletions

View File

@ -37,6 +37,8 @@ HexdumpWidget::HexdumpWidget(QWidget *parent, Qt::WindowFlags flags) :
margin = static_cast<int>(ui->hexASCIIText->document()->documentMargin());
ui->asciiHeaderLabel->setContentsMargins(margin, 0, margin, 0);
ui->splitter->setCollapsible(0, false); // Only Sidebar should collapse
setupFonts();
colorsUpdatedSlot();
@ -1122,5 +1124,5 @@ void HexdumpWidget::updateWidths()
ui->hexOffsetText->setFixedWidth(ui->hexOffsetText->document()->size().width());
ui->hexASCIIText->document()->adjustSize();
ui->hexASCIIText->setFixedWidth(ui->hexASCIIText->document()->size().width());
ui->hexASCIIText->setMinimumWidth(ui->hexASCIIText->document()->size().width());
}

View File

@ -7,11 +7,11 @@
<x>0</x>
<y>0</y>
<width>959</width>
<height>831</height>
<height>807</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -21,9 +21,28 @@
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>553</width>
<height>764</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0,0,0,1">
<property name="leftMargin">
<number>0</number>
</property>
@ -36,8 +55,9 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QGridLayout" name="gridLayout">
<property name="spacing">
<number>0</number>
</property>
<item row="1" column="2">
<widget class="QTextEdit" name="hexHexText">
<property name="sizePolicy">
@ -46,18 +66,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
@ -140,18 +148,17 @@
</item>
<item row="0" column="4">
<widget class="QLabel" name="asciiHeaderLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>0123...</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="offsetHeaderLabel">
<property name="text">
@ -162,23 +169,11 @@
<item row="1" column="4">
<widget class="QTextEdit" name="hexASCIIText">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Anonymous Pro</family>
@ -211,9 +206,16 @@
</property>
</widget>
</item>
</layout>
<item row="1" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
</layout>
</widget>
</widget>
<widget class="QTabWidget" name="hexSideTab_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
@ -225,7 +227,7 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
@ -513,19 +515,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Bytes info</string>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
@ -701,6 +690,7 @@ QToolTip {
</layout>
</widget>
</widget>
</widget>
</item>
</layout>
</widget>