From 6ffdfd77353748f855b1528cdc6ca44b7154bfe3 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 4 Apr 2013 18:47:34 +0200 Subject: Add get_color helper function --- src/input_handler.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/input_handler.cc') diff --git a/src/input_handler.cc b/src/input_handler.cc index ef2afd2a..f8a2fc64 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -154,9 +154,8 @@ public: m_selected(m_choices.begin()) { DisplayCoord menu_pos{ context().ui().dimensions().line, 0_char }; - ColorRegistry& colreg = ColorRegistry::instance(); - context().ui().menu_show(choices, menu_pos, colreg["MenuForeground"], - colreg["MenuBackground"], MenuStyle::Prompt); + context().ui().menu_show(choices, menu_pos, get_color("MenuForeground"), + get_color("MenuBackground"), MenuStyle::Prompt); } void on_key(const Key& key) override @@ -378,9 +377,8 @@ public: context().ui().menu_hide(); DisplayCoord menu_pos{ context().ui().dimensions().line, 0_char }; - ColorRegistry& colreg = ColorRegistry::instance(); - context().ui().menu_show(candidates, menu_pos, colreg["MenuForeground"], - colreg["MenuBackground"], MenuStyle::Prompt); + context().ui().menu_show(candidates, menu_pos, get_color("MenuForeground"), + get_color("MenuBackground"), MenuStyle::Prompt); bool use_common_prefix = context().options()["complete_prefix"].get(); String prefix = use_common_prefix ? common_prefix(candidates) : String(); @@ -608,10 +606,9 @@ private: { DisplayCoord menu_pos = m_context.window().display_position(m_completions.begin); - ColorRegistry& colreg = ColorRegistry::instance(); m_context.ui().menu_show(m_matching_candidates, menu_pos, - colreg["MenuForeground"], - colreg["MenuBackground"], + get_color("MenuForeground"), + get_color("MenuBackground"), MenuStyle::Inline); m_context.ui().menu_select(m_current_candidate); } -- cgit v1.2.3