class CursorWidget {
public:
- CursorWidget() {
+ CursorWidget() : rtl_(false), l_shape_(false), completable_(false),
+ show_(false), x_(0), cursor_width_(0)
+ {
recomputeWidth();
}
GuiWorkArea::Private::Private(GuiWorkArea * parent)
-: p(parent), screen_(0), buffer_view_(0), lyx_view_(0), cursor_visible_(false),
+: p(parent), screen_(0), buffer_view_(0), read_only_(false), lyx_view_(0),
+cursor_visible_(false), cursor_(0),
need_resize_(false), schedule_redraw_(false), preedit_lines_(1),
pixel_ratio_(1.0),
-completer_(new GuiCompleter(p, p))
+completer_(new GuiCompleter(p, p)), dialog_mode_(false)
{
}
&& !completer_->inlineVisible();
cursor_visible_ = true;
cursor_->recomputeWidth();
+
+ //int cur_x = buffer_view_->getPos(cur).x_;
+ // We may have decided to slide the cursor row so that cursor
+ // is visible.
+ p.x_ -= buffer_view_->horizScrollOffset();
+
showCursor(p.x_, p.y_, h, l_shape, isrtl, completable);
}
}
// Show the cursor immediately after any operation.
startBlinkingCursor();
+ // FIXME QT5
#ifdef Q_WS_X11
QApplication::syncX();
#endif
return;
}
-#if (QT_VERSION < 0x050000)
+#if (QT_VERSION < 0x050000) && !defined(__HAIKU__)
inputContext()->reset();
#endif
// do nothing if there are other events
// (the auto repeated events come too fast)
// it looks like this is only needed on X11
-#ifdef Q_WS_X11
+#if defined(Q_WS_X11) || defined(QPA_XCB)
if (qApp->hasPendingEvents() && ev->isAutoRepeat()) {
switch (ev->key()) {
case Qt::Key_PageDown:
closeBufferButton = new QToolButton(this);
closeBufferButton->setPalette(pal);
// FIXME: rename the icon to closebuffer.png
- closeBufferButton->setIcon(QIcon(getPixmap("images/", "closetab", "png")));
+ closeBufferButton->setIcon(QIcon(getPixmap("images/", "closetab", "svgz,png")));
closeBufferButton->setText("Close File");
closeBufferButton->setAutoRaise(true);
closeBufferButton->setCursor(Qt::ArrowCursor);
if (!dotted) {
if (dottedPrefix_ && !prefix_.isEmpty())
- prefix_ += ".../";
+ prefix_ += ellipsisSlash_;
prefix_ += postfix_.front() + "/";
}
dottedPrefix_ = dotted && !prefix_.isEmpty();
return filename_;
bool dots = dottedPrefix_ || !postfix_.isEmpty();
- return prefix_ + (dots ? ".../" : "") + filename_;
+ return prefix_ + (dots ? ellipsisSlash_ : "") + filename_;
}
///
QString forecastPathString() const
return displayString();
return prefix_
- + (dottedPrefix_ ? ".../" : "")
+ + (dottedPrefix_ ? ellipsisSlash_ : "")
+ postfix_.front() + "/";
}
///
int tab() const { return tab_; }
private:
+ /// ".../"
+ static QString const ellipsisSlash_;
///
QString prefix_;
///
};
+QString const DisplayPath::ellipsisSlash_ = QString(QChar(0x2026)) + "/";
+
+
///
bool operator<(DisplayPath const & a, DisplayPath const & b)
{
QString tab_text = it->displayString().replace("&", "&&");
if (!buf.fileName().empty() && !buf.isClean())
tab_text += "*";
+ QString tab_tooltip = it->abs();
+ if (buf.isReadonly()) {
+ setTabIcon(tab_index, QIcon(getPixmap("images/", "emblem-readonly", "svgz,png")));
+ tab_tooltip = qt_("%1 (read only)").arg(it->abs());
+ } else
+ setTabIcon(tab_index, QIcon());
setTabText(tab_index, tab_text);
- setTabToolTip(tab_index, it->abs());
+ setTabToolTip(tab_index, tab_tooltip);
}
}
// show tab popup
QMenu popup;
- popup.addAction(QIcon(getPixmap("images/", "hidetab", "png")),
+ popup.addAction(QIcon(getPixmap("images/", "hidetab", "svgz,png")),
qt_("Hide tab"), this, SLOT(hideCurrentTab()));
- popup.addAction(QIcon(getPixmap("images/", "closetab", "png")),
+ popup.addAction(QIcon(getPixmap("images/", "closetab", "svgz,png")),
qt_("Close tab"), this, SLOT(closeCurrentBuffer()));
popup.exec(tabBar()->mapToGlobal(pos));