aboutsummaryrefslogtreecommitdiff
path: root/lobby.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lobby.cpp')
-rw-r--r--lobby.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/lobby.cpp b/lobby.cpp
index 1df765fd..3a10439d 100644
--- a/lobby.cpp
+++ b/lobby.cpp
@@ -4,6 +4,7 @@
#include "aoapplication.h"
#include "networkmanager.h"
#include "aosfxplayer.h"
+#include "file_functions.h"
#include <QDebug>
#include <QScrollBar>
@@ -51,14 +52,27 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow()
connect(ui_chatmessage, SIGNAL(returnPressed()), this, SLOT(on_chatfield_return_pressed()));
connect(ui_cancel, SIGNAL(clicked()), ao_app, SLOT(loading_cancelled()));
- set_widgets();
+ //set_widgets();
+ set_theme();
+}
+
+void Lobby::set_theme()
+{
+ ao_app->reload_theme();
+
+ //check if our current theme is a valid qss theme
+ if (!file_exists(ao_app->get_theme_path() + "lobby.qss"))
+ {
+ set_widgets();
+ return;
+ }
+
+ this->setStyleSheet(ao_app->read_file(ao_app->get_theme_path() + "lobby.qss"));
}
//sets images, position and size
void Lobby::set_widgets()
{
- ao_app->set_user_theme();
-
QString filename = "lobby_design.ini";
pos_size_type f_lobby = ao_app->get_element_dimensions("lobby", filename);