0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-28 01:04:41 +08:00

(GUI) Minor cosmetic changes to the FPS Monitor

This commit is contained in:
Victor Zarubkin 2017-04-17 22:15:40 +03:00
parent c202bd8cac
commit c93464968e

View File

@ -268,11 +268,12 @@ EasyFrameRateViewer::EasyFrameRateViewer(QWidget* _parent) : Parent(_parent), m_
centerOn(0, 0); centerOn(0, 0);
// Dirty hack for QDockWidget stupid initial size policy :( // Dirty hack for QDockWidget stupid initial size policy :(
setMinimumHeight(5); // Set very small height to enable appropriate minimum height on the application startup setFixedHeight(10); // Set very small height to enable appropriate minimum height on the application startup
QTimer::singleShot(100, [this]() QTimer::singleShot(100, [this]()
{ {
// Now set appropriate minimum height // Now set appropriate minimum height
setMinimumHeight((QFontMetrics(scene()->font()).height() + 3) * 6); setMinimumHeight((QFontMetrics(scene()->font()).height() + 3) * 6);
setMaximumHeight(minimumHeight() * 20);
}); });
} }
@ -323,10 +324,10 @@ void EasyFrameRateViewer::contextMenuEvent(QContextMenuEvent* _event)
QMenu menu; QMenu menu;
QAction* action = nullptr; QAction* action = nullptr;
action = menu.addAction("Clear"); action = menu.addAction(QIcon(":/Delete"), "Clear");
connect(action, &QAction::triggered, [this](bool){ clear(); }); connect(action, &QAction::triggered, [this](bool){ clear(); });
action = menu.addAction("Hide"); action = menu.addAction("Close");
connect(action, &QAction::triggered, [this](bool){ parentWidget()->hide(); }); connect(action, &QAction::triggered, [this](bool){ parentWidget()->hide(); });
menu.exec(QCursor::pos()); menu.exec(QCursor::pos());