mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-19 02:48:49 +00:00
Dynamic size for color selection and compile warning fixes (#380)
This commit is contained in:
parent
cd38fb9277
commit
391e847ebc
@ -44,6 +44,15 @@ void GeneralOptionsWidget::updateThemeFromConfig()
|
|||||||
QString curTheme = Config()->getCurrentTheme();
|
QString curTheme = Config()->getCurrentTheme();
|
||||||
int index = themes.indexOf(curTheme) + 1;
|
int index = themes.indexOf(curTheme) + 1;
|
||||||
ui->colorComboBox->setCurrentIndex(index);
|
ui->colorComboBox->setCurrentIndex(index);
|
||||||
|
int maxThemeLen = 0;
|
||||||
|
for (QString str : themes){
|
||||||
|
int strLen = str.length();
|
||||||
|
if (strLen > maxThemeLen) {
|
||||||
|
maxThemeLen = strLen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ui->colorComboBox->setMinimumContentsLength(maxThemeLen);
|
||||||
|
ui->colorComboBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
|
||||||
connect(ui->colorComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_colorComboBox_currentIndexChanged(int)));
|
connect(ui->colorComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_colorComboBox_currentIndexChanged(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ protected:
|
|||||||
|
|
||||||
void adjustSize(int new_width, int new_height);
|
void adjustSize(int new_width, int new_height);
|
||||||
|
|
||||||
bool event(QEvent *event);
|
bool event(QEvent *event) override;
|
||||||
private:
|
private:
|
||||||
bool checkPointClicked(QPointF &point, int x, int y, bool above_y=false);
|
bool checkPointClicked(QPointF &point, int x, int y, bool above_y=false);
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ std::array<QString, 3> HexdumpWidget::fetchHexdump(RVA addr, int lines)
|
|||||||
cur_addr += cols;
|
cur_addr += cols;
|
||||||
}
|
}
|
||||||
|
|
||||||
return { offsetText, hexText, asciiText};
|
return {{offsetText, hexText, asciiText}};
|
||||||
}
|
}
|
||||||
|
|
||||||
void HexdumpWidget::selectionChanged()
|
void HexdumpWidget::selectionChanged()
|
||||||
|
Loading…
Reference in New Issue
Block a user