~brandontschaefer/unity/bump-to-new-nux-abi

« back to all changes in this revision

Viewing changes to dash/previews/ActionButton.cpp

  • Committer: CI bot
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2014-09-04 22:11:33 UTC
  • mfrom: (3860.2.9 font-scaling-fixes)
  • Revision ID: ps-jenkins@lists.canonical.com-20140904221133-mywh9mdct0vbigzp
SearchBar, ActionButtons, IconRenderer: include the font scaling when scaling textual items

User font scaling settings should be applied to all the items containing text.
Fixed some elements missing support. Fixes: 1332947, 1361713, 1362162, 1362346
Approved by: Andrea Azzarone, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <Nux/HLayout.h>
25
25
#include "unity-shared/IconTexture.h"
26
26
#include "unity-shared/StaticCairoText.h"
 
27
#include "unity-shared/UnitySettings.h"
27
28
 
28
29
namespace unity
29
30
{
49
50
  Init();
50
51
  BuildLayout(label, icon_hint, "");
51
52
  scale.changed.connect(sigc::mem_fun(this, &ActionButton::UpdateScale));
 
53
  Settings::Instance().font_scaling.changed.connect(sigc::hide(sigc::mem_fun(this, &ActionButton::InitTheme)));
52
54
}
53
55
 
54
56
ActionButton::~ActionButton()
91
93
  cr_normal_.reset(new nux::CairoWrapper(geo, sigc::bind(sigc::mem_fun(this, &ActionButton::RedrawTheme), nux::ButtonVisualState::VISUAL_STATE_NORMAL)));
92
94
  cr_focus_.reset(new nux::CairoWrapper(geo, sigc::mem_fun(this, &ActionButton::RedrawFocusOverlay)));
93
95
 
94
 
  SetMinimumHeight(MIN_BUTTON_HEIGHT.CP(scale));
95
 
  SetMinimumWidth(MIN_BUTTON_WIDTH.CP(scale));
 
96
  double font_scaling = Settings::Instance().font_scaling() * scale;
 
97
  SetMinimumHeight(MIN_BUTTON_HEIGHT.CP(font_scaling));
 
98
  SetMinimumWidth(MIN_BUTTON_WIDTH.CP(font_scaling));
96
99
}
97
100
 
98
101
void ActionButton::SetExtraHint(std::string const& extra_hint, std::string const& font_hint)