Skip to content

Commit 2e8cbfa

Browse files
Working avatar image (fix) (#21)
Adds a few changes that missed being committed to PR #20.
1 parent f549d3a commit 2e8cbfa

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

src/api.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ MarketplaceApi::MarketplaceApi()
6060
}
6161
}
6262

63+
void MarketplaceApi::logOut()
64+
{
65+
_loggedIn = false;
66+
_hasAvatar = false;
67+
_avatarReady = false;
68+
_avatarDownloading = false;
69+
_avatarPath = "";
70+
_firstName = "";
71+
_lastName = "";
72+
}
73+
6374
MarketplaceApi *MarketplaceApi::getInstance()
6475
{
6576
if (_api == nullptr) {

src/api.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class MarketplaceApi : public QObject {
5353
uint64_t chunkSize, uint64_t downloaded);
5454
static void AvatarDownloadComplete(std::string filename, void* data);
5555
void setUserDetails(nlohmann::json &data);
56+
void logOut();
5657

5758
signals:
5859
void AvatarDownloaded();

src/elgato-cloud-data.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ void ElgatoCloud::LogOut()
282282
_refreshTokenExpiration = 0;
283283
_SaveState();
284284
loggedIn = false;
285+
auto api = MarketplaceApi::getInstance();
286+
api->logOut();
287+
285288
if (mainWindowOpen && window) {
286289
window->setLoggedIn();
287290
}

src/elgato-cloud-window.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ AvatarImage::AvatarImage(QWidget* parent) : QWidget(parent)
101101
QPixmap avatarPixmap = _setupImage(imagePath);
102102

103103
auto layout = new QVBoxLayout(this);
104-
layout->setContentsMargins(1, 1, 1, 1);
104+
layout->setContentsMargins(0, 0, 0, 0);
105105
layout->setSpacing(0);
106106
_avatarImg = new QLabel(this);
107107
_avatarImg->setPixmap(avatarPixmap);
@@ -129,8 +129,8 @@ void AvatarImage::update()
129129

130130
QPixmap AvatarImage::_setupImage(std::string imagePath)
131131
{
132-
int targetHeight = 38;
133-
int cornerRadius = 19;
132+
int targetHeight = 40;
133+
int cornerRadius = 20;
134134
QPixmap img;
135135

136136
if (imagePath != "")

0 commit comments

Comments
 (0)