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
PIM
KNotes
Commits
fe123f3f
Commit
fe123f3f
authored
Apr 03, 2022
by
Laurent Montel
😁
Browse files
Update color when theme changed
parent
2d6c1954
Pipeline
#158687
passed with stage
in 1 minute and 13 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/apps/knotesakonaditray.h
View file @
fe123f3f
...
...
@@ -15,9 +15,9 @@ public:
~
KNotesAkonadiTray
()
override
;
void
updateNumberOfNotes
(
int
number
);
void
slotGeneralPaletteChanged
();
private:
void
slotGeneralPaletteChanged
();
const
QIcon
mIcon
;
QColor
mTextColor
;
};
...
...
src/apps/knotesapp.cpp
View file @
fe123f3f
...
...
@@ -212,6 +212,9 @@ KNotesApp::KNotesApp(QWidget *parent)
QGuiApplication
::
setFallbackSessionManagementEnabled
(
false
);
updateNoteActions
();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
connect
(
qApp
,
&
QGuiApplication
::
paletteChanged
,
this
,
&
KNotesApp
::
slotGeneralPaletteChanged
);
#endif
}
KNotesApp
::~
KNotesApp
()
...
...
@@ -227,6 +230,22 @@ KNotesApp::~KNotesApp()
m_publisher
=
nullptr
;
}
void
KNotesApp
::
slotGeneralPaletteChanged
()
{
mTray
->
slotGeneralPaletteChanged
();
mTray
->
updateNumberOfNotes
(
mNotes
.
count
());
}
bool
KNotesApp
::
event
(
QEvent
*
e
)
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if
(
e
->
type
()
==
QEvent
::
ApplicationPaletteChange
)
{
slotGeneralPaletteChanged
();
}
#endif
return
QWidget
::
event
(
e
);
}
void
KNotesApp
::
slotDeleteSelectedNotes
()
{
QPointer
<
KNoteDeleteSelectedNotesDialog
>
dlg
=
new
KNoteDeleteSelectedNotesDialog
(
this
);
...
...
src/apps/knotesapp.h
View file @
fe123f3f
...
...
@@ -52,6 +52,9 @@ public Q_SLOTS:
void
setName
(
Akonadi
::
Item
::
Id
id
,
const
QString
&
newName
);
void
setText
(
Akonadi
::
Item
::
Id
id
,
const
QString
&
newText
);
protected:
Q_REQUIRED_RESULT
bool
event
(
QEvent
*
e
)
override
;
private:
void
showNote
(
KNote
*
note
)
const
;
...
...
@@ -82,6 +85,7 @@ private Q_SLOTS:
void
newNoteFromTextFile
();
private:
void
slotGeneralPaletteChanged
();
void
saveNotes
(
bool
force
=
false
,
bool
sync
=
false
);
void
updateNetworkListener
();
void
updateSystray
();
...
...
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