Skip to content

Commit

Permalink
browser: add ellipsis on the pkg count button to hint at its menu (#18)
Browse files Browse the repository at this point in the history
also removes number formating which was ugly and, on macOS, inconsistent
(one worked when REAPER was ran from the terminal)

closes #18
  • Loading branch information
cfillion committed Jan 18, 2017
1 parent 1f572f8 commit edcb162
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
#include "resource.hpp"
#include "transaction.hpp"

#include <boost/algorithm/string.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <locale>
#include <sstream>

using namespace std;

Expand Down Expand Up @@ -410,15 +407,12 @@ void Browser::fillMenu(Menu &menu)

void Browser::updateDisplayLabel()
{
basic_ostringstream<auto_char> btnLabel;
btnLabel.imbue(locale("")); // enable number formatting
btnLabel << m_list->rowCount() << AUTO_STR('/') << m_entries.size()
<< AUTO_STR(" package");
auto_char btnLabel[32] = {};
auto_snprintf(btnLabel, auto_size(btnLabel), AUTO_STR("%d/%zu package%s..."),
m_list->rowCount(), m_entries.size(),
m_entries.size() == 1 ? AUTO_STR("") : AUTO_STR("s"));

if(m_entries.size() != 1)
btnLabel << AUTO_STR('s');

SetWindowText(m_displayBtn, btnLabel.str().c_str());
SetWindowText(m_displayBtn, btnLabel);
}

void Browser::displayButton()
Expand Down

0 comments on commit edcb162

Please sign in to comment.