Skip to content

Commit

Permalink
Merge pull request #480 from mwoehlke-kitware/less-windows-unicode
Browse files Browse the repository at this point in the history
Avoid use of non-ASCII whitespace on Windows
  • Loading branch information
mleotta committed May 19, 2021
2 parents 64eda72 + 95d1278 commit a34db3a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions gui/GroundControlPointsModel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@

#include <limits>

// Define the string used to add a "fake" right margin to top-level items
#ifdef Q_OS_LINUX
// EM SPACE looks better and should be available on Linux
#define MARGIN_SPACE u"\u2003"
#else
// Windows Unicode font support is trash (and apparently Q_OS_WIN is not being
// reliably defined, so all of not-Linux loses)
#define MARGIN_SPACE " "
#endif

namespace kv = kwiver::vital;

namespace
Expand Down Expand Up @@ -260,12 +270,12 @@ QVariant GroundControlPointsModel::data(
case Qt::DisplayRole:
if (!item.gcp)
{
static const auto t = QStringLiteral("(%1)\u2003");
static const auto t = QStringLiteral("(%1) " MARGIN_SPACE );
return t.arg(item.id);
}
else
{
static const auto t = QStringLiteral("%1\u2007\u2003");
static const auto t = QStringLiteral("%1 " MARGIN_SPACE );
return t.arg(item.id);
}

Expand Down

0 comments on commit a34db3a

Please sign in to comment.