Changeset View
Changeset View
Standalone View
Standalone View
src/view/katestatusbar.cpp
Show All 22 Lines | |||||
23 | #include "katemodemenu.h" | 23 | #include "katemodemenu.h" | ||
24 | #include "kateglobal.h" | 24 | #include "kateglobal.h" | ||
25 | #include "katemodemanager.h" | 25 | #include "katemodemanager.h" | ||
26 | #include "katedocument.h" | 26 | #include "katedocument.h" | ||
27 | #include "kateconfig.h" | 27 | #include "kateconfig.h" | ||
28 | #include "kateabstractinputmode.h" | 28 | #include "kateabstractinputmode.h" | ||
29 | #include "wordcounter.h" | 29 | #include "wordcounter.h" | ||
30 | 30 | | |||
31 | #include <KActionCollection> | ||||
31 | #include <KLocalizedString> | 32 | #include <KLocalizedString> | ||
32 | #include <KIconUtils> | 33 | #include <KIconUtils> | ||
33 | #include <KAcceleratorManager> | 34 | #include <KAcceleratorManager> | ||
34 | #include <Sonnet/Speller> | 35 | #include <Sonnet/Speller> | ||
35 | 36 | | |||
36 | #include <QHBoxLayout> | 37 | #include <QHBoxLayout> | ||
37 | #include <QInputDialog> | 38 | #include <QInputDialog> | ||
38 | 39 | | |||
▲ Show 20 Lines • Show All 178 Lines • ▼ Show 20 Line(s) | |||||
217 | { | 218 | { | ||
218 | return KateViewBarWidget::eventFilter(obj, event); | 219 | return KateViewBarWidget::eventFilter(obj, event); | ||
219 | } | 220 | } | ||
220 | 221 | | |||
221 | void KateStatusBar::contextMenuEvent(QContextMenuEvent *event) | 222 | void KateStatusBar::contextMenuEvent(QContextMenuEvent *event) | ||
222 | { | 223 | { | ||
223 | // TODO Add option "Show Statusbar" and options to show/hide buttons of the status bar | 224 | // TODO Add option "Show Statusbar" and options to show/hide buttons of the status bar | ||
224 | QMenu menu(this); | 225 | QMenu menu(this); | ||
226 | | ||||
227 | if (childAt(event->pos()) == m_inputMode) { | ||||
228 | if (QAction *inputModesAction = m_view->actionCollection()->action(QStringLiteral("view_input_modes"))) { | ||||
229 | if (QMenu *inputModesMenu = inputModesAction->menu()) { | ||||
230 | const auto actions = inputModesMenu->actions(); | ||||
231 | for (int i = 0; i < actions.count(); ++i) { | ||||
232 | menu.addAction(actions.at(i)); | ||||
233 | } | ||||
234 | menu.addSeparator(); | ||||
235 | } | ||||
236 | } | ||||
237 | } | ||||
238 | | ||||
225 | QAction *showLines = menu.addAction(QStringLiteral("Show line count"), this, &KateStatusBar::toggleShowLines); | 239 | QAction *showLines = menu.addAction(QStringLiteral("Show line count"), this, &KateStatusBar::toggleShowLines); | ||
226 | showLines->setCheckable(true); | 240 | showLines->setCheckable(true); | ||
227 | showLines->setChecked(KateViewConfig::global()->showLineCount()); | 241 | showLines->setChecked(KateViewConfig::global()->showLineCount()); | ||
228 | QAction *showWords = menu.addAction(QStringLiteral("Show word count"), this, &KateStatusBar::toggleShowWords); | 242 | QAction *showWords = menu.addAction(QStringLiteral("Show word count"), this, &KateStatusBar::toggleShowWords); | ||
229 | showWords->setCheckable(true); | 243 | showWords->setCheckable(true); | ||
230 | showWords->setChecked(KateViewConfig::global()->showWordCount()); | 244 | showWords->setChecked(KateViewConfig::global()->showWordCount()); | ||
231 | menu.exec(event->globalPos()); | 245 | menu.exec(event->globalPos()); | ||
232 | 246 | | |||
▲ Show 20 Lines • Show All 336 Lines • Show Last 20 Lines |