mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
ssd: apply title layout
This commit is contained in:
parent
9a252249c9
commit
39ff873d5b
7 changed files with 140 additions and 78 deletions
28
src/theme.c
28
src/theme.c
|
|
@ -84,14 +84,26 @@ corner_from_icon_name(const char *icon_name)
|
|||
{
|
||||
assert(icon_name);
|
||||
|
||||
/*
|
||||
* TODO: Once we implement titleLayout we can make the
|
||||
* return values depend on parsed config values.
|
||||
*/
|
||||
if (!strcmp(icon_name, "menu")) {
|
||||
return LAB_CORNER_TOP_LEFT;
|
||||
} else if (!strcmp(icon_name, "close")) {
|
||||
return LAB_CORNER_TOP_RIGHT;
|
||||
struct title_button *b;
|
||||
wl_list_for_each(b, &rc.title_buttons_left, link) {
|
||||
if ((b->type == LAB_SSD_BUTTON_WINDOW_MENU && !strcmp(icon_name, "menu"))
|
||||
|| (b->type == LAB_SSD_BUTTON_ICONIFY && !strcmp(icon_name, "iconify"))
|
||||
|| (b->type == LAB_SSD_BUTTON_MAXIMIZE && !strcmp(icon_name, "max"))
|
||||
|| (b->type == LAB_SSD_BUTTON_MAXIMIZE && !strcmp(icon_name, "max_toggled"))
|
||||
|| (b->type == LAB_SSD_BUTTON_CLOSE && !strcmp(icon_name, "close"))) {
|
||||
return LAB_CORNER_TOP_LEFT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
wl_list_for_each_reverse(b, &rc.title_buttons_right, link) {
|
||||
if ((b->type == LAB_SSD_BUTTON_WINDOW_MENU && !strcmp(icon_name, "menu"))
|
||||
|| (b->type == LAB_SSD_BUTTON_ICONIFY && !strcmp(icon_name, "iconify"))
|
||||
|| (b->type == LAB_SSD_BUTTON_MAXIMIZE && !strcmp(icon_name, "max"))
|
||||
|| (b->type == LAB_SSD_BUTTON_MAXIMIZE && !strcmp(icon_name, "max_toggled"))
|
||||
|| (b->type == LAB_SSD_BUTTON_CLOSE && !strcmp(icon_name, "close"))) {
|
||||
return LAB_CORNER_TOP_RIGHT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return LAB_CORNER_UNKNOWN;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue