Skip to content

Commit

Permalink
fix navgation button text cant display completely
Browse files Browse the repository at this point in the history
https://bugzilla.deepin.io/show_bug.cgi?id=9140

Change-Id: Id645cf0127f6a7380d420b7625ae7faaf5de5a7b
  • Loading branch information
sbwtw committed Sep 6, 2016
1 parent acc538e commit 9c1c03f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion global_util/calculate_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int CalculateUtil::itemIconWidth(const int itemWidth) const

void CalculateUtil::calculateTextSize(const int screenWidth)
{
if (screenWidth >= 1366)
if (screenWidth > 1366)
{
m_navgationTextSize = 14;
m_titleTextSize = 15;
Expand Down
3 changes: 2 additions & 1 deletion global_util/calculate_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class CalculateUtil : public QObject
static int calculateBesidePadding(const int screenWidth);

inline int titleTextSize() const {return m_titleTextSize;}
inline int navgationTextSize() const {return m_navgationTextSize;}
// NOTE: navgation text size animation max zoom scale is 1.2
inline int navgationTextSize() const {return double(m_navgationTextSize) / 1.2;}
inline int appColumnCount() const {return m_appColumnCount;}
inline int appItemFontSize() const {return m_appItemFontSize;}
inline QSize appIconSize() const { return QSize(m_appIconSize, m_appIconSize);}
Expand Down
2 changes: 1 addition & 1 deletion global_util/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static const int CATEGORY_TITLE_WIDGET_HEIGHT = 50;

static const int VIEWLIST_BOTTOM_MARGIN = 60;

static const int NAVIGATION_ICON_HEIGHT = 50;
static const int NAVIGATION_ICON_HEIGHT = 50 / 1.2;

static const int TOP_BOTTOM_GRADIENT_HEIGHT = 60;

Expand Down
2 changes: 1 addition & 1 deletion widgets/categorybutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void CategoryButton::setZoomLevel(const qreal &zoomLevel)
m_zoomLevel = zoomLevel;

setFixedHeight(DLauncher::NAVIGATION_ICON_HEIGHT * zoomLevel);
m_iconLabel->setFixedSize(22 * zoomLevel, 22 * zoomLevel);
m_iconLabel->setFixedSize(22.0 * zoomLevel, 22.0 * zoomLevel);

QFont font = m_textLabel->font();
font.setPixelSize(m_calcUtil->navgationTextSize() * zoomLevel);
Expand Down

0 comments on commit 9c1c03f

Please sign in to comment.