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
ff39ac3a
Commit
ff39ac3a
authored
Jan 26, 2022
by
Waqar Ahmed
Browse files
Don't create KColorScheme uselessly all the time
parent
8ff8f6b7
Pipeline
#129036
passed with stage
in 3 minutes and 27 seconds
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
addons/filetree/katefiletreemodel.cpp
View file @
ff39ac3a
...
...
@@ -368,6 +368,7 @@ KateFileTreeModel::KateFileTreeModel(QObject *p)
const
QColor
bg
=
colors
.
background
().
color
();
m_editShade
=
KColorUtils
::
tint
(
bg
,
colors
.
foreground
(
KColorScheme
::
ActiveText
).
color
(),
0.5
);
m_viewShade
=
KColorUtils
::
tint
(
bg
,
colors
.
foreground
(
KColorScheme
::
VisitedText
).
color
(),
0.5
);
m_inactiveDocColor
=
colors
.
foreground
(
KColorScheme
::
InactiveText
).
color
();
m_shadingEnabled
=
true
;
m_listMode
=
false
;
...
...
@@ -375,6 +376,7 @@ KateFileTreeModel::KateFileTreeModel(QObject *p)
// ensure palette change updates the colors properly
connect
(
qGuiApp
,
&
QGuiApplication
::
paletteChanged
,
this
,
[
this
]()
{
m_inactiveDocColor
=
KColorScheme
(
QPalette
::
Active
).
foreground
(
KColorScheme
::
InactiveText
).
color
();
updateBackgrounds
(
true
);
});
}
...
...
@@ -551,9 +553,8 @@ QVariant KateFileTreeModel::data(const QModelIndex &index, int role) const
}
case
Qt
::
ForegroundRole
:
{
const
KColorScheme
colors
(
QPalette
::
Active
);
if
(
!
item
->
flag
(
ProxyItem
::
Dir
)
&&
(
!
item
->
doc
()
||
item
->
doc
()
->
openingError
()))
{
return
colors
.
foreground
(
KColorScheme
::
InactiveText
).
c
olor
()
;
return
m_inactiveDocC
olor
;
}
}
break
;
...
...
addons/filetree/katefiletreemodel.h
View file @
ff39ac3a
...
...
@@ -110,6 +110,7 @@ private:
QColor
m_editShade
;
QColor
m_viewShade
;
QColor
m_inactiveDocColor
;
bool
m_listMode
;
};
...
...
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