Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F619627
ReadOnlyPlainTextEdit.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
807 B
Referenced Files
None
Subscribers
None
ReadOnlyPlainTextEdit.cpp
View Options
#include
"ReadOnlyPlainTextEdit.h"
#include
"main.h"
#include
"common/misc.h"
#include
"ApplicationGlobal.h"
#include
<QPainter>
ReadOnlyPlainTextEdit
::
ReadOnlyPlainTextEdit
(
QWidget
*
parent
)
:
QPlainTextEdit
(
parent
)
{
setReadOnly
(
true
);
int
r
=
global
->
panel_bg_color
.
red
();
int
g
=
global
->
panel_bg_color
.
green
();
int
b
=
global
->
panel_bg_color
.
blue
();
r
=
r
*
4
/
5
;
g
=
g
*
4
/
5
;
b
=
b
*
4
/
5
;
char
border
[
200
];
sprintf
(
border
,
"1px solid #%02x%02x%02x"
,
r
,
g
,
b
);
QString
ss
=
"* { background: transparent; border: %1; }"
;
setStyleSheet
(
ss
.
arg
(
border
));
}
void
ReadOnlyPlainTextEdit
::
mousePressEvent
(
QMouseEvent
*
event
)
{
// disable drag and drop editting
QTextCursor
c
=
textCursor
();
c
.
setPosition
(
c
.
selectionEnd
());
setTextCursor
(
c
);
QPlainTextEdit
::
mousePressEvent
(
event
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sat, Nov 14, 4:59 PM (10 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
121534
Default Alt Text
ReadOnlyPlainTextEdit.cpp (807 B)
Attached To
Mode
R77 Guitar
Attached
Detach File
Event Timeline