MeshLib C++ Docs
Loading...
Searching...
No Matches
MRRibbonFontHolder.h
Go to the documentation of this file.
1#pragma once
2#include "exports.h"
3#include "MRRibbonFontManager.h" // TODO move it in MRRibbonFontManager.cpp
4
5namespace MR
6{
7
8// class for convenient use of ImGui::PushFont / ImGui::PopFont with ribbon fonts
9class MRVIEWER_CLASS RibbonFontHolder
10{
11public:
12 // ctors
13 // getting font and size by ribbon font type and push it in ImGui
14 MRVIEWER_API RibbonFontHolder( const RibbonFontManager::FontType& fontType );
15 MRVIEWER_API RibbonFontHolder( const RibbonFontManager::FontType& fontType, float scale );
16 MRVIEWER_API RibbonFontHolder( const RibbonFontManager::FontType& fontType, float scale, bool pushOnCreate );
17 MRVIEWER_API ~RibbonFontHolder();
18
19 // check the font for existence and push it
20 MRVIEWER_API void pushFont();
21
22 // check the font for existence and pop it
23 MRVIEWER_API void popFont();
24
25 // font is pushed
26 bool isPushed() { return pushed_; }
27private:
28 bool pushed_ = false;
29 ImFont* font_ = nullptr;
30 float size_ = 13.f;
31};
32}
Definition MRRibbonFontHolder.h:10
MRVIEWER_API ~RibbonFontHolder()
MRVIEWER_API RibbonFontHolder(const RibbonFontManager::FontType &fontType, float scale, bool pushOnCreate)
MRVIEWER_API void popFont()
MRVIEWER_API void pushFont()
bool isPushed()
Definition MRRibbonFontHolder.h:26
MRVIEWER_API RibbonFontHolder(const RibbonFontManager::FontType &fontType)
MRVIEWER_API RibbonFontHolder(const RibbonFontManager::FontType &fontType, float scale)
FontType
Definition MRRibbonFontManager.h:17
Definition MRCameraOrientationPlugin.h:8