14 #include <QApplication>
15 #include <QGridLayout>
16 #include <QHeaderView>
17 #include <QListWidget>
18 #include <QMouseEvent>
20 #include <QPushButton>
37 setMinimumSize(200, 100);
39 layout->setContentsMargins(2, 2, 2, 2);
43 auto title =
new QLabel(
_(
"Messages"));
44 title->setAlignment(Qt::AlignCenter);
45 title->setMouseTracking(
true);
46 layout->addWidget(title, 0, 1);
47 layout->setColumnStretch(1, 100);
50 mesg_table->setEditTriggers(QAbstractItemView::NoEditTriggers);
51 mesg_table->setSelectionMode(QAbstractItemView::SingleSelection);
52 mesg_table->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
58 &QItemSelectionModel::selectionChanged,
this,
60 setMouseTracking(
true);
67 const QItemSelection &ds)
73 QModelIndexList indexes = sl.indexes();
74 QListWidgetItem *
item;
76 if (indexes.isEmpty()) {
79 index = indexes.at(0);
82 if (i > -1 && pmsg !=
nullptr) {
83 if (QApplication::mouseButtons() == Qt::LeftButton
84 || QApplication::mouseButtons() == Qt::RightButton) {
91 if (QApplication::mouseButtons() == Qt::LeftButton
95 if (QApplication::mouseButtons() == Qt::RightButton && pmsg->
city_ok) {
98 if (QApplication::mouseButtons() == Qt::RightButton
99 && pmsg->
event == E_DIPLOMACY) {
112 setCursor(Qt::ArrowCursor);
120 setCursor(Qt::ArrowCursor);
131 style()->drawPrimitive(QStyle::PE_Widget, &opt, &p,
this);
144 auto item =
new QListWidgetItem;
148 auto f =
item->font();
153 if (icon !=
nullptr) {
154 item->setIcon(QIcon(*icon));
165 if (num < mesg_table->count()) {
170 for (
int i =
mesg_table->count(); i < num; i++) {
int gimmeIndexOf(const QString &str)
Returns index on game tab page of given report dialog.
fc_game_tab_widget * game_tab_widget
static update_queue * uq()
void connect_processing_finished_unique(int request_id, uq_callback_t cb, void *data)
Connects the callback to the end of the processing (in server side) of the request.
void real_meswin_dialog_update(void *unused)
Do the work of updating (populating) the message dialog.
void meswin_popup_city(int message_index)
Called from messagewin.c if the user clicks on the popup-city button.
void meswin_goto(int message_index)
Called from messagewin.c if the user clicks on the goto button.
int meswin_get_num_messages()
Returns the number of message in the window.
const struct message * meswin_get_message(int message_index)
Returns the pointer to a message.
void meswin_set_visited_state(int message_index, bool state)
Sets the visited-state of a message.
pageGame * queen()
Return game instandce.
struct connection::@55::@60 client
const QPixmap * get_event_sprite(const struct tileset *t, enum event_type event)
Return event icon sprite.