aboutsummaryrefslogtreecommitdiff
path: root/src/WorkspaceNameTool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/WorkspaceNameTool.cc')
-rw-r--r--src/WorkspaceNameTool.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/WorkspaceNameTool.cc b/src/WorkspaceNameTool.cc
index 579592f..fc944f9 100644
--- a/src/WorkspaceNameTool.cc
+++ b/src/WorkspaceNameTool.cc
@@ -34,7 +34,7 @@
34WorkspaceNameTool::WorkspaceNameTool(const FbTk::FbWindow &parent, 34WorkspaceNameTool::WorkspaceNameTool(const FbTk::FbWindow &parent,
35 FbTk::ThemeProxy<ToolTheme> &theme, BScreen &screen): 35 FbTk::ThemeProxy<ToolTheme> &theme, BScreen &screen):
36 ToolbarItem(ToolbarItem::FIXED), 36 ToolbarItem(ToolbarItem::FIXED),
37 m_button(parent, theme->font(), "a workspace name"), 37 m_button(parent, theme->font(), FbTk::BiDiString("a workspace name")),
38 m_theme(theme), 38 m_theme(theme),
39 m_screen(screen), 39 m_screen(screen),
40 m_pixmap(0) { 40 m_pixmap(0) {
@@ -93,9 +93,7 @@ unsigned int WorkspaceNameTool::width() const {
93 const BScreen::Workspaces& workspaces = m_screen.getWorkspacesList(); 93 const BScreen::Workspaces& workspaces = m_screen.getWorkspacesList();
94 BScreen::Workspaces::const_iterator it; 94 BScreen::Workspaces::const_iterator it;
95 for (it = workspaces.begin(); it != workspaces.end(); it++) { 95 for (it = workspaces.begin(); it != workspaces.end(); it++) {
96 const std::string &name = (*it)->name(); 96 max_size = std::max(m_theme->font().textWidth((*it)->name()), max_size);
97 max_size = std::max(m_theme->font().textWidth(name, name.size()),
98 max_size);
99 } 97 }
100 // so align text dont cut the last character 98 // so align text dont cut the last character
101 max_size += 2; 99 max_size += 2;
@@ -111,9 +109,7 @@ unsigned int WorkspaceNameTool::height() const {
111 const BScreen::Workspaces& workspaces = m_screen.getWorkspacesList(); 109 const BScreen::Workspaces& workspaces = m_screen.getWorkspacesList();
112 BScreen::Workspaces::const_iterator it; 110 BScreen::Workspaces::const_iterator it;
113 for (it = workspaces.begin(); it != workspaces.end(); it++) { 111 for (it = workspaces.begin(); it != workspaces.end(); it++) {
114 const std::string &name = (*it)->name(); 112 max_size = std::max(m_theme->font().textWidth((*it)->name()), max_size);
115 max_size = std::max(m_theme->font().textWidth(name, name.size()),
116 max_size);
117 } 113 }
118 // so align text dont cut the last character 114 // so align text dont cut the last character
119 max_size += 2; 115 max_size += 2;