Skip to content

Commit 3ac6b33

Browse files
Fix charselect elements not affected by theme reloading (#465)
1 parent 90190f5 commit 3ac6b33

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

src/charselect.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ void Courtroom::construct_char_select()
1818
ui_char_list->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
1919
ui_char_list->hideColumn(1);
2020
ui_char_list->setDropIndicatorShown(true);
21-
set_size_and_pos(ui_char_list, "char_list");
22-
2321

2422
ui_char_buttons = new QWidget(ui_char_select_background);
2523

@@ -40,21 +38,12 @@ void Courtroom::construct_char_select()
4038

4139
ui_char_search = new QLineEdit(ui_char_select_background);
4240
ui_char_search->setPlaceholderText(tr("Search"));
43-
ui_char_search->setFocus();
44-
set_size_and_pos(ui_char_search, "char_search");
4541

4642
ui_char_passworded = new QCheckBox(ui_char_select_background);
4743
ui_char_passworded->setText(tr("Passworded"));
48-
set_size_and_pos(ui_char_passworded, "char_passworded");
4944

5045
ui_char_taken = new QCheckBox(ui_char_select_background);
5146
ui_char_taken->setText(tr("Taken"));
52-
set_size_and_pos(ui_char_taken, "char_taken");
53-
54-
ui_char_taken->setChecked(true);
55-
ui_char_passworded->setChecked(true);
56-
57-
set_size_and_pos(ui_char_buttons, "char_buttons");
5847

5948
connect(ui_char_list, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),
6049
this, SLOT(on_char_list_double_clicked(QTreeWidgetItem *, int)));
@@ -76,8 +65,6 @@ void Courtroom::construct_char_select()
7665
connect(ui_char_taken, SIGNAL(stateChanged(int)), this,
7766
SLOT(on_char_taken_clicked()));
7867

79-
truncate_label_text(ui_char_taken, "char_taken");
80-
truncate_label_text(ui_char_passworded, "char_passworded");
8168
}
8269

8370
void Courtroom::set_char_select()
@@ -94,10 +81,22 @@ void Courtroom::set_char_select()
9481
}
9582
else
9683
this->setFixedSize(f_charselect.width, f_charselect.height);
97-
9884
ui_char_select_background->resize(f_charselect.width, f_charselect.height);
9985
ui_char_select_background->set_image("charselect_background");
10086

87+
ui_char_search->setFocus();
88+
set_size_and_pos(ui_char_search, "char_search");
89+
set_size_and_pos(ui_char_list, "char_list");
90+
set_size_and_pos(ui_char_passworded, "char_passworded");
91+
set_size_and_pos(ui_char_taken, "char_taken");
92+
set_size_and_pos(ui_char_buttons, "char_buttons");
93+
94+
ui_char_taken->setChecked(true);
95+
ui_char_passworded->setChecked(true);
96+
97+
truncate_label_text(ui_char_taken, "char_taken");
98+
truncate_label_text(ui_char_passworded, "char_passworded");
99+
101100
filter_character_list();
102101

103102
ui_char_search->setFocus();

0 commit comments

Comments
 (0)