summaryrefslogtreecommitdiff
path: root/Userland/Applications/TextEditor
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-02 19:01:54 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-02 19:01:54 +0100
commit31e04907b4ec0eadd12001694cc9961752e041ae (patch)
treed866291c3e24bc6f2fe568706d3e0b963a46e715 /Userland/Applications/TextEditor
parentd4f40241f11a7bc40dde6c1f460625ca9e388ef5 (diff)
downloadserenity-31e04907b4ec0eadd12001694cc9961752e041ae.zip
Revert "TextEditor: Add vim status indicators to the statusbar"
This reverts commit bd6d0d229581e830c7a69cdb29252b9f63e0434a.
Diffstat (limited to 'Userland/Applications/TextEditor')
-rw-r--r--Userland/Applications/TextEditor/TextEditorWidget.cpp20
-rw-r--r--Userland/Applications/TextEditor/TextEditorWidget.h3
-rw-r--r--Userland/Applications/TextEditor/TextEditorWindow.gml1
3 files changed, 1 insertions, 23 deletions
diff --git a/Userland/Applications/TextEditor/TextEditorWidget.cpp b/Userland/Applications/TextEditor/TextEditorWidget.cpp
index 1bd7ac19aa..9d31b106f8 100644
--- a/Userland/Applications/TextEditor/TextEditorWidget.cpp
+++ b/Userland/Applications/TextEditor/TextEditorWidget.cpp
@@ -39,13 +39,11 @@
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Button.h>
#include <LibGUI/CppSyntaxHighlighter.h>
-#include <LibGUI/EditingEngine.h>
#include <LibGUI/FilePicker.h>
#include <LibGUI/FontPicker.h>
#include <LibGUI/GMLSyntaxHighlighter.h>
#include <LibGUI/INISyntaxHighlighter.h>
#include <LibGUI/JSSyntaxHighlighter.h>
-#include <LibGUI/Label.h>
#include <LibGUI/Menu.h>
#include <LibGUI/MenuBar.h>
#include <LibGUI/MessageBox.h>
@@ -59,7 +57,6 @@
#include <LibGUI/ToolBarContainer.h>
#include <LibGUI/VimEditingEngine.h>
#include <LibGfx/Font.h>
-#include <LibGfx/FontDatabase.h>
#include <LibMarkdown/Document.h>
#include <LibWeb/OutOfProcessWebView.h>
#include <string.h>
@@ -304,21 +301,6 @@ TextEditorWidget::TextEditorWidget()
m_statusbar = *find_descendant_of_type_named<GUI::StatusBar>("statusbar");
- m_statusbar->label(m_vim_mode_statusbar_index)->set_visible(m_editor->editing_engine()->type() == GUI::EditingEngineType::Vim);
- m_statusbar->label(m_vim_mode_statusbar_index)->set_font(Gfx::FontDatabase::default_bold_font());
-
- m_statusbar->label(m_vim_previous_keys_statusbar_index)->set_visible(m_editor->editing_engine()->type() == GUI::EditingEngineType::Vim);
-
- m_editor->on_vim_statusbar_messages_changed = [this] {
- m_statusbar->set_text(m_vim_mode_statusbar_index, m_editor->vim_mode_statusbar_message());
- m_statusbar->set_text(m_vim_previous_keys_statusbar_index, m_editor->vim_previous_keys_statusbar_message());
- };
-
- m_editor->on_editing_engine_changed = [this]() {
- m_statusbar->label(m_vim_mode_statusbar_index)->set_visible(m_editor->editing_engine()->type() == GUI::EditingEngineType::Vim);
- m_statusbar->label(m_vim_previous_keys_statusbar_index)->set_visible(m_editor->editing_engine()->type() == GUI::EditingEngineType::Vim);
- };
-
m_editor->on_cursor_change = [this] { update_statusbar_cursor_position(); };
m_new_action = GUI::Action::create("New", { Mod_Ctrl, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/new.png"), [this](const GUI::Action&) {
@@ -684,5 +666,5 @@ void TextEditorWidget::update_statusbar_cursor_position()
{
StringBuilder builder;
builder.appendff("Line: {}, Column: {}", m_editor->cursor().line() + 1, m_editor->cursor().column());
- m_statusbar->set_text(m_cursor_position_statusbar_index, builder.to_string());
+ m_statusbar->set_text(builder.to_string());
}
diff --git a/Userland/Applications/TextEditor/TextEditorWidget.h b/Userland/Applications/TextEditor/TextEditorWidget.h
index 28c4a9c3fd..763087b9e4 100644
--- a/Userland/Applications/TextEditor/TextEditorWidget.h
+++ b/Userland/Applications/TextEditor/TextEditorWidget.h
@@ -91,9 +91,6 @@ private:
RefPtr<GUI::Action> m_html_preview_action;
RefPtr<GUI::StatusBar> m_statusbar;
- const int m_cursor_position_statusbar_index = 0;
- const int m_vim_mode_statusbar_index = 1;
- const int m_vim_previous_keys_statusbar_index = 2;
RefPtr<GUI::TextBox> m_find_textbox;
RefPtr<GUI::TextBox> m_replace_textbox;
diff --git a/Userland/Applications/TextEditor/TextEditorWindow.gml b/Userland/Applications/TextEditor/TextEditorWindow.gml
index b13865f697..433d01abff 100644
--- a/Userland/Applications/TextEditor/TextEditorWindow.gml
+++ b/Userland/Applications/TextEditor/TextEditorWindow.gml
@@ -84,6 +84,5 @@
@GUI::StatusBar {
name: "statusbar"
- label_count: 3
}
}