-
Notifications
You must be signed in to change notification settings - Fork 0
/
footerbararea.h
97 lines (81 loc) · 2.42 KB
/
footerbararea.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef FOOTERBARAREA_H
#define FOOTERBARAREA_H
#include <QObject>
#include <QWidget>
#include <QComboBox>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLineEdit>
#include <QLabel>
#include <QPushButton>
#include "assetmanager.h"
#include "codeeditor.h"
class QWidget;
class QPaintEvent;
class QResizeEvent;
class FooterBarArea : public QWidget
{
Q_OBJECT
public:
FooterBarArea(CodeEditor *editor);
~FooterBarArea();
QComboBox * comboBox;
QLineEdit * searchBox;
QLabel * filePathLabel;
QPushButton * resizeButton;
QPushButton * replaceButton;
QPushButton * moreButton;
QPushButton * searchButton;
QLineEdit * replaceBox;
QLabel * cursorInfoLabel;
void setCursorInfoText(int charIndex, int lineIndex);
protected:
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE {
codeEditor->footerBarAreaPaintEvent(event);
}
private:
CodeEditor *codeEditor;
QStringList languagesSupported;
int footerHeight;
int height;
int heightCollapsed;
int heightExpanded;
bool isExpanded;
QHBoxLayout *mainLayout;
QVBoxLayout *layout;
QVBoxLayout *layout2;
QHBoxLayout *layout2H1;
QHBoxLayout *layout2H;
QVBoxLayout *layout3;
QHBoxLayout *layout3H;
private slots:
void comboChanged(int index)
{
// if the combo box isnt set to 'None'
if(index < languagesSupported.count())
{
// if that rule isnt already applied
if(codeEditor->syntaxHighlighter->ruleSet != NULL)
{
if(codeEditor->syntaxHighlighter->ruleSet->fileName != languagesSupported[index])
codeEditor->changeLanguageSupport(languagesSupported[index]);
} else
{
codeEditor->changeLanguageSupport(languagesSupported[index]);
}
} else
{
codeEditor->changeLanguageSupport(NULL);
}
}
void searchButtonClicked()
{
QString text = searchBox->text();
QRegExp exp = QRegExp(text);
codeEditor->highlightText(exp);
}
void codeCursorChanged();
void toggleResize();
void replaceMatchedText();
};
#endif // FOOTERBARAREA_H