Changeset View
Changeset View
Standalone View
Standalone View
src/view/katestatusbar.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | 44 | if (visibility) { | |||
---|---|---|---|---|---|
48 | if (geo.top() < 0) geo.moveTop(0); | 48 | if (geo.top() < 0) geo.moveTop(0); | ||
49 | setGeometry(geo); | 49 | setGeometry(geo); | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | QMenu::setVisible(visibility); | 52 | QMenu::setVisible(visibility); | ||
53 | } | 53 | } | ||
54 | //END menu | 54 | //END menu | ||
55 | 55 | | |||
56 | //BEGIN StatusBarButton | ||||
57 | StatusBarButton::StatusBarButton(KateStatusBar *parent, const QString &text /*= QString()*/) | ||||
58 | : QPushButton(text, parent) | ||||
59 | { | ||||
60 | setFlat(true); | ||||
61 | setFocusProxy(parent->m_view); | ||||
62 | } | ||||
63 | | ||||
64 | StatusBarButton::~StatusBarButton() | ||||
65 | { | ||||
66 | } | ||||
67 | //END StatusBarButton | ||||
68 | | ||||
56 | KateStatusBar::KateStatusBar(KTextEditor::ViewPrivate *view) | 69 | KateStatusBar::KateStatusBar(KTextEditor::ViewPrivate *view) | ||
57 | : KateViewBarWidget(false) | 70 | : KateViewBarWidget(false) | ||
58 | , m_view(view) | 71 | , m_view(view) | ||
59 | , m_insertModeLabel(nullptr) | | |||
60 | , m_modifiedStatus(-1) | 72 | , m_modifiedStatus(-1) | ||
61 | , m_selectionMode(-1) | 73 | , m_selectionMode(-1) | ||
62 | , m_wordCounter(nullptr) | 74 | , m_wordCounter(nullptr) | ||
63 | { | 75 | { | ||
64 | KAcceleratorManager::setNoAccel(this); | 76 | KAcceleratorManager::setNoAccel(this); | ||
65 | setFocusProxy(m_view); | 77 | setFocusProxy(m_view); | ||
66 | 78 | | |||
67 | /** | 79 | /** | ||
68 | * just add our status bar to central widget, full sized | 80 | * just add our status bar to central widget, full sized | ||
69 | */ | 81 | */ | ||
70 | QHBoxLayout *topLayout = new QHBoxLayout(centralWidget()); | 82 | QHBoxLayout *topLayout = new QHBoxLayout(centralWidget()); | ||
71 | topLayout->setMargin(0); | 83 | topLayout->setMargin(0); | ||
72 | topLayout->setSpacing(4); | 84 | topLayout->setSpacing(4); | ||
73 | 85 | | |||
74 | /** | 86 | /** | ||
75 | * add a bit space | 87 | * add a bit space | ||
76 | */ | 88 | */ | ||
77 | topLayout->addSpacing(4); | 89 | topLayout->addSpacing(4); | ||
78 | 90 | | |||
79 | /** | 91 | /** | ||
92 | * show modification state of the document | ||||
93 | * TODO Using a (StatusBar)Button is currently pointless but handy due to no "setIcon()" function in QLabel. | ||||
94 | * Add some useful action when button is clicked, e.g. save document or show tool-tip | ||||
95 | * or find a way to not show a "focus frame" when hovered by mouse | ||||
96 | */ | ||||
97 | m_modified = new StatusBarButton(this); | ||||
98 | topLayout->addWidget(m_modified, 0); | ||||
99 | | ||||
100 | /** | ||||
80 | * show Line XXX, Column XXX | 101 | * show Line XXX, Column XXX | ||
81 | */ | 102 | */ | ||
82 | m_lineColLabel = new QLabel(this); | 103 | m_cursorPosition = new StatusBarButton(this); | ||
83 | m_lineColLabel->installEventFilter(this); // register for doubleclick | 104 | topLayout->addWidget(m_cursorPosition, 0); | ||
84 | topLayout->addWidget(m_lineColLabel, 0); | 105 | m_cursorPosition->setWhatsThis(i18n("Current cursor position. Click to go to a specific line.")); | ||
85 | m_lineColLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); | 106 | connect(m_cursorPosition, &StatusBarButton::clicked, m_view, &KTextEditor::ViewPrivate::gotoLine); | ||
86 | m_lineColLabel->setFocusProxy(m_view); | | |||
87 | m_lineColLabel->setWhatsThis(i18n("Current cursor position. Doubleclick to go to specific line.")); | | |||
88 | 107 | | |||
89 | /** | 108 | /** | ||
90 | * show word count | 109 | * show word count | ||
91 | */ | 110 | */ | ||
92 | m_wordCountLabel = new QLabel(this); | 111 | m_wordCountLabel = new QLabel(this); | ||
93 | topLayout->addWidget(m_wordCountLabel, 0); | 112 | topLayout->addWidget(m_wordCountLabel, 0); | ||
94 | m_wordCountLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); | 113 | m_wordCountLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); | ||
95 | m_wordCountLabel->setFocusProxy(m_view); | 114 | m_wordCountLabel->setFocusProxy(m_view); | ||
96 | m_wordCountLabel->setWhatsThis(i18n("Words and Chars count in document/selection.")); | 115 | m_wordCountLabel->setWhatsThis(i18n("Words and Chars count in document/selection.")); | ||
97 | m_wordCountLabel->hide(); | 116 | m_wordCountLabel->hide(); | ||
98 | 117 | | |||
118 | // Separate the status line in a left and right part | ||||
119 | topLayout->addStretch(1); | ||||
120 | | ||||
99 | /** | 121 | /** | ||
100 | * show the current mode, like INSERT, OVERWRITE, VI + modifiers like [BLOCK] | 122 | * show the current mode, like INSERT, OVERWRITE, VI + modifiers like [BLOCK] | ||
101 | */ | 123 | */ | ||
102 | m_insertModeLabel = new QLabel(this); | 124 | m_inputMode = new StatusBarButton(this); | ||
103 | m_insertModeLabel->installEventFilter(this); // register for doubleclick | 125 | topLayout->addWidget(m_inputMode); | ||
104 | topLayout->addWidget(m_insertModeLabel, 1000 /* this one should stretch */); | 126 | m_inputMode->setWhatsThis(i18n("Insert mode and VI input mode indicator. Click to change the mode.")); | ||
105 | m_insertModeLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight); | 127 | connect(m_inputMode, &StatusBarButton::clicked, [=] { m_view->currentInputMode()->toggleInsert(); }); | ||
106 | m_insertModeLabel->setFocusProxy(m_view); | | |||
107 | m_insertModeLabel->setWhatsThis(i18n("Insert mode and VI input mode indicator")); | | |||
108 | 128 | | |||
109 | /** | 129 | /** | ||
110 | * allow to change indentation configuration | 130 | * allow to change indentation configuration | ||
111 | */ | 131 | */ | ||
112 | m_spacesOnly = ki18n("Soft Tabs: %1"); | 132 | m_spacesOnly = ki18n("Soft Tabs: %1"); | ||
113 | m_spacesOnlyShowTabs = ki18n("Soft Tabs: %1 (%2)"); | 133 | m_spacesOnlyShowTabs = ki18n("Soft Tabs: %1 (%2)"); | ||
114 | m_tabsOnly = ki18n("Tab Size: %1"); | 134 | m_tabsOnly = ki18n("Tab Size: %1"); | ||
115 | m_tabSpacesMixed = ki18n("Indent/Tab: %1/%2"); | 135 | m_tabSpacesMixed = ki18n("Indent/Tab: %1/%2"); | ||
116 | 136 | | |||
117 | QAction *action; | 137 | QAction *action; | ||
118 | m_tabGroup = new QActionGroup(this); | 138 | m_tabGroup = new QActionGroup(this); | ||
119 | m_indentGroup = new QActionGroup(this); | 139 | m_indentGroup = new QActionGroup(this); | ||
120 | 140 | | |||
121 | m_tabsIndent = new QPushButton(QString(), this); | 141 | m_tabsIndent = new StatusBarButton(this); | ||
122 | m_tabsIndent->setFlat(true); | | |||
123 | topLayout->addWidget(m_tabsIndent, 0); | 142 | topLayout->addWidget(m_tabsIndent, 0); | ||
124 | m_tabsIndent->setFocusProxy(m_view); | | |||
125 | 143 | | |||
126 | m_indentSettingsMenu = new KateStatusBarOpenUpMenu(m_tabsIndent); | 144 | m_indentSettingsMenu = new KateStatusBarOpenUpMenu(m_tabsIndent); | ||
127 | m_indentSettingsMenu->addSection(i18n("Tab Width")); | 145 | m_indentSettingsMenu->addSection(i18n("Tab Width")); | ||
128 | addNumberAction(m_tabGroup, m_indentSettingsMenu, -1); | 146 | addNumberAction(m_tabGroup, m_indentSettingsMenu, -1); | ||
129 | addNumberAction(m_tabGroup, m_indentSettingsMenu, 8); | 147 | addNumberAction(m_tabGroup, m_indentSettingsMenu, 8); | ||
130 | addNumberAction(m_tabGroup, m_indentSettingsMenu, 4); | 148 | addNumberAction(m_tabGroup, m_indentSettingsMenu, 4); | ||
131 | addNumberAction(m_tabGroup, m_indentSettingsMenu, 2); | 149 | addNumberAction(m_tabGroup, m_indentSettingsMenu, 2); | ||
132 | m_indentSettingsMenu->addSection(i18n("Indentation Width")); | 150 | m_indentSettingsMenu->addSection(i18n("Indentation Width")); | ||
Show All 18 Lines | |||||
151 | m_softAction = action; | 169 | m_softAction = action; | ||
152 | 170 | | |||
153 | m_tabsIndent->setMenu(m_indentSettingsMenu); | 171 | m_tabsIndent->setMenu(m_indentSettingsMenu); | ||
154 | 172 | | |||
155 | /** | 173 | /** | ||
156 | * add encoding button which allows user to switch encoding of document | 174 | * add encoding button which allows user to switch encoding of document | ||
157 | * this will reuse the encoding action menu of the view | 175 | * this will reuse the encoding action menu of the view | ||
158 | */ | 176 | */ | ||
159 | m_encoding = new QPushButton(QString(), this); | 177 | m_encoding = new StatusBarButton(this); | ||
160 | m_encoding->setFlat(true); | | |||
161 | topLayout->addWidget(m_encoding, 0); | 178 | topLayout->addWidget(m_encoding, 0); | ||
162 | m_encoding->setMenu(m_view->encodingAction()->menu()); | 179 | m_encoding->setMenu(m_view->encodingAction()->menu()); | ||
163 | m_encoding->setFocusProxy(m_view); | | |||
164 | m_encoding->setWhatsThis(i18n("Encoding")); | 180 | m_encoding->setWhatsThis(i18n("Encoding")); | ||
165 | 181 | | |||
166 | /** | 182 | /** | ||
167 | * add mode button which allows user to switch mode of document | 183 | * add mode button which allows user to switch mode of document | ||
168 | * this will reuse the mode action menu of the view | 184 | * this will reuse the mode action menu of the view | ||
169 | */ | 185 | */ | ||
170 | m_mode = new QPushButton(QString(), this); | 186 | m_mode = new StatusBarButton(this); | ||
171 | m_mode->setFlat(true); | | |||
172 | topLayout->addWidget(m_mode, 0); | 187 | topLayout->addWidget(m_mode, 0); | ||
173 | m_mode->setMenu(m_view->modeAction()->menu()); | 188 | m_mode->setMenu(m_view->modeAction()->menu()); | ||
174 | m_mode->setFocusProxy(m_view); | | |||
175 | m_mode->setWhatsThis(i18n("Syntax highlighting")); | 189 | m_mode->setWhatsThis(i18n("Syntax highlighting")); | ||
176 | 190 | | |||
177 | /** | 191 | /** | ||
178 | * show modification state of the document | | |||
179 | */ | | |||
180 | m_modifiedLabel = new QToolButton(this); | | |||
181 | m_modifiedLabel->setAutoRaise(true); | | |||
182 | m_modifiedLabel->setEnabled(false); | | |||
183 | topLayout->addWidget(m_modifiedLabel, 0); | | |||
184 | m_modifiedLabel->setFocusProxy(m_view); | | |||
185 | | ||||
186 | /** | | |||
187 | * add a bit space | 192 | * add a bit space | ||
188 | */ | 193 | */ | ||
189 | topLayout->addSpacing(4); | 194 | topLayout->addSpacing(4); | ||
190 | 195 | | |||
191 | // signals for the statusbar | 196 | // signals for the statusbar | ||
192 | connect(m_view, SIGNAL(cursorPositionChanged(KTextEditor::View*, KTextEditor::Cursor)), this, SLOT(cursorPositionChanged())); | 197 | connect(m_view, &KTextEditor::View::cursorPositionChanged, this, &KateStatusBar::cursorPositionChanged); | ||
193 | connect(m_view, SIGNAL(viewModeChanged(KTextEditor::View*, KTextEditor::View::ViewMode)), this, SLOT(viewModeChanged())); | 198 | connect(m_view, &KTextEditor::View::viewModeChanged, this, &KateStatusBar::viewModeChanged); | ||
194 | connect(m_view, SIGNAL(selectionChanged(KTextEditor::View*)), this, SLOT(selectionChanged())); | 199 | connect(m_view, &KTextEditor::View::selectionChanged, this, &KateStatusBar::selectionChanged); | ||
195 | connect(m_view->document(), SIGNAL(modifiedChanged(KTextEditor::Document*)), this, SLOT(modifiedChanged())); | 200 | connect(m_view->document(), &KTextEditor::DocumentPrivate::modifiedChanged, this, &KateStatusBar::modifiedChanged); | ||
196 | connect(m_view->document(), SIGNAL(modifiedOnDisk(KTextEditor::Document*, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)), this, SLOT(modifiedChanged())); | 201 | connect(m_view->doc(), &KTextEditor::DocumentPrivate::modifiedOnDisk, this, &KateStatusBar::modifiedChanged); | ||
197 | connect(m_view->document(), SIGNAL(configChanged()), this, SLOT(documentConfigChanged())); | 202 | connect(m_view->doc(), &KTextEditor::DocumentPrivate::configChanged, this, &KateStatusBar::documentConfigChanged); | ||
198 | connect(m_view->document(), SIGNAL(modeChanged(KTextEditor::Document*)), this, SLOT(modeChanged())); | 203 | connect(m_view->document(), &KTextEditor::DocumentPrivate::modeChanged, this, &KateStatusBar::modeChanged); | ||
199 | connect(m_view, &KTextEditor::ViewPrivate::configChanged, this, &KateStatusBar::configChanged); | 204 | connect(m_view, &KTextEditor::ViewPrivate::configChanged, this, &KateStatusBar::configChanged); | ||
200 | 205 | | |||
201 | connect(m_tabGroup, SIGNAL(triggered(QAction*)), this, SLOT(slotTabGroup(QAction*))); | 206 | connect(m_tabGroup, &QActionGroup::triggered, this, &KateStatusBar::slotTabGroup); | ||
202 | connect(m_indentGroup, SIGNAL(triggered(QAction*)), this, SLOT(slotIndentGroup(QAction*))); | 207 | connect(m_indentGroup, &QActionGroup::triggered, this, &KateStatusBar::slotIndentGroup); | ||
203 | connect(radioGroup, SIGNAL(triggered(QAction*)), this, SLOT(slotIndentTabMode(QAction*))); | 208 | connect(radioGroup, &QActionGroup::triggered, this, &KateStatusBar::slotIndentTabMode); | ||
204 | updateStatus(); | 209 | updateStatus(); | ||
205 | wordCountChanged(0, 0, 0, 0); | 210 | wordCountChanged(0, 0, 0, 0); | ||
206 | } | 211 | } | ||
207 | 212 | | |||
208 | bool KateStatusBar::eventFilter(QObject *obj, QEvent *event) | 213 | bool KateStatusBar::eventFilter(QObject *obj, QEvent *event) | ||
209 | { | 214 | { | ||
210 | if (obj == m_insertModeLabel) { | | |||
211 | if (event->type() == QEvent::MouseButtonDblClick) { | | |||
212 | m_view->currentInputMode()->toggleInsert(); | | |||
213 | return true; | | |||
214 | } | | |||
215 | } else if (obj == m_lineColLabel) { | | |||
216 | if (event->type() == QEvent::MouseButtonDblClick) { | | |||
217 | m_view->gotoLine(); | | |||
218 | return true; | | |||
219 | } | | |||
220 | } | | |||
221 | | ||||
222 | return KateViewBarWidget::eventFilter(obj, event); | 215 | return KateViewBarWidget::eventFilter(obj, event); | ||
223 | } | 216 | } | ||
224 | 217 | | |||
225 | void KateStatusBar::contextMenuEvent(QContextMenuEvent *event) | 218 | void KateStatusBar::contextMenuEvent(QContextMenuEvent *event) | ||
226 | { | 219 | { | ||
220 | // TODO Add option "Show Statusbar" and options to show/hide buttons of the status bar | ||||
227 | QMenu menu(this); | 221 | QMenu menu(this); | ||
228 | QAction *showLines = menu.addAction(QStringLiteral("Show line count"), this, &KateStatusBar::toggleShowLines); | 222 | QAction *showLines = menu.addAction(QStringLiteral("Show line count"), this, &KateStatusBar::toggleShowLines); | ||
229 | showLines->setCheckable(true); | 223 | showLines->setCheckable(true); | ||
230 | showLines->setChecked(KateViewConfig::global()->showLineCount()); | 224 | showLines->setChecked(KateViewConfig::global()->showLineCount()); | ||
231 | QAction *showWords = menu.addAction(QStringLiteral("Show word count"), this, &KateStatusBar::toggleShowWords); | 225 | QAction *showWords = menu.addAction(QStringLiteral("Show word count"), this, &KateStatusBar::toggleShowWords); | ||
232 | showWords->setCheckable(true); | 226 | showWords->setCheckable(true); | ||
233 | showWords->setChecked(KateViewConfig::global()->showWordCount()); | 227 | showWords->setChecked(KateViewConfig::global()->showWordCount()); | ||
234 | menu.exec(event->globalPos()); | 228 | menu.exec(event->globalPos()); | ||
229 | | ||||
235 | } | 230 | } | ||
236 | 231 | | |||
237 | void KateStatusBar::toggleShowLines(bool checked) | 232 | void KateStatusBar::toggleShowLines(bool checked) | ||
238 | { | 233 | { | ||
239 | KateViewConfig::global()->setShowLineCount(checked); | 234 | KateViewConfig::global()->setShowLineCount(checked); | ||
240 | } | 235 | } | ||
241 | 236 | | |||
242 | void KateStatusBar::toggleShowWords(bool checked) | 237 | void KateStatusBar::toggleShowWords(bool checked) | ||
Show All 25 Lines | |||||
268 | 263 | | |||
269 | void KateStatusBar::viewModeChanged() | 264 | void KateStatusBar::viewModeChanged() | ||
270 | { | 265 | { | ||
271 | // prepend BLOCK for block selection mode | 266 | // prepend BLOCK for block selection mode | ||
272 | QString text = m_view->viewModeHuman(); | 267 | QString text = m_view->viewModeHuman(); | ||
273 | if (m_view->blockSelection()) | 268 | if (m_view->blockSelection()) | ||
274 | text = i18n("<em>[BLOCK]</em> %1", text); | 269 | text = i18n("<em>[BLOCK]</em> %1", text); | ||
275 | 270 | | |||
276 | m_insertModeLabel->setText(text); | 271 | m_inputMode->setText(text); | ||
277 | } | 272 | } | ||
278 | 273 | | |||
279 | void KateStatusBar::cursorPositionChanged() | 274 | void KateStatusBar::cursorPositionChanged() | ||
280 | { | 275 | { | ||
281 | KTextEditor::Cursor position(m_view->cursorPositionVirtual()); | 276 | KTextEditor::Cursor position(m_view->cursorPositionVirtual()); | ||
282 | 277 | | |||
283 | if (KateViewConfig::global()->showLineCount()) | 278 | if (KateViewConfig::global()->showLineCount()) | ||
284 | m_lineColLabel->setText( | 279 | m_cursorPosition->setText( | ||
285 | i18n("Line %1 of %2, Column %3" | 280 | i18n("Line %1 of %2, Column %3" | ||
286 | , QLocale().toString(position.line() + 1) | 281 | , QLocale().toString(position.line() + 1) | ||
287 | , QLocale().toString(m_view->doc()->lines()) | 282 | , QLocale().toString(m_view->doc()->lines()) | ||
288 | , QLocale().toString(position.column() + 1) | 283 | , QLocale().toString(position.column() + 1) | ||
289 | ) | 284 | ) | ||
290 | ); | 285 | ); | ||
291 | 286 | | |||
292 | else | 287 | else | ||
293 | m_lineColLabel->setText( | 288 | m_cursorPosition->setText( | ||
294 | i18n("Line %1, Column %2" | 289 | i18n("Line %1, Column %2" | ||
295 | , QLocale().toString(position.line() + 1) | 290 | , QLocale().toString(position.line() + 1) | ||
296 | , QLocale().toString(position.column() + 1) | 291 | , QLocale().toString(position.column() + 1) | ||
297 | ) | 292 | ) | ||
298 | ); | 293 | ); | ||
299 | } | 294 | } | ||
300 | 295 | | |||
301 | void KateStatusBar::modifiedChanged() | 296 | void KateStatusBar::modifiedChanged() | ||
302 | { | 297 | { | ||
303 | const bool mod = m_view->doc()->isModified(); | 298 | const bool mod = m_view->doc()->isModified(); | ||
304 | const bool modOnHD = m_view->doc()->isModifiedOnDisc(); | 299 | const bool modOnHD = m_view->doc()->isModifiedOnDisc(); | ||
305 | 300 | | |||
306 | /** | 301 | /** | ||
307 | * combine to modified status, update only if changed | 302 | * combine to modified status, update only if changed | ||
308 | */ | 303 | */ | ||
309 | unsigned int newStatus = (unsigned int)mod | ((unsigned int)modOnHD << 1); | 304 | unsigned int newStatus = (unsigned int)mod | ((unsigned int)modOnHD << 1); | ||
310 | if (m_modifiedStatus == newStatus) | 305 | if (m_modifiedStatus == newStatus) | ||
311 | return; | 306 | return; | ||
312 | 307 | | |||
313 | m_modifiedStatus = newStatus; | 308 | m_modifiedStatus = newStatus; | ||
314 | switch (m_modifiedStatus) { | 309 | switch (m_modifiedStatus) { | ||
315 | case 0x1: | 310 | case 0x1: | ||
316 | m_modifiedLabel->setIcon(QIcon::fromTheme(QStringLiteral("document-save"))); | 311 | m_modified->setIcon(QIcon::fromTheme(QStringLiteral("document-save"))); | ||
317 | m_modifiedLabel->setWhatsThis(i18n("Meaning of current icon: Document was modified since it was loaded")); | 312 | m_modified->setWhatsThis(i18n("Meaning of current icon: Document was modified since it was loaded")); | ||
318 | break; | 313 | break; | ||
319 | 314 | | |||
320 | case 0x2: | 315 | case 0x2: | ||
321 | m_modifiedLabel->setIcon(QIcon::fromTheme(QStringLiteral("dialog-warning"))); | 316 | m_modified->setIcon(QIcon::fromTheme(QStringLiteral("dialog-warning"))); | ||
322 | m_modifiedLabel->setWhatsThis(i18n("Meaning of current icon: Document was modified or deleted by another program")); | 317 | m_modified->setWhatsThis(i18n("Meaning of current icon: Document was modified or deleted by another program")); | ||
323 | break; | 318 | break; | ||
324 | 319 | | |||
325 | case 0x3: | 320 | case 0x3: | ||
326 | m_modifiedLabel->setIcon(QIcon(KIconUtils::addOverlay(QIcon::fromTheme(QStringLiteral("document-save")), | 321 | m_modified->setIcon(QIcon(KIconUtils::addOverlay(QIcon::fromTheme(QStringLiteral("document-save")), | ||
327 | QIcon(QStringLiteral("emblem-important")), Qt::TopLeftCorner))); | 322 | QIcon(QStringLiteral("emblem-important")), Qt::TopLeftCorner))); | ||
328 | m_modifiedLabel->setWhatsThis(QString()); | 323 | m_modified->setWhatsThis(QString()); | ||
329 | break; | 324 | break; | ||
330 | 325 | | |||
331 | default: | 326 | default: | ||
332 | m_modifiedLabel->setIcon(QIcon::fromTheme(QStringLiteral("text-plain"))); | 327 | m_modified->setIcon(QIcon::fromTheme(QStringLiteral("text-plain"))); | ||
333 | m_modifiedLabel->setWhatsThis(i18n("Meaning of current icon: Document was not modified since it was loaded")); | 328 | m_modified->setWhatsThis(i18n("Meaning of current icon: Document was not modified since it was loaded")); | ||
334 | break; | 329 | break; | ||
335 | } | 330 | } | ||
336 | } | 331 | } | ||
337 | 332 | | |||
338 | void KateStatusBar::documentConfigChanged() | 333 | void KateStatusBar::documentConfigChanged() | ||
339 | { | 334 | { | ||
340 | m_encoding->setText(m_view->document()->encoding()); | 335 | m_encoding->setText(m_view->document()->encoding()); | ||
341 | KateDocumentConfig *config = ((KTextEditor::DocumentPrivate *)m_view->document())->config(); | 336 | KateDocumentConfig *config = ((KTextEditor::DocumentPrivate *)m_view->document())->config(); | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |