Skip to content
GitLab
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
c2526a27
Commit
c2526a27
authored
Oct 20, 2022
by
Waqar Ahmed
Browse files
Urlbar: adjust label for Untitled docs
parent
fbe16066
Pipeline
#251953
passed with stage
in 9 minutes and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apps/lib/kateurlbar.cpp
View file @
c2526a27
...
...
@@ -1162,6 +1162,16 @@ void KateUrlBar::setupLayout()
layout
->
setContentsMargins
({});
layout
->
setSpacing
(
0
);
layout
->
addWidget
(
m_stack
);
auto
updatePalette
=
[
this
]()
{
auto
pal
=
m_untitledDocLabel
->
palette
();
auto
textColor
=
pal
.
text
().
color
();
textColor
=
textColor
.
lightness
()
>
127
?
textColor
.
darker
(
150
)
:
textColor
.
lighter
(
150
);
pal
.
setBrush
(
QPalette
::
Active
,
QPalette
::
WindowText
,
textColor
);
m_untitledDocLabel
->
setPalette
(
pal
);
};
updatePalette
();
connect
(
qApp
,
&
QApplication
::
paletteChanged
,
this
,
updatePalette
,
Qt
::
QueuedConnection
);
}
void
KateUrlBar
::
onViewChanged
(
KTextEditor
::
View
*
v
)
...
...
@@ -1175,7 +1185,8 @@ void KateUrlBar::onViewChanged(KTextEditor::View *v)
if
(
!
v
)
{
updateForDocument
(
nullptr
);
m_untitledDocLabel
->
setText
(
i18n
(
"Untitled"
));
// no view => show nothing
m_untitledDocLabel
->
setText
({});
m_stack
->
setCurrentWidget
(
m_untitledDocLabel
);
return
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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