ocarina: Don't track currently focused entry
It's easier to check the widgets on the current page. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
84ff25b3be
commit
95d8d83fa0
|
@ -13,7 +13,6 @@ using namespace std;
|
|||
static PlaylistWidgets library_widgets;
|
||||
static PlaylistWidgets recent_widgets;
|
||||
static PlaylistWidgets banned_widgets;
|
||||
static GtkWidget *focused_entry = NULL;
|
||||
static list<struct PlaylistWidgets *> dynamic_widgets;
|
||||
|
||||
struct PlaylistWidgets *find_playlist_widgets(libsaria::Playlist *plist)
|
||||
|
@ -92,18 +91,9 @@ void playlist_switch_to_n(unsigned int n)
|
|||
gtk_notebook_set_current_page(tabs, n);
|
||||
}
|
||||
|
||||
static gboolean on_focus_change(GtkWidget *entry, GdkEvent *event, gpointer data)
|
||||
{
|
||||
if (gtk_widget_is_focus(entry))
|
||||
focused_entry = entry;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool playlist_entry_focused()
|
||||
{
|
||||
if (!focused_entry)
|
||||
return false;
|
||||
return gtk_widget_is_focus(focused_entry);
|
||||
return gtk_widget_is_focus(GTK_WIDGET(current_widgets()->entry));
|
||||
}
|
||||
|
||||
void playlist_focus_entry()
|
||||
|
@ -176,7 +166,6 @@ static void init_widgets(struct PlaylistWidgets *widgets, libsaria::Playlist *pl
|
|||
{
|
||||
setup_widgets(widgets, playlist);
|
||||
setup_playlist_page(widgets);
|
||||
g_signal_connect(widgets->entry, "focus-in-event", G_CALLBACK(on_focus_change), NULL);
|
||||
}
|
||||
|
||||
static void add_static_page(const string &name, struct PlaylistWidgets *widgets,
|
||||
|
|
Loading…
Reference in New Issue