library search UI elements added
authorMaksym Veremeyenko <verem@m1stereo.tv>
Thu, 23 Jun 2011 09:43:53 +0000 (12:43 +0300)
committerMaksym Veremeyenko <verem@m1stereo.tv>
Thu, 23 Jun 2011 09:43:53 +0000 (12:43 +0300)
src/omnplay.h
src/ui.c
src/ui_buttons.c

index 4fc8392..75f4f03 100644 (file)
@@ -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;
 
index 6e3b915..1a6a2f9 100644 (file)
--- 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;
 }
 
index 8af9ea6..8300cc2 100644 (file)
@@ -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,