Freeciv-3.1
Loading...
Searching...
No Matches
Functions | Variables
themes.cpp File Reference
#include <QApplication>
#include <QDir>
#include <QPalette>
#include <QStyleFactory>
#include <QTextStream>
#include "mem.h"
#include "themes_common.h"
#include "themes_g.h"
#include "fc_client.h"
#include "gui_main.h"

Go to the source code of this file.

Functions

void qtg_gui_load_theme (const char *directory, const char *theme_name)
 
void set_theme_style ()
 
void qtg_gui_clear_theme ()
 
char ** qtg_get_gui_specific_themes_directories (int *count)
 
char ** qtg_get_usable_themes_in_directory (const char *directory, int *count)
 

Variables

QString current_theme
 
static QString def_app_style
 
static QString stylestring
 
static QStyle * current_style = nullptr
 

Function Documentation

◆ qtg_get_gui_specific_themes_directories()

char ** qtg_get_gui_specific_themes_directories ( int *  count)

Each gui has its own themes directories.

Returns an array containing these strings and sets array size in count. The caller is responsible for freeing the array and the paths.

Definition at line 131 of file themes.cpp.

Referenced by setup_gui_funcs().

◆ qtg_get_usable_themes_in_directory()

char ** qtg_get_usable_themes_in_directory ( const char *  directory,
int *  count 
)

Return an array of names of usable themes in the given directory. Array size is stored in count. The caller is responsible for freeing the array and the names.

Definition at line 156 of file themes.cpp.

Referenced by setup_gui_funcs().

◆ qtg_gui_clear_theme()

void qtg_gui_clear_theme ( )

Clears a theme (sets default system theme)

Definition at line 115 of file themes.cpp.

Referenced by qtg_gui_load_theme(), qtg_ui_main(), and setup_gui_funcs().

◆ qtg_gui_load_theme()

void qtg_gui_load_theme ( const char *  directory,
const char *  theme_name 
)

Loads a qt theme directory/theme_name

Definition at line 46 of file themes.cpp.

Referenced by setup_gui_funcs().

◆ set_theme_style()

void set_theme_style ( )

Set theme style again, to work around Qt theming bug.

Definition at line 107 of file themes.cpp.

Referenced by city_dialog::city_dialog().

Variable Documentation

◆ current_style

QStyle* current_style = nullptr
static

Definition at line 41 of file themes.cpp.

Referenced by qtg_gui_load_theme(), and set_theme_style().

◆ current_theme

QString current_theme
extern

Definition at line 65 of file fc_client.cpp.

Referenced by qtg_gui_load_theme().

◆ def_app_style

QString def_app_style
static

Definition at line 38 of file themes.cpp.

Referenced by qtg_gui_load_theme().

◆ stylestring

QString stylestring
static

Definition at line 39 of file themes.cpp.

Referenced by qtg_gui_load_theme().