Add settings panel for homeserver's domain
3 files changed, 53 insertions, 1 deletions
diff --git a/include/LoginPage.h b/include/LoginPage.h
index 8ed54def..8a44ef7a 100644
--- a/include/LoginPage.h
+++ b/include/LoginPage.h
@@ -26,7 +26,9 @@
#include "FlatButton.h"
#include "InputValidator.h"
+#include "LoginSettings.h"
#include "MatrixClient.h"
+#include "OverlayModal.h"
#include "RaisedButton.h"
#include "TextField.h"
@@ -53,10 +55,14 @@ private slots:
// Displays errors produced during the login.
void loginError(QString error_message);
+ // Manipulate settings modal.
+ void showSettingsModal();
+ void closeSettingsModal(const QString &server);
+
private:
QVBoxLayout *top_layout_;
- QHBoxLayout *back_layout_;
+ QHBoxLayout *top_bar_layout_;
QHBoxLayout *logo_layout_;
QHBoxLayout *button_layout_;
@@ -64,6 +70,7 @@ private:
QLabel *error_label_;
FlatButton *back_button_;
+ FlatButton *advanced_settings_button_;
RaisedButton *login_button_;
QWidget *form_widget_;
@@ -73,6 +80,10 @@ private:
TextField *matrixid_input_;
TextField *password_input_;
+ OverlayModal *settings_modal_;
+ LoginSettings *login_settings_;
+ QString custom_domain_;
+
InputValidator *matrix_id_validator_;
// Matrix client API provider.
diff --git a/include/LoginSettings.h b/include/LoginSettings.h
new file mode 100644
index 00000000..3fc00488
--- /dev/null
+++ b/include/LoginSettings.h
@@ -0,0 +1,40 @@
+/*
+ * nheko Copyright (C) 2017 Konstantinos Sideris <siderisk@auth.gr>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LOGIN_SETTINGS_H
+#define LOGIN_SETTINGS_H
+
+#include <QFrame>
+
+#include "FlatButton.h"
+#include "TextField.h"
+
+class LoginSettings : public QFrame
+{
+ Q_OBJECT
+public:
+ explicit LoginSettings(QWidget *parent = nullptr);
+
+signals:
+ void closing(const QString &server);
+
+private:
+ TextField *input_;
+ FlatButton *submit_button_;
+};
+
+#endif // LOGIN_SETTINGS_H
diff --git a/include/ui/OverlayModal.h b/include/ui/OverlayModal.h
index aff93d02..d90eccea 100644
--- a/include/ui/OverlayModal.h
+++ b/include/ui/OverlayModal.h
@@ -50,6 +50,7 @@ private:
inline void OverlayModal::setDuration(int duration)
{
duration_ = duration;
+ animation_->setDuration(duration_);
}
inline void OverlayModal::setColor(QColor color)
|