Freeciv-3.3
Loading...
Searching...
No Matches
sidebar.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifndef FC__SIDEBAR_H
15#define FC__SIDEBAR_H
16
17// Needed for the moc-generated meta file
18#ifdef HAVE_CONFIG_H
19#include <fc_config.h>
20#endif
21
22// Qt
23#include <QEnterEvent>
24#include <QWidget>
25
26enum { SW_STD = 0, SW_TAX = 1, SW_INDICATORS = 2 };
27
28class QPixmap;
29class QVBoxLayout;
30
31typedef void (*pfcn_bool)(bool);
32typedef void (*pfcn)(void);
33
36void side_center_unit();
38void side_finish_turn(bool nothing);
40void side_rates_wdg(bool nothing);
44void side_show_map(bool nothing);
45
46/***************************************************************************
47 Class representing single widget(icon) on sidebar
48***************************************************************************/
49class fc_sidewidget : public QWidget
50{
52public:
54 int type = SW_STD);
59 void resize_pixmap(int width, int height);
61 void set_label(QString str);
63 void set_pixmap(QPixmap* pm);
69 void update_fonts();
70
71 bool blink;
76public slots:
77 void sblink();
78 void some_slot();
79protected:
81#ifndef FC_QT5_MODE
83#else // FC_QT5_MODE
84 void enterEvent(QEvent *event);
85#endif // FC_QT5_MODE
86 void leaveEvent(QEvent *event);
90private:
91 void paint();
92 bool hover;
105};
106
107
108/***************************************************************************
109 Freeciv sidebar
110***************************************************************************/
111class fc_sidebar : public QWidget
112{
114public:
115 fc_sidebar();
116 ~fc_sidebar();
119 void resize_me(int height, bool force = false);
120 void update_fonts();
122protected:
124private:
126};
127
128#endif // FC__SIDEBAR_H
#define str
Definition astring.c:76
struct canvas int int struct sprite int int int int height
Definition canvas_g.h:44
struct canvas int int struct sprite int int int width
Definition canvas_g.h:44
QVBoxLayout * layout
Definition sidebar.h:125
void resize_me(int height, bool force=false)
Definition sidebar.cpp:570
void add_widget(fc_sidewidget *fsw)
Definition sidebar.cpp:537
QList< fc_sidewidget * > objects
Definition sidebar.h:121
void update_fonts()
Definition sidebar.cpp:612
void paintEvent(QPaintEvent *event)
Definition sidebar.cpp:547
void paint(QPainter *painter, QPaintEvent *event)
Definition sidebar.cpp:559
void update_fonts()
Definition sidebar.cpp:132
void set_wheel_down(pfcn func)
Definition sidebar.cpp:287
QPixmap * final_pixmap
Definition sidebar.h:100
int get_priority()
QFont * info_font
Definition sidebar.h:98
pfcn wheel_down
Definition sidebar.h:94
QString custom_label
Definition sidebar.h:102
QFont * sfont
Definition sidebar.h:97
bool keep_blinking
Definition sidebar.h:72
void wheelEvent(QWheelEvent *event)
Definition sidebar.cpp:319
QString desc
Definition sidebar.h:103
void set_wheel_up(pfcn func)
Definition sidebar.cpp:295
void some_slot()
Definition sidebar.cpp:356
void contextMenuEvent(QContextMenuEvent *event)
Definition sidebar.cpp:258
pfcn wheel_up
Definition sidebar.h:95
QPixmap * def_pixmap
Definition sidebar.h:99
void paintEvent(QPaintEvent *event)
Definition sidebar.cpp:204
QString page
Definition sidebar.h:75
void set_custom_labels(QString l)
Definition sidebar.cpp:152
void mousePressEvent(QMouseEvent *event)
Definition sidebar.cpp:303
void set_left_click(pfcn_bool func)
Definition sidebar.cpp:271
void set_label(QString str)
Definition sidebar.cpp:176
void sblink()
Definition sidebar.cpp:335
void set_pixmap(QPixmap *pm)
Definition sidebar.cpp:120
void resize_pixmap(int width, int height)
Definition sidebar.cpp:185
QTimer * timer
Definition sidebar.h:104
void set_right_click(pfcn func)
Definition sidebar.cpp:279
bool disabled
Definition sidebar.h:73
void set_tooltip(QString tooltip)
Definition sidebar.cpp:160
void leaveEvent(QEvent *event)
Definition sidebar.cpp:244
pfcn_bool left_click
Definition sidebar.h:96
void enterEvent(QEnterEvent *event)
Definition sidebar.cpp:228
void update_final_pixmap()
Definition sidebar.cpp:393
QPixmap * scaled_pixmap
Definition sidebar.h:101
QPixmap * get_pixmap()
Definition sidebar.cpp:168
pfcn right_click
Definition sidebar.h:93
char * incite_cost
Definition comments.c:76
enum event_type event
Definition events.c:81
const char * tooltip
Definition repodlgs.c:1315
GType type
Definition repodlgs.c:1313
get_token_fn_t func
Definition inputfile.c:128
struct player_slot * slots
Definition player.c:51
void side_center_unit()
Definition sidebar.cpp:649
void side_show_map(bool nothing)
Definition sidebar.cpp:623
void update_turn_done_tooltip()
Definition gui_main.c:1109
void side_indicators_menu()
Definition sidebar.cpp:701
void side_left_click_science(bool nothing)
Definition sidebar.cpp:809
void side_rates_wdg(bool nothing)
Definition sidebar.cpp:639
void(* pfcn_bool)(bool)
Definition sidebar.h:31
void(* pfcn)(void)
Definition sidebar.h:32
void side_right_click_diplomacy()
Definition sidebar.cpp:715
void side_finish_turn(bool nothing)
Definition sidebar.cpp:631
void side_right_click_science()
Definition sidebar.cpp:760
void side_blink_endturn(bool do_restore)
Definition sidebar.cpp:689
void side_disable_endturn(bool do_restore)
Definition sidebar.cpp:676
@ SW_TAX
Definition sidebar.h:26
@ SW_INDICATORS
Definition sidebar.h:26
@ SW_STD
Definition sidebar.h:26
#define bool
Definition support.h:71