Skip to content

Commit

Permalink
- Added the generic_fallback config option.
Browse files Browse the repository at this point in the history
- Removed the `force_svg_icons` config option.

When `generic_fallback` is set to a true value, obmenu-generator will pass the `generic-fallback` flag to `Gtk2::IconLookupFlags`, which will try to shorten icon names at '-' characters before looking at inherited themes.
  • Loading branch information
trizen committed Oct 4, 2017
1 parent c143d5f commit b8747c4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions obmenu-generator
Expand Up @@ -24,10 +24,11 @@
# Name: obmenu-generator
# License: GPLv3
# Created: 25 March 2011
# Latest edit: 16 September 2017
# Latest edit: 04 October 2017
# https://github.com/trizen/obmenu-generator

use 5.014;

#use strict;
#use warnings;

Expand Down Expand Up @@ -115,8 +116,8 @@ my $config_help = <<"HELP";
| gtk_rc_filename : Absolute path to the GTK configuration file.
| missing_icon : Use this icon for missing icons (default: gtk-missing-image)
| icon_size : Preferred size for icons. (default: 32)
| force_svg_icons : Use only SVG icons. (default: 0)
| force_icon_size : Use only icons at the preferred icon size, if possible. (default: 0)
| generic_fallback : Try to shorten icon name at '-' characters before looking at inherited themes. (default: 0)
| force_icon_size : Always get the icon scaled to the requested size. (default: 0)
|| KEYS
| name_keys : Valid keys for application name.
Expand Down Expand Up @@ -246,9 +247,9 @@ my %CONFIG = (
missing_icon => 'gtk-missing-image',
gtk_rc_filename => "$home_dir/.gtkrc-2.0",

icon_size => 32,
force_svg_icons => 0,
force_icon_size => 0,
icon_size => 32,
force_icon_size => 0,
generic_fallback => 0,

VERSION => $version,
);
Expand Down Expand Up @@ -438,8 +439,8 @@ sub get_icon_path {
#<<<
state $flags = "${gtk}::IconLookupFlags"->new(
[
($CONFIG{force_icon_size} ? 'force-size' : ()),
($CONFIG{force_svg_icons} ? 'force-svg' : ()),
($CONFIG{force_icon_size} ? 'force-size' : ()),
($CONFIG{generic_fallback} ? 'generic-fallback' : ()),
]
);
#>>>
Expand Down

0 comments on commit b8747c4

Please sign in to comment.