Skip to content
Snippets Groups Projects
Commit 65687600 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Replace clear button with sexy icon entry

parent cfb68cff
No related branches found
No related tags found
No related merge requests found
bin_PROGRAMS = sflphone-gtk bin_PROGRAMS = sflphone-gtk
NOFIFY_LIBS=-lnotify
SEXY_LIBS=-lsexy
sflphone_gtk_SOURCES = \ sflphone_gtk_SOURCES = \
main.c \ main.c \
errors.c \ errors.c \
...@@ -28,7 +31,7 @@ noinst_HEADERS = actions.h dbus.h sflnotify.h mainwindow.h calllist.h dialpad.h ...@@ -28,7 +31,7 @@ noinst_HEADERS = actions.h dbus.h sflnotify.h mainwindow.h calllist.h dialpad.h
callmanager-glue.h errors.h sflphone_const.h configurationmanager-glue.h instance-glue.h menus.h calltab.h calltree.h configwindow.h \ callmanager-glue.h errors.h sflphone_const.h configurationmanager-glue.h instance-glue.h menus.h calltab.h calltree.h configwindow.h \
historyfilter.h accountlist.h accountwindow.h marshaller.h sliders.h statusicon.h timestamp.h historyfilter.h accountlist.h accountwindow.h marshaller.h sliders.h statusicon.h timestamp.h
EXTRA_DIST = marshaller.list EXTRA_DIST = marshaller.list
sflphone_gtk_LDADD = $(DEPS_LIBS) -lnotify sflphone_gtk_LDADD = $(DEPS_LIBS) $(NOTIFY_LIBS) $(SEXY_LIBS)
AM_CPPFLAGS = $(DEPS_CFLAGS) \ AM_CPPFLAGS = $(DEPS_CFLAGS) \
-DICONS_DIR=\""$(datadir)/sflphone"\" \ -DICONS_DIR=\""$(datadir)/sflphone"\" \
......
...@@ -152,7 +152,7 @@ toggle_history(GtkToggleToolButton *toggle_tool_button, ...@@ -152,7 +152,7 @@ toggle_history(GtkToggleToolButton *toggle_tool_button,
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (active_calltree->view)); sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (active_calltree->view));
g_signal_emit_by_name(sel, "changed"); g_signal_emit_by_name(sel, "changed");
toolbar_update_buttons(); toolbar_update_buttons();
gtk_tree_model_filter_refilter(histfilter); gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(histfilter));
} }
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <gtk/gtk.h>
#include <historyfilter.h> #include <historyfilter.h>
#include <calltree.h> #include <calltree.h>
...@@ -34,7 +33,7 @@ is_visible(GtkTreeModel* model, GtkTreeIter* iter, gpointer data) ...@@ -34,7 +33,7 @@ is_visible(GtkTreeModel* model, GtkTreeIter* iter, gpointer data)
{ {
GValue val = {0, }; GValue val = {0, };
gchar* text; gchar* text;
gchar* search = gtk_entry_get_text(GTK_ENTRY(filter_entry)); gchar* search = (gchar*)gtk_entry_get_text(GTK_ENTRY(filter_entry));
gtk_tree_model_get_value(GTK_TREE_MODEL(model), iter, 1, &val); gtk_tree_model_get_value(GTK_TREE_MODEL(model), iter, 1, &val);
if(G_VALUE_HOLDS_STRING(&val)){ if(G_VALUE_HOLDS_STRING(&val)){
text = (gchar *)g_value_get_string(&val); text = (gchar *)g_value_get_string(&val);
...@@ -70,19 +69,17 @@ clear_filter_entry(GtkButton* button, ...@@ -70,19 +69,17 @@ clear_filter_entry(GtkButton* button,
GtkWidget* GtkWidget*
create_filter_entry() create_filter_entry()
{ {
GtkWidget* clear_button = gtk_button_new(); GtkWidget* image;
GtkWidget* ret = gtk_hbox_new(FALSE, 0); GtkWidget* ret = gtk_hbox_new(FALSE, 0);
GtkWidget* clear_img = gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_button_set_image(GTK_BUTTON(clear_button), clear_img); filter_entry = sexy_icon_entry_new();
g_signal_connect(GTK_BUTTON(clear_button), "clicked", G_CALLBACK(clear_filter_entry), NULL); image = gtk_image_new_from_stock( GTK_STOCK_FIND , GTK_ICON_SIZE_SMALL_TOOLBAR);
sexy_icon_entry_set_icon( SEXY_ICON_ENTRY(filter_entry), SEXY_ICON_ENTRY_PRIMARY , GTK_IMAGE(image) );
filter_entry = gtk_entry_new(); sexy_icon_entry_add_clear_button( SEXY_ICON_ENTRY(filter_entry) );
gtk_entry_set_text(GTK_ENTRY(filter_entry), "Search"); gtk_entry_set_text(GTK_ENTRY(filter_entry), "Search");
g_signal_connect(GTK_ENTRY(filter_entry), "changed", G_CALLBACK(filter_entry_changed), NULL); g_signal_connect(GTK_ENTRY(filter_entry), "changed", G_CALLBACK(filter_entry_changed), NULL);
g_signal_connect(GTK_ENTRY(filter_entry), "grab-focus", G_CALLBACK(clear_filter_entry_if_default), NULL); g_signal_connect(GTK_ENTRY(filter_entry), "grab-focus", G_CALLBACK(clear_filter_entry_if_default), NULL);
gtk_box_pack_start(GTK_BOX(ret), filter_entry, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(ret), filter_entry, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(ret), clear_button, FALSE, FALSE, 0);
return ret; return ret;
} }
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <calllist.h> #include <calllist.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <libsexy/sexy-icon-entry.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment