mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Define auxiliary functions for metrics
Collect font, font metrics and icon size functions in a separate module. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f18bcd6607
commit
5a2db2db4b
5 changed files with 57 additions and 9 deletions
21
qt-ui/metrics.h
Normal file
21
qt-ui/metrics.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* metrics.h
|
||||
*
|
||||
* header file for common function to find/compute essential UI metrics
|
||||
* (font properties, icon sizes, etc)
|
||||
*
|
||||
*/
|
||||
#ifndef METRICS_H
|
||||
#define METRICS_H
|
||||
|
||||
#include <QFont>
|
||||
#include <QFontMetrics>
|
||||
|
||||
QFont defaultModelFont();
|
||||
QFontMetrics defaultModelFontMetrics();
|
||||
|
||||
// return the default icon size, computed as the multiple of 16 closest to
|
||||
// the given height (that defaults to the default font height)
|
||||
int defaultIconSize(int height = defaultModelFontMetrics().height());
|
||||
|
||||
#endif // METRICS_H
|
Loading…
Add table
Add a link
Reference in a new issue