Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
6e0ae807
Commit
6e0ae807
authored
7 years ago
by
Konstantinos Sideris
Browse files
Options
Downloads
Patches
Plain Diff
Update badge counter only on change
parent
0c0ac68b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/TrayIcon.h
+1
-1
1 addition, 1 deletion
include/TrayIcon.h
src/TimelineView.cc
+2
-4
2 additions, 4 deletions
src/TimelineView.cc
src/TrayIcon.cc
+11
-7
11 additions, 7 deletions
src/TrayIcon.cc
with
14 additions
and
12 deletions
include/TrayIcon.h
+
1
−
1
View file @
6e0ae807
...
...
@@ -33,7 +33,7 @@ public:
virtual
void
paint
(
QPainter
*
p
,
const
QRect
&
rect
,
QIcon
::
Mode
mode
,
QIcon
::
State
state
);
virtual
QIconEngine
*
clone
()
const
;
virtual
QList
<
QSize
>
availableSizes
(
QIcon
::
Mode
mode
,
QIcon
::
State
state
)
const
;
virtual
QPixmap
pixmap
(
const
QSize
&
size
,
QIcon
::
Mode
mode
,
QIcon
::
State
state
);
virtual
QPixmap
pixmap
(
const
QSize
&
size
,
QIcon
::
Mode
mode
,
QIcon
::
State
state
);
int
msgCount
=
0
;
...
...
This diff is collapsed.
Click to expand it.
src/TimelineView.cc
+
2
−
4
View file @
6e0ae807
...
...
@@ -380,14 +380,12 @@ TimelineView::init()
scrollbar_
=
new
ScrollBar
(
scroll_area_
);
scroll_area_
->
setVerticalScrollBar
(
scrollbar_
);
scroll_widget_
=
new
QWidget
();
scroll_widget_
=
new
QWidget
(
this
);
scroll_layout_
=
new
QVBoxLayout
();
scroll_layout_
=
new
QVBoxLayout
(
scroll_widget_
);
scroll_layout_
->
addStretch
(
1
);
scroll_layout_
->
setSpacing
(
0
);
scroll_widget_
->
setLayout
(
scroll_layout_
);
scroll_area_
->
setWidget
(
scroll_widget_
);
top_layout_
->
addWidget
(
scroll_area_
);
...
...
This diff is collapsed.
Click to expand it.
src/TrayIcon.cc
+
11
−
7
View file @
6e0ae807
...
...
@@ -16,8 +16,8 @@
*/
#include
<QApplication>
#include
<QTimer>
#include
<QList>
#include
<QTimer>
#include
"TrayIcon.h"
...
...
@@ -89,7 +89,7 @@ MsgCountComposedIcon::availableSizes(QIcon::Mode mode, QIcon::State state) const
}
QPixmap
MsgCountComposedIcon
::
pixmap
(
const
QSize
&
size
,
QIcon
::
Mode
mode
,
QIcon
::
State
state
)
MsgCountComposedIcon
::
pixmap
(
const
QSize
&
size
,
QIcon
::
Mode
mode
,
QIcon
::
State
state
)
{
QImage
img
(
size
,
QImage
::
Format_ARGB32
);
img
.
fill
(
qRgba
(
0
,
0
,
0
,
0
));
...
...
@@ -132,15 +132,19 @@ TrayIcon::setUnreadCount(int count)
{
// Use the native badge counter in MacOS.
#if defined(Q_OS_MAC)
if
(
count
==
0
)
QtMac
::
setBadgeLabelText
(
""
);
else
QtMac
::
setBadgeLabelText
(
QString
::
number
(
count
));
auto
labelText
=
count
==
0
?
""
:
QString
::
number
(
count
);
if
(
labelText
==
QtMac
::
badgeLabelText
())
return
;
QtMac
::
setBadgeLabelText
(
labelText
);
#elif defined(Q_OS_WIN)
// FIXME: Find a way to use Windows apis for the badge counter (if any).
#else
if
(
count
==
icon_
->
msgCount
)
return
;
// Custom drawing on Linux.
// FIXME: It doesn't seem to work on KDE.
MsgCountComposedIcon
*
tmp
=
static_cast
<
MsgCountComposedIcon
*>
(
icon_
->
clone
());
tmp
->
msgCount
=
count
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment