Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
d8ef9982
Commit
d8ef9982
authored
Mar 09, 2021
by
Waqar Ahmed
Browse files
Use editor colors in build plugin output textedit
parent
0405cc09
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/katebuild-plugin/plugin_katebuild.cpp
View file @
d8ef9982
...
...
@@ -42,16 +42,15 @@
#include
<KActionCollection>
#include
<KTextEditor/Application>
#include
<KTextEditor/ConfigInterface>
#include
<K
XMLGUIFactory
>
#include
<K
MessageBox
>
#include
<K
TextEditor/Editor
>
#include
<KTextEditor/MarkInterface>
#include
<K
TextEditor/MovingInterface
>
#include
<KAboutData>
#include
<KLocalizedString>
#include
<KMessageBox>
#include
<KPluginFactory>
#include
<ktexteditor/markinterface.h>
#include
<ktexteditor/movinginterface.h>
#include
<KXMLGUIFactory>
#include
"SelectTargetView.h"
...
...
@@ -191,6 +190,22 @@ KateBuildView::KateBuildView(KTextEditor::Plugin *plugin, KTextEditor::MainWindo
m_buildUi
.
plainTextEdit
->
setReadOnly
(
true
);
slotDisplayMode
(
FullOutput
);
auto
updateEditorColors
=
[
this
](
KTextEditor
::
Editor
*
e
)
{
if
(
!
e
)
return
;
auto
theme
=
e
->
theme
();
auto
bg
=
QColor
::
fromRgba
(
theme
.
editorColor
(
KSyntaxHighlighting
::
Theme
::
EditorColorRole
::
BackgroundColor
));
auto
fg
=
QColor
::
fromRgba
(
theme
.
textColor
(
KSyntaxHighlighting
::
Theme
::
TextStyle
::
Normal
));
auto
sel
=
QColor
::
fromRgba
(
theme
.
editorColor
(
KSyntaxHighlighting
::
Theme
::
EditorColorRole
::
TextSelection
));
auto
pal
=
m_buildUi
.
plainTextEdit
->
palette
();
pal
.
setColor
(
QPalette
::
Base
,
bg
);
pal
.
setColor
(
QPalette
::
Text
,
fg
);
pal
.
setColor
(
QPalette
::
Highlight
,
sel
);
pal
.
setColor
(
QPalette
::
HighlightedText
,
fg
);
m_buildUi
.
plainTextEdit
->
setPalette
(
pal
);
};
connect
(
KTextEditor
::
Editor
::
instance
(),
&
KTextEditor
::
Editor
::
configChanged
,
this
,
updateEditorColors
);
connect
(
m_buildUi
.
displayModeSlider
,
&
QSlider
::
valueChanged
,
this
,
&
KateBuildView
::
slotDisplayMode
);
connect
(
m_buildUi
.
buildAgainButton
,
&
QPushButton
::
clicked
,
this
,
&
KateBuildView
::
slotBuildPreviousTarget
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment