mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-01 01:13:40 +00:00
Move Theme::fontMgr() impl from app-lib to ui-lib
This commit is contained in:
parent
3f591aa5df
commit
7e780bf3bf
@ -279,8 +279,7 @@ SkinTheme* SkinTheme::get(const ui::Widget* widget)
|
||||
}
|
||||
|
||||
SkinTheme::SkinTheme()
|
||||
: m_fontMgr(text::FontMgr::Make())
|
||||
, m_sheet(nullptr)
|
||||
: m_sheet(nullptr)
|
||||
, m_defaultFont(nullptr)
|
||||
, m_miniFont(nullptr)
|
||||
, m_preferredScreenScaling(-1)
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "app/ui/skin/skin_part.h"
|
||||
#include "gfx/color.h"
|
||||
#include "gfx/fwd.h"
|
||||
#include "text/font_mgr.h"
|
||||
#include "ui/cursor.h"
|
||||
#include "ui/cursor_type.h"
|
||||
#include "ui/manager.h"
|
||||
@ -64,7 +63,6 @@ namespace app {
|
||||
int preferredScreenScaling() const { return m_preferredScreenScaling; }
|
||||
int preferredUIScaling() const { return m_preferredUIScaling; }
|
||||
|
||||
text::FontMgrRef fontMgr() const override { return m_fontMgr; }
|
||||
text::Font* getDefaultFont() const override { return m_defaultFont.get(); }
|
||||
text::Font* getWidgetFont(const ui::Widget* widget) const override;
|
||||
text::Font* getMiniFont() const { return m_miniFont.get(); }
|
||||
@ -186,7 +184,6 @@ namespace app {
|
||||
|
||||
std::string findThemePath(const std::string& themeId) const;
|
||||
|
||||
text::FontMgrRef m_fontMgr;
|
||||
std::string m_path;
|
||||
os::SurfaceRef m_sheet;
|
||||
// Contains the sheet surface as is, without any scale.
|
||||
|
@ -135,6 +135,7 @@ int PaintWidgetPartInfo::getStyleFlagsForWidget(const Widget* widget)
|
||||
}
|
||||
|
||||
Theme::Theme()
|
||||
: m_fontMgr(text::FontMgr::Make())
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "gfx/color.h"
|
||||
#include "gfx/rect.h"
|
||||
#include "gfx/size.h"
|
||||
#include "text/font_mgr.h"
|
||||
#include "text/fwd.h"
|
||||
#include "ui/base.h"
|
||||
#include "ui/cursor_type.h"
|
||||
@ -64,9 +65,9 @@ namespace ui {
|
||||
Theme();
|
||||
virtual ~Theme();
|
||||
|
||||
virtual text::FontMgrRef fontMgr() const = 0;
|
||||
virtual text::Font* getDefaultFont() const = 0;
|
||||
virtual text::Font* getWidgetFont(const Widget* widget) const = 0;
|
||||
virtual text::FontMgrRef fontMgr() const { return m_fontMgr; }
|
||||
|
||||
virtual ui::Cursor* getStandardCursor(CursorType type) = 0;
|
||||
virtual void initWidget(Widget* widget) = 0;
|
||||
@ -149,6 +150,8 @@ namespace ui {
|
||||
protected:
|
||||
virtual void onRegenerateTheme() = 0;
|
||||
|
||||
text::FontMgrRef m_fontMgr;
|
||||
|
||||
private:
|
||||
void regenerateTheme();
|
||||
void paintLayer(Graphics* g,
|
||||
|
Loading…
x
Reference in New Issue
Block a user