mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 22:09:52 +08:00
49 lines
868 B
C++
49 lines
868 B
C++
#ifndef VVIMINDICATOR_H
|
|
#define VVIMINDICATOR_H
|
|
|
|
#include <QWidget>
|
|
#include <QPointer>
|
|
#include "utils/vvim.h"
|
|
|
|
class QLabel;
|
|
class VButtonWithWidget;
|
|
class QKeyEvent;
|
|
class QFocusEvent;
|
|
|
|
class VVimIndicator : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit VVimIndicator(QWidget *p_parent = 0);
|
|
|
|
// Update indicator according to @p_vim.
|
|
void update(const VVim *p_vim);
|
|
|
|
private slots:
|
|
void updateRegistersTree(QWidget *p_widget);
|
|
|
|
void updateMarksTree(QWidget *p_widget);
|
|
|
|
private:
|
|
void setupUI();
|
|
|
|
QString modeToString(VimMode p_mode) const;
|
|
|
|
// Indicate the mode.
|
|
QLabel *m_modeLabel;
|
|
|
|
// Indicate the registers.
|
|
VButtonWithWidget *m_regBtn;
|
|
|
|
// Indicate the marks.
|
|
VButtonWithWidget *m_markBtn;
|
|
|
|
// Indicate the pending keys.
|
|
QLabel *m_keyLabel;
|
|
|
|
QPointer<VVim> m_vim;
|
|
};
|
|
|
|
#endif // VVIMINDICATOR_H
|