mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Merge pull request #381 from LorenDB/centerUserInfo
Center user info dialog on the screen
This commit is contained in:
commit
5930b8eb31
3 changed files with 17 additions and 1 deletions
|
@ -10,12 +10,19 @@ ApplicationWindow {
|
||||||
|
|
||||||
property var profile
|
property var profile
|
||||||
|
|
||||||
|
x: MainWindow.x + (MainWindow.width / 2) - (width / 2)
|
||||||
|
y: MainWindow.y + (MainWindow.height / 2) - (height / 2)
|
||||||
height: 650
|
height: 650
|
||||||
width: 420
|
width: 420
|
||||||
minimumHeight: 420
|
minimumHeight: 420
|
||||||
palette: colors
|
palette: colors
|
||||||
color: colors.window
|
color: colors.window
|
||||||
|
|
||||||
|
Shortcut {
|
||||||
|
sequence: StandardKey.Cancel
|
||||||
|
onActivated: userProfileDialog.close()
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: contentL
|
id: contentL
|
||||||
|
|
||||||
|
|
|
@ -61,10 +61,15 @@ class MainWindow : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
Q_PROPERTY(int x READ x CONSTANT)
|
||||||
|
Q_PROPERTY(int y READ y CONSTANT)
|
||||||
|
Q_PROPERTY(int width READ width CONSTANT)
|
||||||
|
Q_PROPERTY(int height READ height CONSTANT)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MainWindow(QWidget *parent = nullptr);
|
explicit MainWindow(QWidget *parent = nullptr);
|
||||||
|
|
||||||
static MainWindow *instance() { return instance_; };
|
static MainWindow *instance() { return instance_; }
|
||||||
void saveCurrentWindowSize();
|
void saveCurrentWindowSize();
|
||||||
|
|
||||||
void openLeaveRoomDialog(const QString &room_id);
|
void openLeaveRoomDialog(const QString &room_id);
|
||||||
|
|
|
@ -128,6 +128,10 @@ TimelineViewManager::TimelineViewManager(CallManager *callManager, ChatPage *par
|
||||||
"UserProfile needs to be instantiated on the C++ side");
|
"UserProfile needs to be instantiated on the C++ side");
|
||||||
|
|
||||||
static auto self = this;
|
static auto self = this;
|
||||||
|
qmlRegisterSingletonType<MainWindow>(
|
||||||
|
"im.nheko", 1, 0, "MainWindow", [](QQmlEngine *, QJSEngine *) -> QObject * {
|
||||||
|
return MainWindow::instance();
|
||||||
|
});
|
||||||
qmlRegisterSingletonType<TimelineViewManager>(
|
qmlRegisterSingletonType<TimelineViewManager>(
|
||||||
"im.nheko", 1, 0, "TimelineManager", [](QQmlEngine *, QJSEngine *) -> QObject * {
|
"im.nheko", 1, 0, "TimelineManager", [](QQmlEngine *, QJSEngine *) -> QObject * {
|
||||||
return self;
|
return self;
|
||||||
|
|
Loading…
Reference in a new issue