Basic header and footer of room list
This commit is contained in:
parent
39a43ad4ab
commit
567fe81ad7
19 changed files with 385 additions and 175 deletions
|
|
@ -7,29 +7,50 @@
|
|||
#include <QDesktopServices>
|
||||
#include <QUrl>
|
||||
|
||||
#include "Cache_p.h"
|
||||
#include "ChatPage.h"
|
||||
#include "Logging.h"
|
||||
#include "UserSettingsPage.h"
|
||||
#include "Utils.h"
|
||||
|
||||
Nheko::Nheko()
|
||||
{
|
||||
connect(
|
||||
UserSettings::instance().get(), &UserSettings::themeChanged, this, &Nheko::colorsChanged);
|
||||
connect(ChatPage::instance(), &ChatPage::contentLoaded, this, &Nheko::updateUserProfile);
|
||||
}
|
||||
|
||||
void
|
||||
Nheko::updateUserProfile()
|
||||
{
|
||||
if (cache::client() && cache::client()->isInitialized())
|
||||
currentUser_.reset(
|
||||
new UserProfile("", utils::localUser(), ChatPage::instance()->timelineManager()));
|
||||
else
|
||||
currentUser_.reset();
|
||||
emit profileChanged();
|
||||
}
|
||||
|
||||
QPalette
|
||||
Nheko::colors() const
|
||||
{
|
||||
return QPalette();
|
||||
return Theme::paletteFromTheme(UserSettings::instance()->theme().toStdString());
|
||||
}
|
||||
|
||||
QPalette
|
||||
Nheko::inactiveColors() const
|
||||
{
|
||||
QPalette p;
|
||||
auto p = colors();
|
||||
p.setCurrentColorGroup(QPalette::ColorGroup::Inactive);
|
||||
return p;
|
||||
}
|
||||
|
||||
Theme
|
||||
Nheko::theme() const
|
||||
{
|
||||
return Theme(UserSettings::instance()->theme().toStdString());
|
||||
}
|
||||
|
||||
void
|
||||
Nheko::openLink(QString link) const
|
||||
{
|
||||
|
|
@ -79,3 +100,11 @@ Nheko::openLink(QString link) const
|
|||
QDesktopServices::openUrl(url);
|
||||
}
|
||||
}
|
||||
|
||||
UserProfile *
|
||||
Nheko::currentUser() const
|
||||
{
|
||||
nhlog::ui()->debug("Profile requested");
|
||||
|
||||
return currentUser_.get();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue