mirror of
https://github.com/labwc/labwc.git
synced 2026-03-28 07:58:28 -04:00
theme: add theme_finish()
This commit is contained in:
parent
9f61a819fc
commit
cb2a504440
4 changed files with 23 additions and 2 deletions
|
|
@ -42,7 +42,7 @@ void parse_hexstr(const char *hex, float *rgba);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* theme_init - read openbox theme and generate button textures
|
* theme_init - read openbox theme and generate button textures
|
||||||
* @theme: global theme struct
|
* @theme: theme data
|
||||||
* @renderer: wlr_renderer for creating button textures
|
* @renderer: wlr_renderer for creating button textures
|
||||||
* @theme_name: theme-name in <theme-dir>/<theme-name>/openbox-3/themerc
|
* @theme_name: theme-name in <theme-dir>/<theme-name>/openbox-3/themerc
|
||||||
* Note <theme-dir> is obtained in theme-dir.c
|
* Note <theme-dir> is obtained in theme-dir.c
|
||||||
|
|
@ -50,6 +50,12 @@ void parse_hexstr(const char *hex, float *rgba);
|
||||||
void theme_init(struct theme *theme, struct wlr_renderer *renderer,
|
void theme_init(struct theme *theme, struct wlr_renderer *renderer,
|
||||||
const char *theme_name);
|
const char *theme_name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* theme_finish - free button textures
|
||||||
|
* @theme: theme data
|
||||||
|
*/
|
||||||
|
void theme_finish(struct theme *theme);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* theme_builin - apply built-in theme similar to Clearlooks
|
* theme_builin - apply built-in theme similar to Clearlooks
|
||||||
* Note: Only used if no theme can be found. Default values for individual
|
* Note: Only used if no theme can be found. Default values for individual
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,10 @@ main(int argc, char *argv[])
|
||||||
wl_display_run(server.wl_display);
|
wl_display_run(server.wl_display);
|
||||||
|
|
||||||
server_finish(&server);
|
server_finish(&server);
|
||||||
|
|
||||||
|
menu_finish(&rootmenu);
|
||||||
|
theme_finish(&theme);
|
||||||
rcxml_finish();
|
rcxml_finish();
|
||||||
menu_finish(server.rootmenu);
|
|
||||||
font_finish();
|
font_finish();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ reload_config_and_theme(void)
|
||||||
/* TODO: use rc.config_path */
|
/* TODO: use rc.config_path */
|
||||||
rcxml_finish();
|
rcxml_finish();
|
||||||
rcxml_read(NULL);
|
rcxml_read(NULL);
|
||||||
|
theme_finish(g_server->theme);
|
||||||
theme_init(g_server->theme, g_server->renderer, rc.theme_name);
|
theme_init(g_server->theme, g_server->renderer, rc.theme_name);
|
||||||
menu_reconfigure(g_server, g_server->rootmenu);
|
menu_reconfigure(g_server, g_server->rootmenu);
|
||||||
damage_all_outputs(g_server);
|
damage_all_outputs(g_server);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
#include "common/dir.h"
|
#include "common/dir.h"
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "common/string-helpers.h"
|
#include "common/string-helpers.h"
|
||||||
|
#include "common/zfree.h"
|
||||||
#include "theme/theme.h"
|
#include "theme/theme.h"
|
||||||
#include "xbm/xbm.h"
|
#include "xbm/xbm.h"
|
||||||
|
|
||||||
|
|
@ -135,3 +136,14 @@ theme_init(struct theme *theme, struct wlr_renderer *renderer,
|
||||||
theme_read(theme, theme_name);
|
theme_read(theme, theme_name);
|
||||||
xbm_load(theme, renderer);
|
xbm_load(theme, renderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
theme_finish(struct theme *theme)
|
||||||
|
{
|
||||||
|
zfree(theme->xbm_close_active_unpressed);
|
||||||
|
zfree(theme->xbm_maximize_active_unpressed);
|
||||||
|
zfree(theme->xbm_iconify_active_unpressed);
|
||||||
|
zfree(theme->xbm_close_inactive_unpressed);
|
||||||
|
zfree(theme->xbm_maximize_inactive_unpressed);
|
||||||
|
zfree(theme->xbm_iconify_inactive_unpressed);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue