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
231f95a6
Commit
231f95a6
authored
Mar 18, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
Mar 18, 2021
Browse files
Use KColorScheme shades for changed lines color
parent
7f029368
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/project/comarebranchesview.cpp
View file @
231f95a6
...
...
@@ -7,6 +7,7 @@
#include "kateprojectpluginview.h"
#include "kateprojectworker.h"
#include <KColorScheme>
#include <QPainter>
#include <QProcess>
#include <QStyledItemDelegate>
...
...
@@ -56,7 +57,7 @@ public:
// don't draw over icon
r
.
setX
(
r
.
x
()
+
option
.
decorationSize
.
width
()
+
5
);
auto
&
fm
=
options
.
fontMetrics
;
const
QFontMetrics
&
fm
=
options
.
fontMetrics
;
// adds width
int
aw
=
fm
.
horizontalAdvance
(
adds
);
...
...
@@ -72,8 +73,9 @@ public:
painter
->
drawText
(
r
,
Qt
::
AlignVCenter
,
filename
);
static
constexpr
auto
red
=
QColor
(
237
,
21
,
21
);
// Breeze Danger Red
static
constexpr
auto
green
=
QColor
(
17
,
209
,
27
);
// Breeze Verdant Green
KColorScheme
c
;
const
auto
red
=
c
.
shade
(
c
.
foreground
(
KColorScheme
::
NegativeText
).
color
(),
KColorScheme
::
MidlightShade
,
1
);
const
auto
green
=
c
.
shade
(
c
.
foreground
(
KColorScheme
::
PositiveText
).
color
(),
KColorScheme
::
MidlightShade
,
1
);
r
.
setX
(
r
.
x
()
+
totalw
);
painter
->
setPen
(
green
);
...
...
addons/project/gitwidget.cpp
View file @
231f95a6
...
...
@@ -15,6 +15,7 @@
#include "pushpulldialog.h"
#include "stashdialog.h"
#include <KColorScheme>
#include <QContextMenuEvent>
#include <QCoreApplication>
#include <QDebug>
...
...
@@ -96,8 +97,9 @@ public:
int
mw
=
r
.
width
()
-
(
ha
+
hs
+
hS
);
r
.
setX
(
r
.
x
()
+
mw
);
static
constexpr
auto
red
=
QColor
(
237
,
21
,
21
);
// Breeze Danger Red
static
constexpr
auto
green
=
QColor
(
17
,
209
,
27
);
// Breeze Verdant Green
KColorScheme
c
;
const
auto
red
=
c
.
shade
(
c
.
foreground
(
KColorScheme
::
NegativeText
).
color
(),
KColorScheme
::
MidlightShade
,
1
);
const
auto
green
=
c
.
shade
(
c
.
foreground
(
KColorScheme
::
PositiveText
).
color
(),
KColorScheme
::
MidlightShade
,
1
);
painter
->
setPen
(
green
);
painter
->
drawText
(
r
,
Qt
::
AlignVCenter
,
add
);
...
...
Waqar Ahmed
@waqar
mentioned in commit
2c10388b
·
Mar 20, 2021
mentioned in commit
2c10388b
mentioned in commit 2c10388bd41293948c31deed42117ff41728f01d
Toggle commit list
Write
Preview
Markdown
is supported
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