mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
Add/remove lines on Hexdump resize
This commit is contained in:
parent
1f6a29b458
commit
cfc5f78c92
@ -151,13 +151,16 @@ void HexdumpWidget::connectScroll(bool disconnect)
|
|||||||
{
|
{
|
||||||
if (disconnect)
|
if (disconnect)
|
||||||
{
|
{
|
||||||
this->disconnect(ui->hexASCIIText->verticalScrollBar(), &QScrollBar::valueChanged, this, &HexdumpWidget::hexScrolled);
|
this->disconnect(ui->hexASCIIText->verticalScrollBar(), &QScrollBar::valueChanged, this,
|
||||||
this->disconnect(ui->hexASCIIText, &QPlainTextEdit::cursorPositionChanged, this, &HexdumpWidget::hexScrolled);
|
&HexdumpWidget::adjustHexdumpLines);
|
||||||
|
this->disconnect(ui->hexASCIIText, &QPlainTextEdit::cursorPositionChanged, this,
|
||||||
|
&HexdumpWidget::adjustHexdumpLines);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
connect(ui->hexASCIIText->verticalScrollBar(), &QScrollBar::valueChanged, this, &HexdumpWidget::hexScrolled);
|
connect(ui->hexASCIIText->verticalScrollBar(), &QScrollBar::valueChanged, this,
|
||||||
connect(ui->hexASCIIText, &QPlainTextEdit::cursorPositionChanged, this, &HexdumpWidget::hexScrolled);
|
&HexdumpWidget::adjustHexdumpLines);
|
||||||
|
connect(ui->hexASCIIText, &QPlainTextEdit::cursorPositionChanged, this, &HexdumpWidget::adjustHexdumpLines);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -481,7 +484,7 @@ void HexdumpWidget::resizeHexdump()
|
|||||||
//this->hexASCIIText->setMinimumWidth(this->hexASCIIText->document()->size().width());
|
//this->hexASCIIText->setMinimumWidth(this->hexASCIIText->document()->size().width());
|
||||||
}
|
}
|
||||||
|
|
||||||
void HexdumpWidget::hexScrolled()
|
void HexdumpWidget::adjustHexdumpLines()
|
||||||
{
|
{
|
||||||
QScrollBar *sb = ui->hexASCIIText->verticalScrollBar();
|
QScrollBar *sb = ui->hexASCIIText->verticalScrollBar();
|
||||||
int topMargin = sb->value() - sb->minimum();
|
int topMargin = sb->value() - sb->minimum();
|
||||||
@ -839,37 +842,9 @@ void HexdumpWidget::on_memSideToolButton_clicked()
|
|||||||
|
|
||||||
void HexdumpWidget::resizeEvent(QResizeEvent *event)
|
void HexdumpWidget::resizeEvent(QResizeEvent *event)
|
||||||
{
|
{
|
||||||
// FIXME
|
|
||||||
/*
|
|
||||||
if (main->responsive && isVisible())
|
|
||||||
{
|
|
||||||
if (event->size().width() <= 1150)
|
|
||||||
{
|
|
||||||
ui->frame_3->setVisible(false);
|
|
||||||
ui->memPreviewTab->setVisible(false);
|
|
||||||
ui->previewToolButton_2->setChecked(false);
|
|
||||||
if (event->size().width() <= 950)
|
|
||||||
{
|
|
||||||
ui->memSideTabWidget_2->hide();
|
|
||||||
ui->hexSideTab_2->hide();
|
|
||||||
ui->memSideToolButton->setChecked(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ui->memSideTabWidget_2->show();
|
|
||||||
ui->hexSideTab_2->show();
|
|
||||||
ui->memSideToolButton->setChecked(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ui->frame_3->setVisible(true);
|
|
||||||
ui->memPreviewTab->setVisible(true);
|
|
||||||
ui->previewToolButton_2->setChecked(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
QDockWidget::resizeEvent(event);
|
QDockWidget::resizeEvent(event);
|
||||||
|
|
||||||
|
adjustHexdumpLines();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HexdumpWidget::wheelEvent(QWheelEvent* event)
|
void HexdumpWidget::wheelEvent(QWheelEvent* event)
|
||||||
|
@ -103,7 +103,7 @@ private slots:
|
|||||||
void on_action64columns_triggered();
|
void on_action64columns_triggered();
|
||||||
|
|
||||||
void resizeHexdump();
|
void resizeHexdump();
|
||||||
void hexScrolled();
|
void adjustHexdumpLines();
|
||||||
|
|
||||||
void on_codeCombo_2_currentTextChanged(const QString &arg1);
|
void on_codeCombo_2_currentTextChanged(const QString &arg1);
|
||||||
void on_hexSideTab_2_currentChanged(int index);
|
void on_hexSideTab_2_currentChanged(int index);
|
||||||
|
Loading…
Reference in New Issue
Block a user