mirror of
https://github.com/labwc/labwc.git
synced 2026-02-27 01:40:30 -05:00
config: add <theme><cornerRadius>
This commit is contained in:
parent
cd313fd97a
commit
a5139815d6
4 changed files with 14 additions and 10 deletions
|
|
@ -28,6 +28,9 @@ This section contains settings which are not present in Openbox.
|
||||||
*<theme><name>*
|
*<theme><name>*
|
||||||
The name of the Openbox theme to use. Default is Clearlooks-3.4
|
The name of the Openbox theme to use. Default is Clearlooks-3.4
|
||||||
|
|
||||||
|
*<theme><cornerRadius>*
|
||||||
|
The radius of server side decoration top corners. Default is 8.
|
||||||
|
|
||||||
*<theme><font place="">*
|
*<theme><font place="">*
|
||||||
The font to use for a specific element of a window, menu or OSD.
|
The font to use for a specific element of a window, menu or OSD.
|
||||||
Place can be any of:
|
Place can be any of:
|
||||||
|
|
@ -50,7 +53,7 @@ This section contains settings which are not present in Openbox.
|
||||||
*<keyboard><keybind key=""><action name="">*
|
*<keyboard><keybind key=""><action name="">*
|
||||||
Keybind action. See labwc-action(5)
|
Keybind action. See labwc-action(5)
|
||||||
|
|
||||||
Default if no rc.xml is found:
|
Default key-binds if no rc.xml is found:
|
||||||
|
|
||||||
```
|
```
|
||||||
<keyboard>
|
<keyboard>
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
struct rcxml {
|
struct rcxml {
|
||||||
bool xdg_shell_server_side_deco;
|
bool xdg_shell_server_side_deco;
|
||||||
char *theme_name;
|
char *theme_name;
|
||||||
|
int corner_radius;
|
||||||
char *font_name_activewindow;
|
char *font_name_activewindow;
|
||||||
int font_size_activewindow;
|
int font_size_activewindow;
|
||||||
struct wl_list keybinds;
|
struct wl_list keybinds;
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,8 @@ entry(xmlNode *node, char *nodename, char *content)
|
||||||
rc.xdg_shell_server_side_deco = get_bool(content);
|
rc.xdg_shell_server_side_deco = get_bool(content);
|
||||||
} else if (!strcmp(nodename, "name.theme")) {
|
} else if (!strcmp(nodename, "name.theme")) {
|
||||||
rc.theme_name = strdup(content);
|
rc.theme_name = strdup(content);
|
||||||
|
} else if (!strcmp(nodename, "cornerradius.theme")) {
|
||||||
|
rc.corner_radius = atoi(content);
|
||||||
} else if (!strcmp(nodename, "name.font.theme")) {
|
} else if (!strcmp(nodename, "name.font.theme")) {
|
||||||
fill_font(nodename, content, font_place);
|
fill_font(nodename, content, font_place);
|
||||||
} else if (!strcmp(nodename, "size.font.theme")) {
|
} else if (!strcmp(nodename, "size.font.theme")) {
|
||||||
|
|
@ -208,13 +210,6 @@ rcxml_parse_xml(struct buf *b)
|
||||||
xmlCleanupParser();
|
xmlCleanupParser();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
pre_processing(void)
|
|
||||||
{
|
|
||||||
rc.xdg_shell_server_side_deco = true;
|
|
||||||
rc.font_size_activewindow = 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rcxml_init()
|
rcxml_init()
|
||||||
{
|
{
|
||||||
|
|
@ -226,7 +221,9 @@ rcxml_init()
|
||||||
has_run = true;
|
has_run = true;
|
||||||
LIBXML_TEST_VERSION
|
LIBXML_TEST_VERSION
|
||||||
wl_list_init(&rc.keybinds);
|
wl_list_init(&rc.keybinds);
|
||||||
pre_processing();
|
rc.xdg_shell_server_side_deco = true;
|
||||||
|
rc.corner_radius = 8;
|
||||||
|
rc.font_size_activewindow = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -273,6 +270,9 @@ post_processing(void)
|
||||||
rc.font_name_activewindow = strdup("sans");
|
rc.font_name_activewindow = strdup("sans");
|
||||||
}
|
}
|
||||||
set_title_height();
|
set_title_height();
|
||||||
|
if (rc.corner_radius >= rc.title_height) {
|
||||||
|
rc.corner_radius = rc.title_height - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ ssd_create(struct view *view)
|
||||||
part->box = ssd_box(view, part->type);
|
part->box = ssd_box(view, part->type);
|
||||||
struct rounded_corner_ctx ctx = {
|
struct rounded_corner_ctx ctx = {
|
||||||
.box = &part->box,
|
.box = &part->box,
|
||||||
.radius = 7.0, /* TODO: get from config */
|
.radius = rc.corner_radius,
|
||||||
.line_width = theme->border_width,
|
.line_width = theme->border_width,
|
||||||
.fill_color = theme->window_active_title_bg_color,
|
.fill_color = theme->window_active_title_bg_color,
|
||||||
.border_color = theme->window_active_handle_bg_color,
|
.border_color = theme->window_active_handle_bg_color,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue