diff options
| author | Crystalwarrior <varsash@gmail.com> | 2019-09-18 17:34:22 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2019-09-18 17:34:22 +0300 |
| commit | 0fe94d5d9f0e175ba8355305cdfd6cd35e0a545f (patch) | |
| tree | 3e6078e87b16f0469c4289fb5d0f609cee301063 /src/emotes.cpp | |
| parent | 04daff7446061bb87bdf85ed080079041a75f142 (diff) | |
Evidence and emotes reloading when reload_theme is pressed
Update evidence a bit and change the way it sets images to something much better and less confusing
Update the hovering logic a bit so there's less weird occurences happening e.g. evidence button is deleted
Diffstat (limited to 'src/emotes.cpp')
| -rw-r--r-- | src/emotes.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/emotes.cpp b/src/emotes.cpp index daa8d6d4..4ce2eb73 100644 --- a/src/emotes.cpp +++ b/src/emotes.cpp @@ -2,12 +2,35 @@ #include "aoemotebutton.h" -void Courtroom::construct_emotes() +void Courtroom::initialize_emotes() { ui_emotes = new QWidget(this); + ui_emote_left = new AOButton(this, ao_app); + ui_emote_right = new AOButton(this, ao_app); + + ui_emote_dropdown = new QComboBox(this); + + connect(ui_emote_left, SIGNAL(clicked()), this, SLOT(on_emote_left_clicked())); + connect(ui_emote_right, SIGNAL(clicked()), this, SLOT(on_emote_right_clicked())); + + connect(ui_emote_dropdown, SIGNAL(activated(int)), this, SLOT(on_emote_dropdown_changed(int))); +} + +void Courtroom::refresh_emotes() +{ + //Should properly refresh the emote list + qDeleteAll(ui_emote_list.begin(), ui_emote_list.end()); + ui_emote_list.clear(); + set_size_and_pos(ui_emotes, "emotes"); + set_size_and_pos(ui_emote_left, "emote_left"); + ui_emote_left->set_image("arrow_left"); + + set_size_and_pos(ui_emote_right, "emote_right"); + ui_emote_right->set_image("arrow_right"); + QPoint f_spacing = ao_app->get_button_spacing("emote_button_spacing", "courtroom_design.ini"); const int button_width = 40; |
