Browse Source

Changes after review.

Jay Sistar 9 years ago
parent
commit
746215e472
2 changed files with 12 additions and 3 deletions
  1. 10 2
      Source/Atomic/UI/UIWidget.cpp
  2. 2 1
      Source/Atomic/UI/UIWidget.h

+ 10 - 2
Source/Atomic/UI/UIWidget.cpp

@@ -437,16 +437,24 @@ void UIWidget::SetFontId(const String& fontId)
     widget_->SetFontDescription(fd);
 }
 
-void UIWidget::SetFontId(tb::uint32 fontId)
+void UIWidget::SetFontIdHash(unsigned fontIdHash)
 {
     if (!widget_)
         return;
 
     tb::TBFontDescription fd(widget_->GetFontDescription());
-    fd.SetID(fontId);
+    fd.SetID(fontIdHash);
     widget_->SetFontDescription(fd);
 }
 
+unsigned UIWidget::GetFontIdHash()
+{
+    if (!widget_)
+        return 0;
+
+    tb::TBFontDescription fd(widget_->GetFontDescription());
+    return fd.GetID();
+}
 
 void UIWidget::SetFontSize(int size)
 {

+ 2 - 1
Source/Atomic/UI/UIWidget.h

@@ -275,7 +275,8 @@ class UIWidget : public Object, public tb::TBWidgetDelegate
 
     // Font Description
     void SetFontId(const String& fontId);
-    void SetFontId(tb::uint32 fontId);
+    void SetFontIdHash(unsigned fontIdHash);
+    unsigned GetFontIdHash();
     void SetFontSize(int size);
     int GetFontSize();