Browse Source

HexEditor: Show status tips in Statusbar

Sam Atkins 2 năm trước cách đây
mục cha
commit
aa7346d23e
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      Userland/Applications/HexEditor/HexEditorWidget.cpp

+ 7 - 0
Userland/Applications/HexEditor/HexEditorWidget.cpp

@@ -272,6 +272,13 @@ HexEditorWidget::HexEditorWidget()
     m_statusbar->segment(0).set_action(*m_goto_offset_action);
 
     m_editor->set_focus(true);
+
+    GUI::Application::the()->on_action_enter = [this](GUI::Action& action) {
+        m_statusbar->set_override_text(action.status_tip());
+    };
+    GUI::Application::the()->on_action_leave = [this](GUI::Action&) {
+        m_statusbar->set_override_text({});
+    };
 }
 
 void HexEditorWidget::update_inspector_values(size_t position)