gui: Have collection manager handle keypresses directly
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
2824ac33eb
commit
4cae9aaf2b
|
@ -149,8 +149,9 @@ static bool on_key_pressed(GdkEventKey *event)
|
|||
{
|
||||
Library *lib;
|
||||
Gtk::TreeModel::Row row;
|
||||
std::string key = gdk_keyval_name(event->keyval);
|
||||
|
||||
if (lib :: key_name(event) != "Delete")
|
||||
if (key != "Delete")
|
||||
return false;
|
||||
|
||||
lib = current_library_and_row(row);
|
||||
|
|
|
@ -13,7 +13,6 @@ namespace lib
|
|||
void init(int *, char ***, const std::string &);
|
||||
const std::string share_file(const std::string &);
|
||||
Glib::RefPtr<Gtk::Builder> &get_builder();
|
||||
const std::string key_name(GdkEventKey *);
|
||||
void schedule(bool (*)(), unsigned int);
|
||||
|
||||
template <class T>
|
||||
|
|
11
lib/lib.cpp
11
lib/lib.cpp
|
@ -41,17 +41,6 @@ Glib::RefPtr<Gtk::Builder> &lib :: get_builder()
|
|||
return builder;
|
||||
}
|
||||
|
||||
const std::string lib :: key_name(GdkEventKey *event)
|
||||
{
|
||||
std::string key = gdk_keyval_name(event->keyval);
|
||||
return key;
|
||||
}
|
||||
|
||||
void lib :: idle(bool (*func)())
|
||||
{
|
||||
Glib :: signal_idle().connect(sigc::ptr_fun(func));
|
||||
}
|
||||
|
||||
void lib :: schedule(bool (*func)(), unsigned int milliseconds)
|
||||
{
|
||||
Glib :: signal_timeout().connect(sigc::ptr_fun(func), milliseconds);
|
||||
|
|
Loading…
Reference in New Issue