From: Maksym Veremeyenko Date: Thu, 23 Jun 2011 09:43:53 +0000 (+0300) Subject: library search UI elements added X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=459178fa4efc80e84a3044d45796e05f4012f257;p=omnplay library search UI elements added --- diff --git a/src/omnplay.h b/src/omnplay.h index 4fc8392..75f4f03 100644 --- a/src/omnplay.h +++ b/src/omnplay.h @@ -48,6 +48,9 @@ typedef enum control_buttons BUTTON_LIBRARY_ADD, BUTTON_LIBRARY_REFRESH, + BUTTON_LIBRARY_FIND, + BUTTON_LIBRARY_FIND_NEXT, + BUTTON_LAST } control_buttons_t; @@ -152,6 +155,7 @@ typedef struct omnplay_instance pthread_mutex_t lock; pthread_t refresh_thread; GtkWidget *refresh_ui[2]; + GtkWidget *search; } library; } omnplay_instance_t; diff --git a/src/ui.c b/src/ui.c index 6e3b915..1a6a2f9 100644 --- a/src/ui.c +++ b/src/ui.c @@ -229,6 +229,30 @@ static GtkWidget* pane_library_buttons(GtkWidget* top, omnplay_instance_t* app) return hbox; } +static GtkWidget* pane_library_search_buttons(GtkWidget* top, omnplay_instance_t* app) +{ + GtkWidget* hbox; + + hbox = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox); + + /* text entry */ + gtk_box_pack_start (GTK_BOX (hbox), + app->library.search = gtk_entry_new(), + TRUE, TRUE, 0); + gtk_widget_show(app->library.search); + + /* playlist modify buttons */ + gtk_box_pack_start (GTK_BOX (hbox), + ui_create_button(top, app, BUTTON_LIBRARY_FIND), + FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), + ui_create_button(top, app, BUTTON_LIBRARY_FIND_NEXT), + FALSE, FALSE, 0); + + return hbox; +} + static GtkWidget* pane_library(GtkWidget* top, omnplay_instance_t* app) { GtkWidget* vbox; @@ -242,11 +266,16 @@ static GtkWidget* pane_library(GtkWidget* top, omnplay_instance_t* app) pane_library_buttons(top, app), FALSE, FALSE, 0); - /* add buttons box */ + /* add grid */ gtk_box_pack_start (GTK_BOX (vbox), pane_library_grid(top, app), TRUE, TRUE, 0); + /* add search buttons */ + gtk_box_pack_start (GTK_BOX (vbox), + pane_library_search_buttons(top, app), + FALSE, FALSE, 0); + return vbox; } diff --git a/src/ui_buttons.c b/src/ui_buttons.c index 8af9ea6..8300cc2 100644 --- a/src/ui_buttons.c +++ b/src/ui_buttons.c @@ -170,7 +170,22 @@ static const button_desc_t buttons[] = "button_library_refresh", "Axialis_Team_library_refresh_16x16.png" }, - + { + BUTTON_LIBRARY_FIND, + "Find item", + NULL, + "Find", + "button_library_find", + NULL, + }, + { + BUTTON_LIBRARY_FIND_NEXT, + "Find next item", + NULL, + "Next", + "button_library_find_next", + NULL, + }, { BUTTON_LAST,