forked from ic005k/Xiasl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminidialog.cpp
56 lines (39 loc) · 1.43 KB
/
minidialog.cpp
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
#include "minidialog.h"
#include <QLabel>
#include "ui_minidialog.h"
extern QsciScintilla* miniDlgEdit;
extern miniDialog* miniDlg;
extern int red;
ZoomEditor::ZoomEditor(QWidget* parent) : QsciScintilla(parent) {}
miniDialog::miniDialog(QWidget* parent)
: QDialog(parent), ui(new Ui::miniDialog) {
ui->setupUi(this);
setWindowFlags(Qt::FramelessWindowHint);
ui->gridLayout_2->setMargin(0);
miniDlgEdit = new ZoomEditor(this);
ui->gridLayout->addWidget(miniDlgEdit);
QLabel *lblTip = new QLabel(miniDlgEdit);
lblTip->setText(tr("Left click: Position to the current line.") + "\n"
+ tr("Right click: Copy the current line."));
QColor color;
if (red > 55)
color.setRgb(245, 245, 245, 255);
else
color.setRgb(50, 50, 50, 255);
miniDlgEdit->setPaper(color);
miniDlgEdit->setContextMenuPolicy(Qt::NoContextMenu);
miniDlgEdit->setMarginWidth(0, 0);
miniDlgEdit->setMargins(0);
miniDlgEdit->setReadOnly(1);
miniDlgEdit->SendScintilla(QsciScintillaBase::SCI_SETCURSOR, 0, 7);
//水平滚动棒
miniDlgEdit->SendScintilla(QsciScintilla::SCI_SETSCROLLWIDTH, -1);
miniDlgEdit->SendScintilla(QsciScintilla::SCI_SETSCROLLWIDTHTRACKING, false);
miniDlgEdit->horizontalScrollBar()->setHidden(true);
miniDlgEdit->verticalScrollBar()->setHidden(true);
}
miniDialog::~miniDialog() { delete ui; }
void ZoomEditor::mouseMoveEvent(QMouseEvent* event) {
Q_UNUSED(event);
miniDlg->close();
}