#include "GuiApplication.h"
#include "GuiFontMetrics.h"
#include "GuiImage.h"
-
-#include "GuiApplication.h"
#include "qt_helpers.h"
-#include "support/debug.h"
#include "Language.h"
#include "LyXRC.h"
-#include "support/unicode.h"
+#include "support/debug.h"
#include <QPixmapCache>
#include <QTextLayout>
#define USE_PIXMAP_CACHE 1
#endif
-using std::endl;
-using std::string;
-
+using namespace std;
namespace lyx {
namespace frontend {
setFont(fi.font);
// We need to draw the text as LTR as we use our own bidi code.
setLayoutDirection(Qt::LeftToRight);
- // We need to draw the text as LTR as we use our own bidi code.
- setLayoutDirection(Qt::LeftToRight);
drawText(x, y, str);
- //LYXERR(Debug::PAINTING, "draw " << std::string(str.toUtf8())
+ //LYXERR(Debug::PAINTING, "draw " << string(str.toUtf8())
// << " at " << x << "," << y);
return textwidth;
}
// Only the left bearing of the first character is important
// as we always write from left to right, even for
// right-to-left languages.
- int const lb = std::min(fi.metrics.lbearing(s[0]), 0);
+ int const lb = min(fi.metrics.lbearing(s[0]), 0);
int const mA = fi.metrics.maxAscent();
if (!QPixmapCache::find(key, pm)) {
// Only the right bearing of the last character is
FontMetrics const & fm = theFontMetrics(font);
fm.buttonText(str, width, ascent, descent);
- button(x + 1, y - ascent, width - 2, descent + ascent, mouseHover);
- text(x + 4, y - 1, str, font);
+ static int const d = Inset::TEXT_TO_INSET_OFFSET / 2;
+
+ button(x + d, y - ascent, width - d, descent + ascent, mouseHover);
+ text(x + Inset::TEXT_TO_INSET_OFFSET, y, str, font);
}