Changeset View
Changeset View
Standalone View
Standalone View
src/view/katestatusbar.h
Show All 36 Lines | |||||
37 | { | 37 | { | ||
38 | Q_OBJECT | 38 | Q_OBJECT | ||
39 | public: | 39 | public: | ||
40 | explicit KateStatusBarOpenUpMenu(QWidget *parent); | 40 | explicit KateStatusBarOpenUpMenu(QWidget *parent); | ||
41 | ~KateStatusBarOpenUpMenu() override; | 41 | ~KateStatusBarOpenUpMenu() override; | ||
42 | void setVisible(bool) override; | 42 | void setVisible(bool) override; | ||
43 | }; | 43 | }; | ||
44 | 44 | | |||
45 | /** | ||||
46 | * For convenience an own button class to ensure a unified look&feel. | ||||
47 | * Should someone dislike the QPushButton at all could he change it | ||||
48 | * to a e.g. QLabel subclass | ||||
49 | */ | ||||
50 | class StatusBarButton: public QPushButton | ||||
51 | { | ||||
52 | Q_OBJECT | ||||
53 | public: | ||||
54 | explicit StatusBarButton(KateStatusBar *parent, const QString &text = QString()); | ||||
55 | ~StatusBarButton() override; | ||||
56 | }; | ||||
57 | | ||||
45 | class KateStatusBar : public KateViewBarWidget | 58 | class KateStatusBar : public KateViewBarWidget | ||
46 | { | 59 | { | ||
47 | Q_OBJECT | 60 | Q_OBJECT | ||
61 | friend class StatusBarButton; | ||||
48 | 62 | | |||
49 | public: | 63 | public: | ||
50 | explicit KateStatusBar(KTextEditor::ViewPrivate *view); | 64 | explicit KateStatusBar(KTextEditor::ViewPrivate *view); | ||
51 | 65 | | |||
52 | public Q_SLOTS: | 66 | public Q_SLOTS: | ||
53 | void updateStatus(); | 67 | void updateStatus(); | ||
54 | 68 | | |||
55 | void viewModeChanged(); | 69 | void viewModeChanged(); | ||
Show All 15 Lines | |||||
71 | void configChanged(); | 85 | void configChanged(); | ||
72 | 86 | | |||
73 | protected: | 87 | protected: | ||
74 | bool eventFilter(QObject *obj, QEvent *event) override; | 88 | bool eventFilter(QObject *obj, QEvent *event) override; | ||
75 | void contextMenuEvent(QContextMenuEvent *event) override; | 89 | void contextMenuEvent(QContextMenuEvent *event) override; | ||
76 | 90 | | |||
77 | private: | 91 | private: | ||
78 | KTextEditor::ViewPrivate *const m_view; | 92 | KTextEditor::ViewPrivate *const m_view; | ||
79 | QLabel *m_lineColLabel; | 93 | StatusBarButton *m_cursorPosition = nullptr; | ||
80 | QLabel *m_wordCountLabel; | 94 | QLabel *m_wordCountLabel; | ||
81 | QToolButton *m_modifiedLabel; | 95 | StatusBarButton *m_modified = nullptr; | ||
82 | QLabel *m_insertModeLabel; | 96 | StatusBarButton *m_inputMode = nullptr; | ||
83 | QPushButton *m_mode; | 97 | StatusBarButton *m_mode = nullptr; | ||
84 | QPushButton *m_encoding; | 98 | StatusBarButton *m_encoding = nullptr; | ||
85 | QPushButton *m_tabsIndent; | 99 | StatusBarButton *m_tabsIndent = nullptr; | ||
86 | KLocalizedString m_spacesOnly; | 100 | KLocalizedString m_spacesOnly; | ||
87 | KLocalizedString m_tabsOnly; | 101 | KLocalizedString m_tabsOnly; | ||
88 | KLocalizedString m_tabSpacesMixed; | 102 | KLocalizedString m_tabSpacesMixed; | ||
89 | KLocalizedString m_spacesOnlyShowTabs; | 103 | KLocalizedString m_spacesOnlyShowTabs; | ||
90 | QMenu *m_indentSettingsMenu; | 104 | QMenu *m_indentSettingsMenu; | ||
91 | unsigned int m_modifiedStatus; | 105 | unsigned int m_modifiedStatus; | ||
92 | unsigned int m_selectionMode; | 106 | unsigned int m_selectionMode; | ||
93 | QActionGroup *m_tabGroup; | 107 | QActionGroup *m_tabGroup; | ||
Show All 19 Lines |