1
0
Fork 0

GUI: resolved issue #537 (Hide/Show FPU button font now syncs with the RegistersView font)

This commit is contained in:
mrexodia 2016-02-15 05:04:47 +01:00
parent e2ce073c8a
commit be26a685c0
2 changed files with 6 additions and 8 deletions

View File

@ -42,15 +42,9 @@ CPUWidget::CPUWidget(QWidget* parent) : QWidget(parent), ui(new Ui::CPUWidget)
scrollArea->verticalScrollBar()->setStyleSheet("QScrollBar:vertical{border:1px solid grey;background:#f1f1f1;width:10px}QScrollBar::handle:vertical{background:#aaa;min-height:20px;margin:1px}QScrollBar::add-line:vertical,QScrollBar::sub-line:vertical{width:0;height:0}");
QPushButton* button_changeview = new QPushButton("");
mGeneralRegs->SetChangeButton(button_changeview);
button_changeview->setStyleSheet("Text-align:left;padding: 4px;padding-left: 10px;");
QFont font = QFont("Lucida Console");
font.setStyleHint(QFont::Monospace);
font.setPointSize(8);
button_changeview->setFont(font);
connect(button_changeview, SIGNAL(clicked()), mGeneralRegs, SLOT(onChangeFPUViewAction()));
mGeneralRegs->SetChangeButton(button_changeview);
ui->mTopRightFrameLayout->addWidget(button_changeview);
ui->mTopRightFrameLayout->addWidget(scrollArea);

View File

@ -10,6 +10,7 @@
void RegistersView::SetChangeButton(QPushButton* push_button)
{
mChangeViewButton = push_button;
fontsUpdatedSlot();
}
void RegistersView::InitMappings()
@ -1149,7 +1150,10 @@ RegistersView::~RegistersView()
void RegistersView::fontsUpdatedSlot()
{
setFont(ConfigFont("Registers"));
auto font = ConfigFont("Registers");
setFont(font);
if(mChangeViewButton)
mChangeViewButton->setFont(font);
int wRowsHeight = QFontMetrics(this->font()).height();
wRowsHeight = (wRowsHeight * 105) / 100;
wRowsHeight = (wRowsHeight % 2) == 0 ? wRowsHeight : wRowsHeight + 1;