mirror of
https://github.com/labwc/labwc.git
synced 2026-03-21 05:33:52 -04:00
src/menu: add global config for menu.showIcons
This commit is contained in:
parent
1fa4070025
commit
ed4553fc7e
5 changed files with 12 additions and 2 deletions
|
|
@ -1121,6 +1121,7 @@ situation.
|
||||||
```
|
```
|
||||||
<menu>
|
<menu>
|
||||||
<ignoreButtonReleasePeriod>250</ignoreButtonReleasePeriod>
|
<ignoreButtonReleasePeriod>250</ignoreButtonReleasePeriod>
|
||||||
|
<showIcons>yes</showIcons>
|
||||||
</menu>
|
</menu>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -1134,6 +1135,11 @@ situation.
|
||||||
option has been exposed for unusual use-cases. It is equivalent to
|
option has been exposed for unusual use-cases. It is equivalent to
|
||||||
Openbox's `<hideDelay>`. Default is 250 ms.
|
Openbox's `<hideDelay>`. Default is 250 ms.
|
||||||
|
|
||||||
|
*<menu><showIcons>*
|
||||||
|
Show menu icons based on the `icon` attribute of menu label elements.
|
||||||
|
Default is yes. Requires libsfdo. If labwc is built without it, no
|
||||||
|
icons will be shown.
|
||||||
|
|
||||||
## MAGNIFIER
|
## MAGNIFIER
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -676,6 +676,7 @@
|
||||||
|
|
||||||
<menu>
|
<menu>
|
||||||
<ignoreButtonReleasePeriod>250</ignoreButtonReleasePeriod>
|
<ignoreButtonReleasePeriod>250</ignoreButtonReleasePeriod>
|
||||||
|
<showIcons>yes</showIcons>
|
||||||
</menu>
|
</menu>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,7 @@ struct rcxml {
|
||||||
|
|
||||||
/* Menu */
|
/* Menu */
|
||||||
unsigned int menu_ignore_button_release_period;
|
unsigned int menu_ignore_button_release_period;
|
||||||
|
bool menu_show_icons;
|
||||||
|
|
||||||
/* Magnifier */
|
/* Magnifier */
|
||||||
int mag_width;
|
int mag_width;
|
||||||
|
|
|
||||||
|
|
@ -1252,6 +1252,8 @@ entry(xmlNode *node, char *nodename, char *content)
|
||||||
tablet_get_dbl_if_positive(content, "relativeMotionSensitivity");
|
tablet_get_dbl_if_positive(content, "relativeMotionSensitivity");
|
||||||
} else if (!strcasecmp(nodename, "ignoreButtonReleasePeriod.menu")) {
|
} else if (!strcasecmp(nodename, "ignoreButtonReleasePeriod.menu")) {
|
||||||
rc.menu_ignore_button_release_period = atoi(content);
|
rc.menu_ignore_button_release_period = atoi(content);
|
||||||
|
} else if (!strcasecmp(nodename, "showIcons.menu")) {
|
||||||
|
set_bool(content, &rc.menu_show_icons);
|
||||||
} else if (!strcasecmp(nodename, "width.magnifier")) {
|
} else if (!strcasecmp(nodename, "width.magnifier")) {
|
||||||
rc.mag_width = atoi(content);
|
rc.mag_width = atoi(content);
|
||||||
} else if (!strcasecmp(nodename, "height.magnifier")) {
|
} else if (!strcasecmp(nodename, "height.magnifier")) {
|
||||||
|
|
@ -1497,6 +1499,7 @@ rcxml_init(void)
|
||||||
rc.workspace_config.min_nr_workspaces = 1;
|
rc.workspace_config.min_nr_workspaces = 1;
|
||||||
|
|
||||||
rc.menu_ignore_button_release_period = 250;
|
rc.menu_ignore_button_release_period = 250;
|
||||||
|
rc.menu_show_icons = true;
|
||||||
|
|
||||||
rc.mag_width = 400;
|
rc.mag_width = 400;
|
||||||
rc.mag_height = 400;
|
rc.mag_height = 400;
|
||||||
|
|
|
||||||
|
|
@ -459,8 +459,7 @@ fill_item(char *nodename, char *content)
|
||||||
"nodename: '%s' content: '%s'", nodename, content);
|
"nodename: '%s' content: '%s'", nodename, content);
|
||||||
} else if (!strcmp(nodename, "icon")) {
|
} else if (!strcmp(nodename, "icon")) {
|
||||||
#if HAVE_LIBSFDO
|
#if HAVE_LIBSFDO
|
||||||
// TODO: add some rc.menu_icons bool
|
if (rc.menu_show_icons && !string_null_or_empty(content)) {
|
||||||
if (true && !string_null_or_empty(content)) {
|
|
||||||
xstrdup_replace(current_item->icon_name, content);
|
xstrdup_replace(current_item->icon_name, content);
|
||||||
current_menu->has_icons = true;
|
current_menu->has_icons = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue