diff options
author | Robin Gareus <robin@gareus.org> | 2014-09-07 03:02:28 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-09-07 20:23:49 +0200 |
commit | 5dab88c3fa34692b2c7cedd2ac817a50fac193b4 (patch) | |
tree | 2539c8bd5bbb2f13a03489df94bb21dfb05482a3 /gtk2_ardour/ui_config.cc | |
parent | 75df0a9c78cd845dda416bdb036c4c881c3f9a45 (diff) |
prepare support for [color] style name postfix
Diffstat (limited to 'gtk2_ardour/ui_config.cc')
-rw-r--r-- | gtk2_ardour/ui_config.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gtk2_ardour/ui_config.cc b/gtk2_ardour/ui_config.cc index 4c7ec10278..86e08d7fa6 100644 --- a/gtk2_ardour/ui_config.cc +++ b/gtk2_ardour/ui_config.cc @@ -294,6 +294,35 @@ UIConfiguration::color_by_name (const std::string& name) if (i != canvas_colors.end()) { return i->second->get(); } +#if 0 // yet unsed experimental style postfix + /* Idea: use identical colors but different font/sizes + * for variants of the same 'widget'. + * + * example: + * set_name("mute button"); // in route_ui.cc + * set_name("mute button small"); // in mixer_strip.cc + * + * ardour3_widget_list.rc: + * widget "*mute button" style:highest "small_button" + * widget "*mute button small" style:highest "very_small_text" + * + * both use color-schema of defined in + * BUTTON_VARS(MuteButton, "mute button") + * + * (in this particular example the widgets should be packed + * vertically shinking the mixer strip ones are currently not) + */ + const size_t name_len = name.size(); + const size_t name_sep = name.find(':'); + for (i = canvas_colors.begin(); i != canvas_colors.end(), name_sep != string::npos; ++i) { + const size_t cmp_len = i->first.size(); + const size_t cmp_sep = i->first.find(':'); + if (cmp_len >= name_len || cmp_sep == string::npos) continue; + if (name.substr(name_sep) != i->first.substr(cmp_sep)) continue; + if (name.substr(0, cmp_sep) != i->first.substr(0, cmp_sep)) continue; + return i->second->get(); + } +#endif // cerr << string_compose (_("Color %1 not found"), name) << endl; return RGBA_TO_UINT (g_random_int()%256,g_random_int()%256,g_random_int()%256,0xff); |