1
0
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:
Ovidiu Sabou 2015-03-04 21:35:34 +02:00
parent 75f5901aec
commit c3dd285864
3 changed files with 24 additions and 1 deletions

View File

@ -18,6 +18,7 @@
#include "src/nexus.h" #include "src/nexus.h"
#include "ui_identitysettings.h" #include "ui_identitysettings.h"
#include "profileform.h" #include "profileform.h"
#include "ui_mainwindow.h"
#include "src/widget/form/settingswidget.h" #include "src/widget/form/settingswidget.h"
#include "src/widget/maskablepixmapwidget.h" #include "src/widget/maskablepixmapwidget.h"
#include "src/misc/settings.h" #include "src/misc/settings.h"
@ -53,6 +54,14 @@ ProfileForm::ProfileForm(QWidget *parent) :
bodyUI->setupUi(this); bodyUI->setupUi(this);
core = Core::getInstance(); 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 // tox
toxId = new ClickableTE(); toxId = new ClickableTE();
toxId->setReadOnly(true); toxId->setReadOnly(true);
@ -102,6 +111,14 @@ ProfileForm::ProfileForm(QWidget *parent) :
ProfileForm::~ProfileForm() ProfileForm::~ProfileForm()
{ {
delete bodyUI; delete bodyUI;
delete head;
}
void ProfileForm::show(Ui::MainWindow &ui)
{
ui.mainHead->layout()->addWidget(head);
head->show();
QWidget::show();
} }
void ProfileForm::copyIdClicked() void ProfileForm::copyIdClicked()

View File

@ -20,6 +20,7 @@
#include <QLineEdit> #include <QLineEdit>
#include <QLabel> #include <QLabel>
#include <QTimer> #include <QTimer>
#include <QVBoxLayout>
class CroppingLabel; class CroppingLabel;
class Core; class Core;
@ -27,6 +28,7 @@ class MaskablePixmapWidget;
namespace Ui { namespace Ui {
class IdentitySettings; class IdentitySettings;
class MainWindow;
} }
class ClickableTE : public QLineEdit class ClickableTE : public QLineEdit
@ -46,6 +48,7 @@ class ProfileForm : public QWidget
public: public:
ProfileForm(QWidget *parent = nullptr); ProfileForm(QWidget *parent = nullptr);
~ProfileForm(); ~ProfileForm();
void show(Ui::MainWindow &ui);
signals: signals:
void userNameChanged(QString); void userNameChanged(QString);
@ -76,6 +79,9 @@ private:
void refreshProfiles(); void refreshProfiles();
Ui::IdentitySettings* bodyUI; Ui::IdentitySettings* bodyUI;
MaskablePixmapWidget* profilePicture; MaskablePixmapWidget* profilePicture;
QWidget *head;
QLabel headLabel;
QVBoxLayout headLayout;
Core* core; Core* core;
QTimer timer; QTimer timer;
bool hasCheck = false; bool hasCheck = false;

View File

@ -550,7 +550,7 @@ void Widget::showProfile()
{ {
hideMainForms(); hideMainForms();
ui->mainContent->layout()->addWidget(profileForm); ui->mainContent->layout()->addWidget(profileForm);
profileForm->show(); profileForm->show(*ui);
setWindowTitle(tr("Profile")); setWindowTitle(tr("Profile"));
activeChatroomWidget = nullptr; activeChatroomWidget = nullptr;
} }