#include "GuiWorkArea.h"
+#include "ColorCache.h"
+#include "FontLoader.h"
+#include "Menus.h"
+
#include "Buffer.h"
#include "BufferParams.h"
#include "BufferView.h"
#include <QTimer>
#include <QToolButton>
#include <QToolTip>
+#include <QMenuBar>
#include <boost/bind.hpp>
void GuiWorkArea::processKeySym(KeySymbol const & key, KeyModifier mod)
{
+ if (lyx_view_->isFullScreen() && lyx_view_->menuBar()->isVisible()) {
+ // FIXME HACK: we should not have to do this here. See related comment
+ // in GuiView::event() (QEvent::ShortcutOverride)
+ lyx_view_->menuBar()->hide();
+ }
+
// In order to avoid bad surprise in the middle of an operation,
// we better stop the blinking cursor...
// the cursor gets restarted in GuiView::restartCursor()
// Skip these when selecting
if (cmd.action != LFUN_MOUSE_MOTION) {
completer_->updateVisibility(false, false);
- lyx_view_->updateLayoutList();
- lyx_view_->updateToolbars();
+ lyx_view_->updateDialogs();
}
// GUI tweaks except with mouse motion with no button pressed.
: tab_(tab)
{
filename_ = toqstr(filename.onlyFileNameWithoutExt());
- postfix_ = toqstr(filename.absoluteFilePath()).split("/", QString::SkipEmptyParts);
+ postfix_ = toqstr(filename.absoluteFilePath()).
+ split("/", QString::SkipEmptyParts);
postfix_.pop_back();
abs_ = toqstr(filename.absoluteFilePath());
dottedPrefix_ = false;
/// when really needed.
void shiftPathSegment(bool dotted)
{
- if (postfix_.count() > 0) {
- if (!dotted) {
- if (dottedPrefix_ && !prefix_.isEmpty())
- prefix_ += ".../";
- prefix_ += postfix_.front() + "/";
- }
- dottedPrefix_ = dotted && !prefix_.isEmpty();
- postfix_.pop_front();
+ if (postfix_.count() <= 0)
+ return;
+
+ if (!dotted) {
+ if (dottedPrefix_ && !prefix_.isEmpty())
+ prefix_ += ".../";
+ prefix_ += postfix_.front() + "/";
}
+ dottedPrefix_ = dotted && !prefix_.isEmpty();
+ postfix_.pop_front();
}
///
QString displayString() const
{
if (prefix_.isEmpty())
return filename_;
- else {
- bool dots = dottedPrefix_ || !postfix_.isEmpty();
- return prefix_
- + (dots ? ".../" : "")
- + filename_;
- }
+
+ bool dots = dottedPrefix_ || !postfix_.isEmpty();
+ return prefix_ + (dots ? ".../" : "") + filename_;
}
///
QString forecastPathString() const
+ postfix_.front() + "/";
}
///
- bool final() const
- {
- return postfix_.empty();
- }
+ bool final() const { return postfix_.empty(); }
///
- int tab() const
- {
- return tab_;
- }
+ int tab() const { return tab_; }
private:
///
// final?
allFinal = allFinal && it->final();
- LYXERR(Debug::GUI, "it = " << fromqstr(it->abs())
- << " => " << fromqstr(it->displayString()));
+ LYXERR(Debug::GUI, "it = " << it->abs()
+ << " => " << it->displayString());
// still the same segment?
QString nextString;
It sit = segStart;
QString dspString = sit->forecastPathString();
LYXERR(Debug::GUI, "first forecast found for "
- << fromqstr(sit->abs())
- << " => " << fromqstr(dspString));
+ << sit->abs() << " => " << dspString);
++sit;
bool moreUnique = false;
for (; sit != next; ++sit) {
if (sit->forecastPathString() != dspString) {
LYXERR(Debug::GUI, "different forecast found for "
- << fromqstr(sit->abs())
- << " => "
- << fromqstr(sit->forecastPathString()));
+ << sit->abs() << " => " << sit->forecastPathString());
moreUnique = true;
break;
- } else {
- LYXERR(Debug::GUI, "same forecast found for "
- << fromqstr(sit->abs())
- << " => "
- << fromqstr(dspString));
}
+ LYXERR(Debug::GUI, "same forecast found for "
+ << sit->abs() << " => " << dspString);
}
// if the path segment helped, add it. Otherwise add dots
LYXERR(Debug::GUI, "using dots = " << dots);
for (sit = segStart; sit != next; ++sit) {
sit->shiftPathSegment(dots);
- LYXERR(Debug::GUI, "shifting " << fromqstr(sit->abs())
- << " => "
- << fromqstr(sit->displayString()));
+ LYXERR(Debug::GUI, "shifting "
+ << sit->abs() << " => " << sit->displayString());
}
// start new segment
{
// which tab?
clicked_tab_ = static_cast<DragTabBar *>(tabBar())->tabAt(pos);
- if (clicked_tab_ != -1) {
- // show tab popup
- QMenu popup;
- popup.addAction(QIcon(":/images/hidetab.png"),
- qt_("Hide tab"), this, SLOT(closeCurrentTab()));
- popup.addAction(QIcon(":/images/closetab.png"),
- qt_("Close tab"), this, SLOT(closeCurrentBuffer()));
- popup.exec(tabBar()->mapToGlobal(pos));
-
- clicked_tab_ = -1;
- }
+ if (clicked_tab_ == -1)
+ return;
+
+ // show tab popup
+ QMenu popup;
+ popup.addAction(QIcon(":/images/hidetab.png"),
+ qt_("Hide tab"), this, SLOT(closeCurrentTab()));
+ popup.addAction(QIcon(":/images/closetab.png"),
+ qt_("Close tab"), this, SLOT(closeCurrentBuffer()));
+ popup.exec(tabBar()->mapToGlobal(pos));
+
+ clicked_tab_ = -1;
}