Changeset View
Changeset View
Standalone View
Standalone View
src/view/katestatusbar.cpp
Show All 14 Lines | |||||
15 | * You should have received a copy of the GNU Library General Public License | 15 | * You should have received a copy of the GNU Library General Public License | ||
16 | * along with this library; see the file COPYING.LIB. If not, write to | 16 | * along with this library; see the file COPYING.LIB. If not, write to | ||
17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | * Boston, MA 02110-1301, USA. | 18 | * Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "katestatusbar.h" | 21 | #include "katestatusbar.h" | ||
22 | 22 | | |||
23 | #include "katemodemenu.h" | 23 | #include "katemodemenulist.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 <KActionCollection> | ||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Line(s) | 78 | { | |||
183 | * this will reuse the encoding action menu of the view | 183 | * this will reuse the encoding action menu of the view | ||
184 | */ | 184 | */ | ||
185 | m_encoding = new StatusBarButton(this); | 185 | m_encoding = new StatusBarButton(this); | ||
186 | topLayout->addWidget(m_encoding); | 186 | topLayout->addWidget(m_encoding); | ||
187 | m_encoding->setMenu(m_view->encodingAction()->menu()); | 187 | m_encoding->setMenu(m_view->encodingAction()->menu()); | ||
188 | m_encoding->setWhatsThis(i18n("Encoding")); | 188 | m_encoding->setWhatsThis(i18n("Encoding")); | ||
189 | 189 | | |||
190 | /** | 190 | /** | ||
191 | * load the mode menu, which contains a scrollable list + search bar. | ||||
192 | * This is an alternative menu to the mode action menu of the view. | ||||
193 | */ | ||||
194 | KateModeMenuList *modeMenuList = new KateModeMenuList(i18n("Mode"), this); | ||||
195 | modeMenuList->setWhatsThis(i18n("Here you can choose which mode should be used for the current document. This will influence the highlighting and folding being used, for example.")); | ||||
196 | modeMenuList->updateMenu(m_view->doc()); | ||||
197 | /** | ||||
191 | * add mode button which allows user to switch mode of document | 198 | * add mode button which allows user to switch mode of document | ||
192 | * this will reuse the mode action menu of the view | 199 | * this will reuse the mode action menu of the view | ||
193 | */ | 200 | */ | ||
194 | m_mode = new StatusBarButton(this); | 201 | m_mode = new StatusBarButton(this); | ||
195 | topLayout->addWidget(m_mode); | 202 | topLayout->addWidget(m_mode); | ||
196 | m_mode->setMenu(m_view->modeAction()->menu()); | 203 | modeMenuList->setButton(m_mode, false, KateModeMenuList::Inverse); | ||
204 | m_mode->setMenu(modeMenuList); | ||||
197 | m_mode->setWhatsThis(i18n("Syntax highlighting")); | 205 | m_mode->setWhatsThis(i18n("Syntax highlighting")); | ||
198 | 206 | | |||
199 | // signals for the statusbar | 207 | // signals for the statusbar | ||
200 | connect(m_view, &KTextEditor::View::cursorPositionChanged, this, &KateStatusBar::cursorPositionChanged); | 208 | connect(m_view, &KTextEditor::View::cursorPositionChanged, this, &KateStatusBar::cursorPositionChanged); | ||
201 | connect(m_view, &KTextEditor::View::viewModeChanged, this, &KateStatusBar::viewModeChanged); | 209 | connect(m_view, &KTextEditor::View::viewModeChanged, this, &KateStatusBar::viewModeChanged); | ||
202 | connect(m_view, &KTextEditor::View::selectionChanged, this, &KateStatusBar::selectionChanged); | 210 | connect(m_view, &KTextEditor::View::selectionChanged, this, &KateStatusBar::selectionChanged); | ||
203 | connect(m_view->document(), &KTextEditor::DocumentPrivate::modifiedChanged, this, &KateStatusBar::modifiedChanged); | 211 | connect(m_view->document(), &KTextEditor::DocumentPrivate::modifiedChanged, this, &KateStatusBar::modifiedChanged); | ||
204 | connect(m_view->doc(), &KTextEditor::DocumentPrivate::modifiedOnDisk, this, &KateStatusBar::modifiedChanged); | 212 | connect(m_view->doc(), &KTextEditor::DocumentPrivate::modifiedOnDisk, this, &KateStatusBar::modifiedChanged); | ||
▲ Show 20 Lines • Show All 378 Lines • Show Last 20 Lines |