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
b25e4814
Commit
b25e4814
authored
5 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Clean up unused avatar functions
parent
31a83c51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/TopRoomBar.cpp
+0
-7
0 additions, 7 deletions
src/TopRoomBar.cpp
src/TopRoomBar.h
+0
-2
0 additions, 2 deletions
src/TopRoomBar.h
src/ui/Avatar.cpp
+4
-15
4 additions, 15 deletions
src/ui/Avatar.cpp
src/ui/Avatar.h
+0
-3
0 additions, 3 deletions
src/ui/Avatar.h
src/ui/Theme.h
+0
-1
0 additions, 1 deletion
src/ui/Theme.h
with
4 additions
and
28 deletions
src/TopRoomBar.cpp
+
0
−
7
View file @
b25e4814
...
...
@@ -196,13 +196,6 @@ TopRoomBar::updateRoomAvatar(const QString &avatar_image)
update
();
}
void
TopRoomBar
::
updateRoomAvatar
(
const
QIcon
&
icon
)
{
avatar_
->
setIcon
(
icon
);
update
();
}
void
TopRoomBar
::
updateRoomName
(
const
QString
&
name
)
{
...
...
This diff is collapsed.
Click to expand it.
src/TopRoomBar.h
+
0
−
2
View file @
b25e4814
...
...
@@ -29,7 +29,6 @@ class OverlayModal;
class
QPainter
;
class
QLabel
;
class
QIcon
;
class
QHBoxLayout
;
class
QVBoxLayout
;
...
...
@@ -43,7 +42,6 @@ public:
TopRoomBar
(
QWidget
*
parent
=
nullptr
);
void
updateRoomAvatar
(
const
QString
&
avatar_image
);
void
updateRoomAvatar
(
const
QIcon
&
icon
);
void
updateRoomName
(
const
QString
&
name
);
void
updateRoomTopic
(
QString
topic
);
void
updateRoomAvatarFromName
(
const
QString
&
name
);
...
...
This diff is collapsed.
Click to expand it.
src/ui/Avatar.cpp
+
4
−
15
View file @
b25e4814
...
...
@@ -72,6 +72,8 @@ Avatar::setImage(const QString &avatar_url)
static_cast
<
int
>
(
size_
*
pixmap_
.
devicePixelRatio
()),
this
,
[
this
](
QPixmap
pm
)
{
if
(
pm
.
isNull
())
return
;
type_
=
ui
::
AvatarType
::
Image
;
pixmap_
=
pm
;
update
();
...
...
@@ -88,20 +90,14 @@ Avatar::setImage(const QString &room, const QString &user)
static_cast
<
int
>
(
size_
*
pixmap_
.
devicePixelRatio
()),
this
,
[
this
](
QPixmap
pm
)
{
if
(
pm
.
isNull
())
return
;
type_
=
ui
::
AvatarType
::
Image
;
pixmap_
=
pm
;
update
();
});
}
void
Avatar
::
setIcon
(
const
QIcon
&
icon
)
{
icon_
=
icon
;
type_
=
ui
::
AvatarType
::
Icon
;
update
();
}
void
Avatar
::
paintEvent
(
QPaintEvent
*
)
{
...
...
@@ -135,13 +131,6 @@ Avatar::paintEvent(QPaintEvent *)
}
switch
(
type_
)
{
case
ui
::
AvatarType
::
Icon
:
{
icon_
.
paint
(
&
painter
,
QRect
((
width
()
-
hs
)
/
2
,
(
height
()
-
hs
)
/
2
,
hs
,
hs
),
Qt
::
AlignCenter
,
QIcon
::
Normal
);
break
;
}
case
ui
::
AvatarType
::
Image
:
{
QPainterPath
ppath
;
...
...
This diff is collapsed.
Click to expand it.
src/ui/Avatar.h
+
0
−
3
View file @
b25e4814
#pragma once
#include
<QIcon>
#include
<QImage>
#include
<QPixmap>
#include
<QWidget>
...
...
@@ -18,7 +17,6 @@ public:
explicit
Avatar
(
QWidget
*
parent
=
nullptr
,
int
size
=
ui
::
AvatarSize
);
void
setBackgroundColor
(
const
QColor
&
color
);
void
setIcon
(
const
QIcon
&
icon
);
void
setImage
(
const
QString
&
avatar_url
);
void
setImage
(
const
QString
&
room
,
const
QString
&
user
);
void
setLetter
(
const
QString
&
letter
);
...
...
@@ -40,7 +38,6 @@ private:
QString
avatar_url_
,
room_
,
user_
;
QColor
background_color_
;
QColor
text_color_
;
QIcon
icon_
;
QPixmap
pixmap_
;
int
size_
;
};
This diff is collapsed.
Click to expand it.
src/ui/Theme.h
+
0
−
1
View file @
b25e4814
...
...
@@ -7,7 +7,6 @@
namespace
ui
{
enum
class
AvatarType
{
Icon
,
Image
,
Letter
};
...
...
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