mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Set a header to be consistent and to have the profile page remain open when switching profiles
This commit is contained in:
parent
75f5901aec
commit
c3dd285864
|
@ -18,6 +18,7 @@
|
|||
#include "src/nexus.h"
|
||||
#include "ui_identitysettings.h"
|
||||
#include "profileform.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "src/widget/form/settingswidget.h"
|
||||
#include "src/widget/maskablepixmapwidget.h"
|
||||
#include "src/misc/settings.h"
|
||||
|
@ -53,6 +54,14 @@ ProfileForm::ProfileForm(QWidget *parent) :
|
|||
bodyUI->setupUi(this);
|
||||
core = Core::getInstance();
|
||||
|
||||
head = new QWidget();
|
||||
QFont bold;
|
||||
bold.setBold(true);
|
||||
head->setLayout(&headLayout);
|
||||
headLabel.setText(tr("User Profile"));
|
||||
headLabel.setFont(bold);
|
||||
headLayout.addWidget(&headLabel);
|
||||
|
||||
// tox
|
||||
toxId = new ClickableTE();
|
||||
toxId->setReadOnly(true);
|
||||
|
@ -102,6 +111,14 @@ ProfileForm::ProfileForm(QWidget *parent) :
|
|||
ProfileForm::~ProfileForm()
|
||||
{
|
||||
delete bodyUI;
|
||||
delete head;
|
||||
}
|
||||
|
||||
void ProfileForm::show(Ui::MainWindow &ui)
|
||||
{
|
||||
ui.mainHead->layout()->addWidget(head);
|
||||
head->show();
|
||||
QWidget::show();
|
||||
}
|
||||
|
||||
void ProfileForm::copyIdClicked()
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
class CroppingLabel;
|
||||
class Core;
|
||||
|
@ -27,6 +28,7 @@ class MaskablePixmapWidget;
|
|||
|
||||
namespace Ui {
|
||||
class IdentitySettings;
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class ClickableTE : public QLineEdit
|
||||
|
@ -46,6 +48,7 @@ class ProfileForm : public QWidget
|
|||
public:
|
||||
ProfileForm(QWidget *parent = nullptr);
|
||||
~ProfileForm();
|
||||
void show(Ui::MainWindow &ui);
|
||||
|
||||
signals:
|
||||
void userNameChanged(QString);
|
||||
|
@ -76,6 +79,9 @@ private:
|
|||
void refreshProfiles();
|
||||
Ui::IdentitySettings* bodyUI;
|
||||
MaskablePixmapWidget* profilePicture;
|
||||
QWidget *head;
|
||||
QLabel headLabel;
|
||||
QVBoxLayout headLayout;
|
||||
Core* core;
|
||||
QTimer timer;
|
||||
bool hasCheck = false;
|
||||
|
|
|
@ -550,7 +550,7 @@ void Widget::showProfile()
|
|||
{
|
||||
hideMainForms();
|
||||
ui->mainContent->layout()->addWidget(profileForm);
|
||||
profileForm->show();
|
||||
profileForm->show(*ui);
|
||||
setWindowTitle(tr("Profile"));
|
||||
activeChatroomWidget = nullptr;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user