lua action details (button sensitivity, text ellipsis)

This commit is contained in:
Robin Gareus 2016-04-25 12:56:21 +02:00
parent f4f9963cdd
commit 5e0f0fc9f2
3 changed files with 10 additions and 1 deletions

View File

@ -5747,9 +5747,11 @@ Editor::set_script_action_name (int i, const std::string& n)
if (n.empty ()) {
act->set_label (string_compose (_("Unset #%1"), i + 1));
act->set_tooltip (_("(no action bound"));
act->set_sensitive (false);
} else {
act->set_label (n);
act->set_tooltip (n);
act->set_sensitive (true);
}
KeyEditor::UpdateBindings ();
}

View File

@ -483,6 +483,7 @@ Editor::register_actions ()
string const n = string_compose (_("Unset #%1"), i);
act = reg_sens (editor_actions, a.c_str(), n.c_str(), sigc::bind (sigc::mem_fun (*this, &Editor::trigger_script), i - 1));
act->set_tooltip (_("(no action bound"));
act->set_sensitive (false);
}
Glib::RefPtr<ActionGroup> mouse_mode_actions = myactions.create_action_group (X_("MouseMode"));

View File

@ -42,6 +42,8 @@ LuaScriptManager::LuaScriptManager ()
_a_view.append_column (_("Name"), _a_model.name);
_a_view.get_column(0)->set_resizable (true);
_a_view.get_column(0)->set_expand (true);
_c_view.get_column(1)->set_resizable (true);
_c_view.get_column(1)->set_expand (true);
Gtk::HBox* edit_box = manage (new Gtk::HBox);
edit_box->set_spacing(3);
@ -72,9 +74,13 @@ LuaScriptManager::LuaScriptManager ()
_c_store = ListStore::create (_c_model);
_c_view.set_model (_c_store);
_c_view.append_column (_("Name"), _c_model.name);
_c_view.append_column (_("Signal(s)"), _c_model.signals);
_c_view.get_column(0)->set_resizable (true);
_c_view.get_column(0)->set_expand (true);
_c_view.append_column (_("Signal(s)"), _c_model.signals);
_c_view.get_column(1)->set_resizable (true);
_c_view.get_column(1)->set_expand (true);
Gtk::CellRendererText* r = dynamic_cast<Gtk::CellRendererText*>(_c_view.get_column_cell_renderer (1));
r->property_ellipsize () = Pango::ELLIPSIZE_MIDDLE;
edit_box = manage (new Gtk::HBox);
edit_box->set_spacing(3);