Skip to content

Commit

Permalink
tlobby_main: design improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Mar 16, 2016
1 parent 8c4dfc5 commit 32c9378
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 104 deletions.
187 changes: 104 additions & 83 deletions data/gui/default/window/lobby_main.cfg
Expand Up @@ -102,6 +102,9 @@
#enddef

#define GAMELISTBOX
border = "left"
border_size = 5

[listbox]
id = "game_list"
definition = "default"
Expand All @@ -110,11 +113,15 @@
[header]
[row]
[column]
[grid]
[row]
{GAMELISTBOX_HEADER_LABEL "map" _"Games"}
[/row]
[/grid]
grow_factor = 1
horizontal_grow = "true"
border = "top,bottom,right"
border_size = 5
[label]
id = "map"
definition = "default"
label = _ "Games"
[/label]
[/column]
[/row]
[/header]
Expand Down Expand Up @@ -466,7 +473,7 @@
#enddef

#define ROOMLISTBOX
[listbox]
[horizontal_listbox]
id = "room_list"
definition = "default"

Expand Down Expand Up @@ -512,13 +519,18 @@
definition = "default"
[/label]
[/column]
[column]
[spacer]
width = 10
[/spacer]
[/column]
[/row]
[/grid]
[/toggle_panel]
[/column]
[/row]
[/list_definition]
[/listbox]
[/horizontal_listbox]
#enddef

#define CHATLOG
Expand All @@ -528,81 +540,73 @@
horizontal_scrollbar_mode = "never"
[page_definition]
[row]
grow_factor = 1
[column]
vertical_grow = "true"
horizontal_grow = "true"
[grid]
[row]
[column]
horizontal_alignment = "center"
vertical_alignment = "top"
[label]
id = "log_header"
definition = "title"
label = "lobby"
[/label]
[/column]
[/row]
[row]
grow_factor = 1
[column]
horizontal_grow = "true"
vertical_grow = "true"
[scroll_label]
id = "log_text"
definition = "default"
vertical_grow = "true"
border = "left"
border_size = 5
[scroll_label]
id = "log_text"
definition = "description"

vertical_scrollbar_mode = "auto"
horizontal_scrollbar_mode = "auto"
[/scroll_label]
[/column]
[/row]
[/grid]
vertical_scrollbar_mode = "always"
horizontal_scrollbar_mode = "never"
[/scroll_label]
[/column]
[/row]
[/page_definition]
[/multi_page]
#enddef

#define _GUI_TITLE
border = "all"
border_size = 5
[label]
definition = "title"
label = _ "Multiplayer Lobby"
[/label]
#enddef

#define _GUI_FILTER_AREA
{HORIZONTAL_BEGIN}
grow_factor = 0
border = "all"
border_size = 5
[label]
definition = "default"
label = _ "Filter:"
[/label]
{HORIZONTAL_SEP}
grow_factor = 0
border = "all"
border_size = 5
[text_box]
definition = "default"
id = "filter_text"
[/text_box]
{HORIZONTAL_SEP}
grow_factor = 1
border = "all"
border_size = 5
[toggle_button]
definition = "default"
id = "filter_with_friends"
label = _ "Friends"
[/toggle_button]
{HORIZONTAL_SEP}
grow_factor = 1
border = "all"
border_size = 5
[toggle_button]
definition = "default"
id = "filter_without_ignored"
label = _ "No ignored"
[/toggle_button]
{HORIZONTAL_SEP}
grow_factor = 1
border = "all"
border_size = 5
[toggle_button]
definition = "default"
id = "filter_vacant_slots"
label = _ "Vacant slots"
[/toggle_button]
{HORIZONTAL_SEP}
grow_factor = 1
border = "left,top,bottom"
border_size = 5
[toggle_button]
definition = "default"
id = "filter_invert"
Expand All @@ -612,48 +616,54 @@
#enddef

#define _GUI_CHAT_AREA
{HORIZONTAL_BEGIN}
vertical_alignment = "top"
{VERTICAL_BEGIN}
horizontal_grow = "true"
{ROOMLISTBOX}
{VERTICAL_SEP}
[button]
id = "close_window"
definition = "default"
label = _ "Close"
[/button]
{VERTICAL_END}
{HORIZONTAL_SEP}
grow_factor = 1
horizontal_grow = "true"
vertical_grow = "true"
[grid]
[row]
grow_factor = 1
[column]
horizontal_grow = "true"
vertical_grow = "true"
{CHATLOG}
{VERTICAL_SEP}
horizontal_grow = "true"
{HORIZONTAL_BEGIN}
[grid]
[row]
grow_factor = 0
[column]
horizontal_grow = "true"
grow_factor = 1
[grid]
[row]
[column]
horizontal_alignment = "left"
border = "left,top"
border_size = 5
{ROOMLISTBOX}
[/column]
[column]
horizontal_alignment = "right"
[button]
id = "close_window"
definition = "default"
label = _ "Close"
[/button]
[/column]
[/row]
[/grid]
[/column]
[/row]
[row]
grow_factor = 1
[column]
horizontal_grow = "true"
vertical_grow = "true"
{CHATLOG}
[/column]
[/row]
[row]
grow_factor = 0
[column]
horizontal_grow = "true"
verical_alignment = "bottom"
border = "left"
border_size = 5
[text_box]
id = "chat_input"
definition = "default"
history = "mp_chat_input_history"
[/text_box]
{HORIZONTAL_SEP}
[button]
id = "send_message"
definition = "default"
label = _ "Send"
[/button]
{HORIZONTAL_END}
{VERTICAL_END}
{HORIZONTAL_END}
[/column]
[/row]
[/grid]
#enddef

#define _GUI_CONTROL_AREA
Expand Down Expand Up @@ -731,11 +741,11 @@
definition = "borderless"
{GUI_WINDOW_FULLSCREEN}
[tooltip]
id = "tooltip_large"
id = "tooltip"
[/tooltip]

[helptip]
id = "tooltip_large"
id = "tooltip"
[/helptip]

[grid]
Expand All @@ -744,7 +754,12 @@
[column]
grow_factor = 1
horizontal_alignment = "left"
{_GUI_TITLE}
border = "all"
border_size = 5
[label]
definition = "title"
label = _ "Multiplayer Lobby"
[/label]
[/column]
[/row]
[row]
Expand All @@ -769,14 +784,20 @@
)}
[/column]
[/row]

[row]
grow_factor = 0
[column]
vertical_grow = "true"
horizontal_grow = "true"
{_GUI_FILTER_AREA}
[/column]
[/row]

{GUI_HORIZONTAL_SPACER_LINE}

[row]
grow_factor = 0
[column]
horizontal_grow = "true"
vertical_grow = "true"
Expand All @@ -802,7 +823,7 @@
#undef _GUI_CONTROL_AREA
#undef _GUI_CHAT_AREA
#undef _GUI_FILTER_AREA
#undef _GUI_TITLE
#undef CHATLOG
#undef GAMELISTBOX
#undef PLAYERLISTBOX
#undef ROOMLISTBOX
36 changes: 15 additions & 21 deletions src/gui/dialogs/lobby_main.cpp
Expand Up @@ -964,12 +964,6 @@ void tlobby_main::pre_show(twindow& window)
_5,
boost::ref(window)));

connect_signal_mouse_left_click(
find_widget<tbutton>(&window, "send_message", false),
boost::bind(&tlobby_main::send_message_button_callback,
this,
boost::ref(window)));

connect_signal_mouse_left_click(
find_widget<tbutton>(&window, "create", false),
boost::bind(&tlobby_main::create_button_callback,
Expand Down Expand Up @@ -1090,7 +1084,7 @@ tlobby_chat_window* tlobby_main::search_create_window(const std::string& name,
utils::string_map symbols;
symbols["name"] = name;
if(whisper) {
add_label_data(data, "log_header", "<" + name + ">");
//add_label_data(data, "log_header", "<" + name + ">");
add_label_data(data,
"log_text",
VGETTEXT("Whisper session with $name started. "
Expand All @@ -1099,7 +1093,7 @@ tlobby_chat_window* tlobby_main::search_create_window(const std::string& name,
"type /ignore $name\n",
symbols));
} else {
add_label_data(data, "log_header", name);
//add_label_data(data, "log_header", name);
add_label_data(
data, "log_text", VGETTEXT("Room $name joined", symbols));
lobby_info_.open_room(name);
Expand Down Expand Up @@ -1225,22 +1219,22 @@ void tlobby_main::switch_to_window(size_t id)

void tlobby_main::active_window_changed()
{
tlabel& header = find_widget<tlabel>(
&chat_log_container_->page_grid(active_window_),
"log_header",
false);
//tlabel& header = find_widget<tlabel>(
// &chat_log_container_->page_grid(active_window_),
// "log_header",
// false);

tlobby_chat_window& t = open_windows_[active_window_];
std::string expected_label;
if(t.whisper) {
expected_label = "<" + t.name + ">";
} else {
expected_label = t.name;
}
if(header.label() != expected_label) {
ERR_LB << "Chat log header not what it should be! " << header.label()
<< " vs " << expected_label << "\n";
}
//if(t.whisper) {
// expected_label = "<" + t.name + ">";
//} else {
// expected_label = t.name;
//}
//if(header.label() != expected_label) {
// ERR_LB << "Chat log header not what it should be! " << header.label()
// << " vs " << expected_label << "\n";
//}

bool close_button_active = (t.whisper || (t.name != "lobby"));

Expand Down

0 comments on commit 32c9378

Please sign in to comment.