aboutsummaryrefslogtreecommitdiff
path: root/lobby.cpp
diff options
context:
space:
mode:
authorDavid Skoland <davidskoland@gmail.com>2018-02-09 01:13:47 +0100
committerDavid Skoland <davidskoland@gmail.com>2018-02-09 01:13:47 +0100
commit4ec662d82620945e54c9f7060758bd01b1382644 (patch)
treee9ccdf8e0cd6357f83b5fd562c7f602ad49022ed /lobby.cpp
parent403e5b43288dd945ca504d3b0dfeb2757227c879 (diff)
renaming some functions and starting qss theme functionality
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);