diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2009-11-18 19:47:54 +0100 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-11-18 19:47:54 +0100 |
commit | 45656a2e36a64aea8003ae81122ab84218017b27 (patch) | |
tree | 705060be60571eb62a710263dcb7e933e52f1f9d | |
parent | 194eaaf2397bb5d188f5ef26489fa65b8db455f9 (diff) |
improved column header widget
-rw-r--r-- | deadbeef.glade | 186 | ||||
-rw-r--r-- | gtkplaylist.c | 7 | ||||
-rw-r--r-- | interface.c | 9 |
3 files changed, 108 insertions, 94 deletions
diff --git a/deadbeef.glade b/deadbeef.glade index d95bdeb8..5983f711 100644 --- a/deadbeef.glade +++ b/deadbeef.glade @@ -704,66 +704,79 @@ </child> <child> - <widget class="GtkTable" id="table1"> + <widget class="GtkFrame" id="frame1"> <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">0</property> - <property name="column_spacing">0</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> <child> - <widget class="GtkHBox" id=" "> - <property name="border_width">3</property> + <widget class="GtkTable" id="table1"> <property name="visible">True</property> + <property name="n_rows">2</property> + <property name="n_columns">2</property> <property name="homogeneous">False</property> - <property name="spacing">0</property> + <property name="row_spacing">0</property> + <property name="column_spacing">0</property> <child> - <widget class="GtkVBox" id="vbox3"> + <widget class="GtkHBox" id=" "> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">0</property> <child> - <widget class="GtkDrawingArea" id="header"> - <property name="height_request">24</property> + <widget class="GtkVBox" id="vbox3"> <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <signal name="expose_event" handler="on_header_expose_event" last_modification_time="Thu, 06 Aug 2009 14:54:29 GMT"/> - <signal name="configure_event" handler="on_header_configure_event" last_modification_time="Thu, 06 Aug 2009 14:54:33 GMT"/> - <signal name="realize" handler="on_header_realize" last_modification_time="Thu, 06 Aug 2009 14:54:41 GMT"/> - <signal name="motion_notify_event" handler="on_header_motion_notify_event" last_modification_time="Thu, 06 Aug 2009 16:33:54 GMT"/> - <signal name="button_press_event" handler="on_header_button_press_event" last_modification_time="Thu, 06 Aug 2009 16:42:32 GMT"/> - <signal name="button_release_event" handler="on_header_button_release_event" last_modification_time="Thu, 06 Aug 2009 16:47:31 GMT"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> + <property name="homogeneous">False</property> + <property name="spacing">0</property> - <child> - <widget class="GtkDrawingArea" id="playlist"> - <property name="visible">True</property> - <property name="events">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK</property> - <signal name="configure_event" handler="on_playlist_configure_event" last_modification_time="Sat, 04 Jul 2009 00:03:23 GMT"/> - <signal name="expose_event" handler="on_playlist_expose_event" last_modification_time="Sat, 04 Jul 2009 00:03:29 GMT"/> - <signal name="realize" handler="on_playlist_realize" last_modification_time="Sat, 04 Jul 2009 00:03:36 GMT"/> - <signal name="button_press_event" handler="on_playlist_button_press_event" last_modification_time="Sat, 04 Jul 2009 00:41:38 GMT"/> - <signal name="scroll_event" handler="on_playlist_scroll_event" last_modification_time="Sat, 04 Jul 2009 17:16:21 GMT"/> - <signal name="drag_begin" handler="on_playlist_drag_begin" last_modification_time="Fri, 31 Jul 2009 10:36:23 GMT"/> - <signal name="drag_motion" handler="on_playlist_drag_motion" last_modification_time="Fri, 31 Jul 2009 10:36:30 GMT"/> - <signal name="drag_drop" handler="on_playlist_drag_drop" last_modification_time="Fri, 31 Jul 2009 10:36:39 GMT"/> - <signal name="drag_data_get" handler="on_playlist_drag_data_get" last_modification_time="Fri, 31 Jul 2009 10:36:43 GMT"/> - <signal name="drag_end" handler="on_playlist_drag_end" last_modification_time="Fri, 31 Jul 2009 11:41:00 GMT"/> - <signal name="drag_failed" handler="on_playlist_drag_failed" last_modification_time="Fri, 31 Jul 2009 11:41:05 GMT"/> - <signal name="drag_leave" handler="on_playlist_drag_leave" last_modification_time="Fri, 31 Jul 2009 11:41:11 GMT"/> - <signal name="button_release_event" handler="on_playlist_button_release_event" last_modification_time="Fri, 31 Jul 2009 12:20:56 GMT"/> - <signal name="motion_notify_event" handler="on_playlist_motion_notify_event" last_modification_time="Fri, 31 Jul 2009 12:23:49 GMT"/> - <signal name="drag_data_received" handler="on_playlist_drag_data_received" last_modification_time="Mon, 03 Aug 2009 12:07:39 GMT"/> - <signal name="drag_data_delete" handler="on_playlist_drag_data_delete" last_modification_time="Mon, 03 Aug 2009 12:35:47 GMT"/> + <child> + <widget class="GtkDrawingArea" id="header"> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <signal name="expose_event" handler="on_header_expose_event" last_modification_time="Thu, 06 Aug 2009 14:54:29 GMT"/> + <signal name="configure_event" handler="on_header_configure_event" last_modification_time="Thu, 06 Aug 2009 14:54:33 GMT"/> + <signal name="realize" handler="on_header_realize" last_modification_time="Thu, 06 Aug 2009 14:54:41 GMT"/> + <signal name="motion_notify_event" handler="on_header_motion_notify_event" last_modification_time="Thu, 06 Aug 2009 16:33:54 GMT"/> + <signal name="button_press_event" handler="on_header_button_press_event" last_modification_time="Thu, 06 Aug 2009 16:42:32 GMT"/> + <signal name="button_release_event" handler="on_header_button_release_event" last_modification_time="Thu, 06 Aug 2009 16:47:31 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkDrawingArea" id="playlist"> + <property name="visible">True</property> + <property name="events">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK</property> + <signal name="configure_event" handler="on_playlist_configure_event" last_modification_time="Sat, 04 Jul 2009 00:03:23 GMT"/> + <signal name="expose_event" handler="on_playlist_expose_event" last_modification_time="Sat, 04 Jul 2009 00:03:29 GMT"/> + <signal name="realize" handler="on_playlist_realize" last_modification_time="Sat, 04 Jul 2009 00:03:36 GMT"/> + <signal name="button_press_event" handler="on_playlist_button_press_event" last_modification_time="Sat, 04 Jul 2009 00:41:38 GMT"/> + <signal name="scroll_event" handler="on_playlist_scroll_event" last_modification_time="Sat, 04 Jul 2009 17:16:21 GMT"/> + <signal name="drag_begin" handler="on_playlist_drag_begin" last_modification_time="Fri, 31 Jul 2009 10:36:23 GMT"/> + <signal name="drag_motion" handler="on_playlist_drag_motion" last_modification_time="Fri, 31 Jul 2009 10:36:30 GMT"/> + <signal name="drag_drop" handler="on_playlist_drag_drop" last_modification_time="Fri, 31 Jul 2009 10:36:39 GMT"/> + <signal name="drag_data_get" handler="on_playlist_drag_data_get" last_modification_time="Fri, 31 Jul 2009 10:36:43 GMT"/> + <signal name="drag_end" handler="on_playlist_drag_end" last_modification_time="Fri, 31 Jul 2009 11:41:00 GMT"/> + <signal name="drag_failed" handler="on_playlist_drag_failed" last_modification_time="Fri, 31 Jul 2009 11:41:05 GMT"/> + <signal name="drag_leave" handler="on_playlist_drag_leave" last_modification_time="Fri, 31 Jul 2009 11:41:11 GMT"/> + <signal name="button_release_event" handler="on_playlist_button_release_event" last_modification_time="Fri, 31 Jul 2009 12:20:56 GMT"/> + <signal name="motion_notify_event" handler="on_playlist_motion_notify_event" last_modification_time="Fri, 31 Jul 2009 12:23:49 GMT"/> + <signal name="drag_data_received" handler="on_playlist_drag_data_received" last_modification_time="Mon, 03 Aug 2009 12:07:39 GMT"/> + <signal name="drag_data_delete" handler="on_playlist_drag_data_delete" last_modification_time="Mon, 03 Aug 2009 12:35:47 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> </widget> <packing> <property name="padding">0</property> @@ -773,54 +786,49 @@ </child> </widget> <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> </packing> </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - </packing> - </child> - <child> - <widget class="GtkVScrollbar" id="playscroll"> - <property name="visible">True</property> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="inverted">False</property> - <property name="adjustment">0 0 1 1 0 0</property> - <signal name="value_changed" handler="on_playscroll_value_changed" last_modification_time="Sat, 04 Jul 2009 01:42:24 GMT"/> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> + <child> + <widget class="GtkVScrollbar" id="playscroll"> + <property name="visible">True</property> + <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> + <property name="inverted">False</property> + <property name="adjustment">0 0 1 1 0 0</property> + <signal name="value_changed" handler="on_playscroll_value_changed" last_modification_time="Sat, 04 Jul 2009 01:42:24 GMT"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> - <child> - <widget class="GtkHScrollbar" id="playhscroll"> - <property name="visible">True</property> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="inverted">False</property> - <property name="adjustment">0 0 0 0 0 0</property> - <signal name="value_changed" handler="on_playhscroll_value_changed" last_modification_time="Sun, 13 Sep 2009 09:53:45 GMT"/> + <child> + <widget class="GtkHScrollbar" id="playhscroll"> + <property name="visible">True</property> + <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> + <property name="inverted">False</property> + <property name="adjustment">0 0 0 0 0 0</property> + <signal name="value_changed" handler="on_playhscroll_value_changed" last_modification_time="Sun, 13 Sep 2009 09:53:45 GMT"/> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> </child> </widget> <packing> diff --git a/gtkplaylist.c b/gtkplaylist.c index 57b71d27..a31caa2e 100644 --- a/gtkplaylist.c +++ b/gtkplaylist.c @@ -1386,10 +1386,11 @@ gtkpl_header_draw (gtkplaylist_t *ps) { int x = -ps->hscrollpos; int w = 100; int h = widget->allocation.height; - const char *detail = "toolbar"; + const char *detail = "button"; // fill background - gtk_paint_box (widget->style, ps->backbuf_header, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, NULL, detail, 0, 0, widget->allocation.width, widget->allocation.height); + //gdk_draw_rectangle (ps->backbuf_header, widget->style->bg_gc[0], TRUE, -10, -10, widget->allocation.width+20, widget->allocation.height+20); + gtk_paint_box (widget->style, ps->backbuf_header, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, NULL, detail, -10, -10, widget->allocation.width+20, widget->allocation.height+20); draw_begin ((uintptr_t)ps->backbuf_header); x = -ps->hscrollpos; gtkpl_column_t *c; @@ -1411,7 +1412,7 @@ gtkpl_header_draw (gtkplaylist_t *ps) { continue; } if (w > 0) { - gtk_paint_vline (widget->style, ps->backbuf_header, GTK_STATE_NORMAL, NULL, NULL, NULL, 0, h, xx+w - 2); + gtk_paint_vline (widget->style, ps->backbuf_header, GTK_STATE_NORMAL, NULL, NULL, NULL, 2, h-4, xx+w - 2); GdkColor *gdkfg = &widget->style->fg[0]; float fg[3] = {(float)gdkfg->red/0xffff, (float)gdkfg->green/0xffff, (float)gdkfg->blue/0xffff}; draw_set_fg_color (fg); diff --git a/interface.c b/interface.c index 9abc876b..ef6d14ef 100644 --- a/interface.c +++ b/interface.c @@ -99,6 +99,7 @@ create_mainwin (void) GtkWidget *image6; GtkWidget *volumebar; GtkWidget *seekbar; + GtkWidget *frame1; GtkWidget *table1; GtkWidget *_; GtkWidget *vbox3; @@ -448,16 +449,19 @@ create_mainwin (void) gtk_widget_set_size_request (seekbar, 200, -1); gtk_widget_set_events (seekbar, GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); + frame1 = gtk_frame_new (NULL); + gtk_widget_show (frame1); + gtk_box_pack_start (GTK_BOX (vbox1), frame1, TRUE, TRUE, 0); + table1 = gtk_table_new (2, 2, FALSE); gtk_widget_show (table1); - gtk_box_pack_start (GTK_BOX (vbox1), table1, TRUE, TRUE, 0); + gtk_container_add (GTK_CONTAINER (frame1), table1); _ = gtk_hbox_new (FALSE, 0); gtk_widget_show (_); gtk_table_attach (GTK_TABLE (table1), _, 0, 1, 0, 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - gtk_container_set_border_width (GTK_CONTAINER (_), 3); vbox3 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox3); @@ -764,6 +768,7 @@ create_mainwin (void) GLADE_HOOKUP_OBJECT (mainwin, image6, "image6"); GLADE_HOOKUP_OBJECT (mainwin, volumebar, "volumebar"); GLADE_HOOKUP_OBJECT (mainwin, seekbar, "seekbar"); + GLADE_HOOKUP_OBJECT (mainwin, frame1, "frame1"); GLADE_HOOKUP_OBJECT (mainwin, table1, "table1"); GLADE_HOOKUP_OBJECT (mainwin, _, "_"); GLADE_HOOKUP_OBJECT (mainwin, vbox3, "vbox3"); |